From patchwork Thu Jul 22 14:28:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 483901 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp412220jao; Thu, 22 Jul 2021 07:29:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyn1D5vu5VTU0NKQw4BuH9dE7J64r2JBMdD7vls6oj/A4Zje49hUyWD249dllwnLn6XdUn4 X-Received: by 2002:a17:906:c7d6:: with SMTP id dc22mr147291ejb.517.1626964164025; Thu, 22 Jul 2021 07:29:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626964164; cv=none; d=google.com; s=arc-20160816; b=Jn3ai+p2eXL1s4MEyGifWlm4IvyzY1mSu0ARfi9jKZ8KICGqnF1fkHPn7CCvb5n7Aw D8e7m9QhHxub6ZcaWia3FbnHvk4g8IcWupB5sK5jN4gGuUSTZS3Kowgs4JuT319vJ364 FaG1KBc/aFxFOEJ0njPzhtCcU6Md+7fhuF9cJlD+6R27u/hG9mjqQm54isrUXKrv3O6v LFY1a6CERIB7O9zk6WQjKAie33okQrkWLQtLdKtLGOEn/NuzVrfn7//sFRxMOpUFMKFn z5ygOsNW3OLKauNB+fXASHbOEQi4w6BIy1T9sCuPKCqDMypgCqqjvBfn8c7NgeenIXBe gV4Q== 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=bT1s8tPtzum1Q33r//gXZ/zjiAbc3nGTy87k5j9MGEc=; b=05KSiX3bG4WBzE15h4CP+/SEa3NryZ1jkYCoM+DbsjvOc6Qs1AX2iDiqSYVFYaNw/C 3Gw86PNI2G2fkuzavKjB0uGI5Ftgt5TY9HOzvlhu4LpEG0EikpndBeO4yiSWCIpgU5sH 5OFQ0kJ3i+dCOjE5UyFN+V5S9ZWCpKojedNpttOB2qxJO8xuHi7zbWO1KIdjw+gERtpy eg6WMFNU8ATg+/+uodx+S9da4SF1nUHsQmDTvVpbHeQVxQozL2XANv8b1grFHMJSIQTM j+gsUXcvTBigJ6P2MuQ1rfG3h3q7pDcceGXXBRXdK6qLfltdGs290UKe2iQq0U9z13Jf 153w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cqbniFsd; 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 z4si16891079edb.175.2021.07.22.07.29.23; Thu, 22 Jul 2021 07:29:24 -0700 (PDT) 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=k20201202 header.b=cqbniFsd; 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 S232378AbhGVNso (ORCPT + 8 others); Thu, 22 Jul 2021 09:48:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:44784 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229934AbhGVNsm (ORCPT ); Thu, 22 Jul 2021 09:48:42 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6FE1A6101E; Thu, 22 Jul 2021 14:29:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626964157; bh=zM04WpA1f7iRwT47P4olhNDO3hfO6UH/Gt2Ynkv7aOQ=; h=From:To:Cc:Subject:Date:From; b=cqbniFsd8XOi4XfrJjOLuySlDUQ7CBCdF3SdSpwbfun3l4gP0pHz9Wd5SRJfmw01D rciF8Kv7FW46A5EwjsN3Vyf/5Rvh5E4R1qbfRkNj4Ah7m15FA70xcCyR2lJGOf7ydu jIYTxKhsUR7/+TFmf1JMvzJem8QxdQDfXl9JoKgQvi8CA3aKTBIcT5vNSJ16PLNIQn 2iB22HcT9QKEsx04GsH092Gr337HqpBpxy1s9QDpdG8P/ZwhVhh5Akiv/OktZiNros oQ4kaV5Pav2/o+o+R2LAoMB29VqRD9QNkOwZ0w8PFM5LeRC8/XOeJCgqB1Y3+bIYtV oT1Qe8xs2kF/Q== From: Arnd Bergmann To: netdev@vger.kernel.org Cc: Arnd Bergmann , Al Viro , Andrew Lunn , Christoph Hellwig , David Ahern , "David S. Miller" , Eric Dumazet , Hideaki YOSHIFUJI , Jakub Kicinski , Kees Cook , Marco Elver , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org Subject: [PATCH net-next v6 0/6] remove compat_alloc_user_space() Date: Thu, 22 Jul 2021 16:28:57 +0200 Message-Id: <20210722142903.213084-1-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Arnd Bergmann This is the fifth 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 ~30 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 multiple new ndo callbacks for private and ethernet specific commands. Arnd Link: https://lore.kernel.org/netdev/20201124151828.169152-1-arnd@kernel.org/ Changes in v6: - Split out and expand linux/compat.h rework - Split ifconf change into two patches - Rebase on latest net-next/master Changes in v5: - Rebase to v5.14-rc2 - Fix a few build issues 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 (6): compat: make linux/compat.h available everywhere ethtool: improve compat ioctl handling net: socket: rework SIOC?IFMAP ioctls net: socket: remove register_gifconf net: socket: simplify dev_ifconf handling net: socket: rework compat_ifreq_ioctl() arch/arm64/include/asm/compat.h | 14 +- arch/mips/include/asm/compat.h | 24 ++- arch/parisc/include/asm/compat.h | 14 +- arch/powerpc/include/asm/compat.h | 11 -- arch/s390/include/asm/compat.h | 14 +- arch/sparc/include/asm/compat.h | 14 +- arch/x86/include/asm/compat.h | 14 +- arch/x86/include/asm/signal.h | 1 + include/asm-generic/compat.h | 17 ++ include/linux/compat.h | 32 ++-- 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 | 153 +++++++++------- net/ethtool/ioctl.c | 136 ++++++++++++-- net/ieee802154/socket.c | 4 +- net/ipv4/af_inet.c | 6 +- net/ipv4/devinet.c | 4 +- net/qrtr/qrtr.c | 4 +- net/socket.c | 292 +++++++----------------------- 21 files changed, 352 insertions(+), 431 deletions(-) -- 2.29.2 Cc: Al Viro Cc: Andrew Lunn Cc: Christoph Hellwig Cc: David Ahern Cc: "David S. Miller" Cc: Eric Dumazet Cc: Hideaki YOSHIFUJI Cc: Jakub Kicinski Cc: Kees Cook Cc: Marco Elver Cc: linux-kernel@vger.kernel.org Cc: linux-arch@vger.kernel.org Cc: netdev@vger.kernel.org