From patchwork Fri Nov 6 22:17:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 320877 Delivered-To: patch@linaro.org Received: by 2002:a92:7b12:0:0:0:0:0 with SMTP id w18csp1674977ilc; Fri, 6 Nov 2020 14:19:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJwBpUZuS3fNrOP8kpBDunYq4fsYeSdSPW3jYVMv3iX/3W/NV5RllF0za1X3HjhxFyPPxZHf X-Received: by 2002:a05:6402:21c7:: with SMTP id bi7mr4451972edb.54.1604701169688; Fri, 06 Nov 2020 14:19:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604701169; cv=none; d=google.com; s=arc-20160816; b=ks+woitia3q6H4qFJ+Mhl7qdrv/A4r4PVmv/12Fhjeep/ctb2vcGe8r+NnYP1hIDL/ PXfg1K05nkQZC23pNazhS8+g3v75BrQFuoK2tSIOSmU8IwPYR4e6/d+hw++gaN5AWZl9 8d1xldo1PJvfDHRJN+B1uc32i54MRRcyUji23Jno0ERTHinrDYaMZeKefIh7MfEn5ZZu W0qXb/WT40W6CgP6Eo3HzgULfduZo9A7C22rCGTEiPcIWquM3v8isv4Gdv/dmd8tVM3i At9m7UOEqkbAs/fDcqyJQS0fMhG6lZi/p45Isa8WOKPplTuO+FXkuPxhP3L1VDG5kZQY DLkQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=XnOlaUjP6pUrCUeckDcBP4HTU88tt3RDYg0lYq8eeTQ=; b=DmwS6N4J0mW9vGhnEmMJFHBAOpD/aS4b1Pqyd6+OTYg0ujYQBkHkraomN3R5PDPMoH AlmuqafPNbWEz3vD8SYFCJyqRGgq09weUCQ49o0P5R75HoBLDRs2YVdZzhzAdVoNAcf3 muIUJwHdlbWvsJ9bes/+0SHfQnO/5qWQUNWhMvd9fQNszSsCtX1q9QVpsHNvvJ6WUUyo GG9UBvgnzL+ajxLf6+O1Znh27cxHNXESSSUPRXKfqTC411n2MkdevGyL+8o32mQwzgII EEg5Y+UzCTmlbI5gl/ldVPYgtIWOa2cF0+XS0JoiRXowc1x6lir5444cDuvxiiGG2TmA r/uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="piTqh36/"; 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 m20si1785072ejc.60.2020.11.06.14.19.29; Fri, 06 Nov 2020 14:19:29 -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="piTqh36/"; 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 S1728777AbgKFWT0 (ORCPT + 8 others); Fri, 6 Nov 2020 17:19:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:42816 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729232AbgKFWTP (ORCPT ); Fri, 6 Nov 2020 17:19:15 -0500 Received: from localhost.localdomain (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 2CC6420882; Fri, 6 Nov 2020 22:19:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604701154; bh=OjKky2mcuT3PPhvnL2N1n9WJjuGKW1fEUioqpsDSDNw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=piTqh36/Ayd8rKuc3zcxxLUXwu8coawnGzadmDxmNVwyht5LsFJxbKKpvbei6ZwB5 i4Xivr2LHHwHyaH25bXiALK3Cu/8c5VDnYA8drwte5C9rzrbOpBOhdg19zecSP7Ss6 iishXpi6LYmi5ZVVAqz5r5CZz+uIbP+0EafwU9MI= From: Arnd Bergmann To: netdev@vger.kernel.org Cc: Arnd Bergmann , linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, bridge@lists.linux-foundation.org, linux-hams@vger.kernel.org, Jakub Kicinski , Christoph Hellwig , Alexander Viro , Johannes Berg , Andrew Lunn , Heiner Kallweit Subject: [RFC net-next 28/28] net: socket: return changed ifreq from SIOCDEVPRIVATE Date: Fri, 6 Nov 2020 23:17:43 +0100 Message-Id: <20201106221743.3271965-29-arnd@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201106221743.3271965-1-arnd@kernel.org> References: <20201106221743.3271965-1-arnd@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Arnd Bergmann Some drivers that use SIOCDEVPRIVATE ioctl commands modify the ifreq structure and expect it to be passed back to user space, which has never really happened for compat mode because the calling these drivers through ndo_do_ioctl requires overwriting the ifr_data pointer. Now that all drivers are converted to ndo_siocdevprivate, change it to handle this correctly in both compat and native mode. Signed-off-by: Arnd Bergmann --- net/core/dev_ioctl.c | 4 +--- net/socket.c | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) -- 2.27.0 diff --git a/net/core/dev_ioctl.c b/net/core/dev_ioctl.c index 99efe8e2e0ce..0c058c3dc89a 100644 --- a/net/core/dev_ioctl.c +++ b/net/core/dev_ioctl.c @@ -296,9 +296,7 @@ static int dev_siocdevprivate(struct net_device *dev, struct ifreq *ifr, return -ENODEV; } - /* fall back to do_ioctl for drivers not yet converted */ - ifr->ifr_data = data; - return dev_do_ioctl(dev, ifr, cmd); + return -EOPNOTSUPP; } /* diff --git a/net/socket.c b/net/socket.c index 1e077182d0fd..6edf3f4d9dca 100644 --- a/net/socket.c +++ b/net/socket.c @@ -3206,7 +3206,7 @@ static int compat_sock_ioctl_trans(struct file *file, struct socket *sock, struct net *net = sock_net(sk); if (cmd >= SIOCDEVPRIVATE && cmd <= (SIOCDEVPRIVATE + 15)) - return compat_ifr_data_ioctl(net, cmd, argp); + return sock_ioctl(file, cmd, (unsigned long)argp); switch (cmd) { case SIOCSIFBR: