From patchwork Tue Nov 24 15:18:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 331396 Delivered-To: patch@linaro.org Received: by 2002:a17:907:2110:0:0:0:0 with SMTP id qn16csp4456853ejb; Tue, 24 Nov 2020 07:20:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJw1XNfb8980ul7uf75FsCuR21cAUglj0Q2OHL/5hehHDVU21RKx2hJAzKhgh/MxN4GDIlaY X-Received: by 2002:a05:6402:1153:: with SMTP id g19mr4452746edw.312.1606231216910; Tue, 24 Nov 2020 07:20:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606231216; cv=none; d=google.com; s=arc-20160816; b=ix9vdOwxekQMNG7AsnlvpqL4niT1L9gT3OhiLB4AY4QAE9Ck5l5d+FczlXhTObevGY dUhhH/NjJY0Ojuph89dV8l7dPhXmxMcG7WNZs+McTpGQipwrczlBsTk10yE1kwzGFaiO Xme52zUq2TNgXloDnSvQnepeJEv2dmxrcgfvDbIs6OnkkLc1l0zdI8rqEkzo+n9tzgR3 gQVwPEBAYzWaFg10fFIi+LebcFOwhezSiyBb6WTsI3VjtNQv3L3UzeqPh8sjdJNkGB7A 7JjM9nrGzRB5RfrenneY1Ycg+ecuC0o63+b4OwbNpKpjQ9YgUw31nF1xTouxUmu19t0r PZjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=dEbS4+72HWdGZqElYPpXxt0aiNpOElByqVoFVeUCrAI=; b=BAvoa/FUd+1uw5OdY9ueUfk4yft96kISru7zZljnwbsFNZAWxo4wwxDG1QPCW/0NAj L/P5p1lFW02bnOCWz05Cg2jl7zcYGONaOqp1PDfH8hH98xo9sCWWEoMNTodMdGmfoNrG u6fP8WL2nW+OoEPUHOXwDAQdxTO66WuPs/UJHG6zpmmivZrK2J8euiqgUegd98CSVn5c FYWhLrVgb7ozVRxELuZ4E+itJlPouKEaghQaFxFJ/onfvD7Ef+7+01zKIO6KbTjDtcwy BSGHp21qnk7XIxRps/HQ54atnyb1jcBMvaSIWUfomny9iNOVVrg0V9VGcODMrM04HCRJ Gilg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lhCQpvCc; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b26si8980765edy.172.2020.11.24.07.20.16; Tue, 24 Nov 2020 07:20:16 -0800 (PST) Received-SPF: pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lhCQpvCc; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389293AbgKXPSn (ORCPT + 8 others); Tue, 24 Nov 2020 10:18:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:36456 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732490AbgKXPSn (ORCPT ); Tue, 24 Nov 2020 10:18:43 -0500 Received: from threadripper.lan (HSI-KBW-46-223-126-90.hsi.kabel-badenwuerttemberg.de [46.223.126.90]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4378A206D5; Tue, 24 Nov 2020 15:18:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606231122; bh=MnqF57UH63iXjzy798rGPIrvpOmsMor/v8SjKsNmLD4=; h=From:To:Cc:Subject:Date:From; b=lhCQpvCcczcIJvlOOAtOz0HndDUjPv+GfD3/y5jwU/6MLaqdCbXXBADVC3rvbFGmf bQufY7lecmoDsEU6pJdNG31KhIk4QCDA8Kg5BPQV3MH7IXAB7gYjvsnkp8K/8ARlIE yibO2D+vhMy1QnhA0RkNw4px2qYhG+s117ZgHgOM= From: Arnd Bergmann To: netdev@vger.kernel.org Cc: Arnd Bergmann , "David S. Miller" , Jakub Kicinski , Christoph Hellwig , Jiri Pirko , Taehee Yoo , Eric Dumazet , Alexei Starovoitov , Andrew Lunn , linux-kernel@vger.kernel.org Subject: [PATCH net-next v4 0/4] remove compat_alloc_user_space() Date: Tue, 24 Nov 2020 16:18:24 +0100 Message-Id: <20201124151828.169152-1-arnd@kernel.org> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Arnd Bergmann This is the fourth version of my series, now spanning four patches instead of two, with a new approach for handling struct ifreq compatibility after I realized that my earlier approach introduces additional problems. The idea here is to always push down the compat conversion deeper into the call stack: rather than pretending to be native mode with a modified copy of the original data on the user space stack, have the code that actually works on the data understand the difference between native and compat versions. I have spent a long time looking at all drivers that implement an ndo_do_ioctl callback to verify that my assumptions are correct. This has led to a series of 29 additional patches that I am not including here but will post separately, fixing a number of bugs in SIOCDEVPRIVATE ioctls, removing dead code, and splitting ndo_do_ioctl into two new ndo callbacks for private and ethernet specific commands. The patches are identical to v3 that I sent a few weeks ago, except this avoids the build failure when CONFIG_COMPAT is disabled. Arnd Changes in v4: - build fix without CONFIG_INET - build fix without CONFIG_COMPAT - style fixes pointed out by hch Changes in v3: - complete rewrite of the series Arnd Bergmann (4): ethtool: improve compat ioctl handling net: socket: rework SIOC?IFMAP ioctls net: socket: simplify dev_ifconf handling net: socket: rework compat_ifreq_ioctl() include/linux/compat.h | 82 +++++------ include/linux/ethtool.h | 4 - include/linux/inetdevice.h | 9 ++ include/linux/netdevice.h | 12 +- net/appletalk/ddp.c | 4 +- net/core/dev_ioctl.c | 152 ++++++++++--------- net/ethtool/ioctl.c | 143 ++++++++++++++++-- net/ieee802154/socket.c | 4 +- net/ipv4/af_inet.c | 6 +- net/ipv4/devinet.c | 4 +- net/qrtr/qrtr.c | 4 +- net/socket.c | 289 ++++++++----------------------------- 12 files changed, 338 insertions(+), 375 deletions(-) Cc: "David S. Miller" Cc: Jakub Kicinski Cc: Christoph Hellwig Cc: Jiri Pirko Cc: Taehee Yoo Cc: Eric Dumazet Cc: Alexei Starovoitov Cc: Andrew Lunn Cc: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org -- 2.27.0