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: 1405612 Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=default header.b=lhCQpvCc; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4CgSNV0CB3z9sT6 for ; Wed, 25 Nov 2020 02:19:06 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389293AbgKXPSn (ORCPT ); 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