From patchwork Tue Jul 27 13:45:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 486724 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:1185:0:0:0:0 with SMTP id f5csp232938jas; Tue, 27 Jul 2021 06:47:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxyiD10v3gD4mVZVjXeh/wNrXw3uh0enJZK2wI/HKP8K4QmgjLjh918ldezvEu2AvPhV3DU X-Received: by 2002:a17:906:1f8b:: with SMTP id t11mr8142017ejr.131.1627393673310; Tue, 27 Jul 2021 06:47:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627393673; cv=none; d=google.com; s=arc-20160816; b=VupUtnu/vJitoxcFDx6/WfM/MVSXUT9XYdaDvYnESqpaa2sK72mO3f+GZ4x963tABo 1Ch5nSD4FQ1b9oyRRGbRbm3vAIcruKyJ88pY7BQPOqTZapXm3oUQ2w/U2HoNu4eBsNBF Hs8LbMquEgjG5pCPf6a6E+Fo67/SZDMHD6PajRkVrkC/gXJBkSDQ24buo3niITPFTLOH yadKm3JuuOtDV5qDr1rkJ90n60i1MM2TVFzdVb3izDZfF6ZzXrP4BjgS7M9bDURwaeNv hDYsmxErjezJUcnZWg9qyigHhm3eCND0tkJpesFNG8jRjohfZm9j/64Z2ujrnWJjc/eG liog== 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=FrG+Iru0gl3Fp+m2RPnmpWYVWkzgateEuesPH1Yko18=; b=xAHlawqWJlRJIVyHv889wxI1ah3haIFJRHaTSzpizWyRcAn7ovEW/mxpC5kn+Giv2r rQ04HGx3Sb8ByKHDGMqKOEkMABsULCZ7seIR8E8kny473V1P8KDRqau/rg53R6o/ePVg u9Yl87PLQi58ICBTas0MopVThs3oWY37SDx6QrnGIOW4am/EysYJ6MPuErNpvQjDVGs4 Qlc80tfPCHQNfZKSRlstZxZ5VdqHEJUpR4am1lKLBm1Mc3ebYowH5zjwtYxY4imK6XTf r/l4j9rZ7ly1A7V6iGKV6xEDRpU7ij2y7bTp4Czm/+g9aU/JUfD8cPExSQIDg+eKW1sM l6+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ciQbIp1y; 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 r9si2970195eje.250.2021.07.27.06.47.53; Tue, 27 Jul 2021 06:47:53 -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=ciQbIp1y; 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 S236819AbhG0Nrt (ORCPT + 8 others); Tue, 27 Jul 2021 09:47:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:46736 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236952AbhG0Nqw (ORCPT ); Tue, 27 Jul 2021 09:46:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id F23C061A8F; Tue, 27 Jul 2021 13:46:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627393612; bh=XdpdqxAWvfs1sMjQ8g/1aRp2X1qZ6nWPW7SMBGblQsI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ciQbIp1ySnXlTDvha/hZkwfIo+NzJZsGD3iWgAr0kQ6toD26AujtFqnwjKVfljGNz qKM+7Rsap65zRTM8rJdOh+g7v+MJZbyKYjcv8tvCKvET28y+B+B7U+tK9HCbCxvFUz UoFz8CrnxsGpJsMXjn6q4Hqym5c+syTAlUwn+KrEsj45A1F1FDJN/qmTx5iTPjKNDV 7ZW4JQmjOoVH3R7cD5cc8Vzvn/xZLfCfH86TVgHaAUotxi8ENGykrW4hzlPgWV1JAz NUgUCqQiQPHG9Kj+3Agt/ZvO6yKtZ+vuLuEz/wD/XMGwDrrEfK/+KxaAFaetTliZxi bmfG6OzBL48sA== From: Arnd Bergmann To: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Jakub Kicinski , "David S. Miller" , Arnd Bergmann Subject: [PATCH net-next v3 29/31] net: socket: return changed ifreq from SIOCDEVPRIVATE Date: Tue, 27 Jul 2021 15:45:15 +0200 Message-Id: <20210727134517.1384504-30-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210727134517.1384504-1-arnd@kernel.org> References: <20210727134517.1384504-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.29.2 diff --git a/net/core/dev_ioctl.c b/net/core/dev_ioctl.c index e0586bc4d6c6..70a379cee5fd 100644 --- a/net/core/dev_ioctl.c +++ b/net/core/dev_ioctl.c @@ -286,9 +286,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; } static int dev_siocwandev(struct net_device *dev, struct if_settings *ifs) diff --git a/net/socket.c b/net/socket.c index ddce6327633e..48471a219c1d 100644 --- a/net/socket.c +++ b/net/socket.c @@ -3234,7 +3234,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: