From patchwork Tue Jul 27 13:44:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 486706 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:1185:0:0:0:0 with SMTP id f5csp232029jas; Tue, 27 Jul 2021 06:46:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxP8KvSf7m4bY26IIG+NYJSbXZ8l8Sa2UAmhnMyP9yPfvEUsFwTG3jzp999JMd6dTJguQ1S X-Received: by 2002:a17:907:86a7:: with SMTP id qa39mr14402655ejc.386.1627393604728; Tue, 27 Jul 2021 06:46:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627393604; cv=none; d=google.com; s=arc-20160816; b=s0IRvDb9UObXsMaxjc6ibLwZokwNdw45QnsAZWS0Yr6UNrC0zazeo66hoUBXnlwAyl LtVJRDpeCaH3ekwbNhzf2TTXiCIoI5wZbwVKrOtH2W6kzU5EIuTySoQOr8DM6byRLsUU bJXF9tnPE5vvzGZyW487PnlEV0J47sqX3TZkDKiVyes3ehnpKSl+7+O9yMxjrQ93PbA3 bhV+xK9rjLtJge/JHOGLFShd1eXafkaNDXaPjth9g/3xKvtpikgilJfoWMz97GXW34KL 4OQi4d4nbPJhT2RCS7J0Wl7i8kXVnhbKd9MCfxWHR1+Q/19mg6gVMj1/AyEHqEugUTL+ w4SQ== 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=nkf8iepWu96vBQ/EaM4HNxth8IUoLNiHsYzDC3lRZ7A=; b=oIhQxQSt5npXJWPA1EBz2h0rRhSw7uTFtjAHMp6Qnp3OD3ym7uJvwZu/9DSKDAHteo AXauFtMPS0Hd6B5SJVNhJRD3ORjZhtachMkaDfEEKktvVnhBLrm++lmrmYA/Tvg0pd9n TEK7714hrJ0KAHxeLO1/vOrhti6f2pQiWAwAO4bUPiJFYi+1F8NkXGhGGVtlFJKvod56 Pe4z0mmTVlXEarr9kER6TsDQdYifowqAtIfhBWsL0mXpZSoZ1/MSmVu+/C1uoGoaNeZb 8Ht8kqC307sxvQKPklcq6ye9v57RiW5+wYhFafTcGxH1LZ2DR1I8F0aUiAcA5bhN5WLR ZzbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pu+emFX9; 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 mj21si2782750ejb.25.2021.07.27.06.46.44; Tue, 27 Jul 2021 06:46:44 -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=pu+emFX9; 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 S237068AbhG0Nqk (ORCPT + 8 others); Tue, 27 Jul 2021 09:46:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:46258 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236764AbhG0NqK (ORCPT ); Tue, 27 Jul 2021 09:46:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D62A161A7A; Tue, 27 Jul 2021 13:46:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627393570; bh=hk3tPGvys72BUPLz3nQf72WAfa99K1fpmZiSmds8Uyg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pu+emFX9WU8IcMJEOnQvFo1ybYXkywwS0WUq6c9U6jkaQSywvUYEZuPWBXQLFHCRg p6gmu5kXc6Hw+uqK0nhRU+DPOBpD+D6nD25Yu8FLwwI/tEfRUH8XJWcEugSifpq5mL HezFIo1r8F5pvECQmYzvLLaaTYw/2wvtgrGTPKgy3/ZZ67PzrNGgK0ChLxGp6s/9sA S+zJHJ+wvWYwAUF+SAo9aQeF375mvMWPuKU+qyOC2kC9EF1kMPdx9r8RczVkyIoMmk pIpJysZYrpIbU0/pB+B7d5ovP73LSCFfvUEFJip959d0HR71RLpYVRTdDzdi/h/tbJ BYLC8u/3DLFYA== From: Arnd Bergmann To: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Jakub Kicinski , "David S. Miller" , Arnd Bergmann , Remi Denis-Courmont Subject: [PATCH net-next v3 06/31] phonet: use siocdevprivate Date: Tue, 27 Jul 2021 15:44:52 +0200 Message-Id: <20210727134517.1384504-7-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 phonet has a single private ioctl that is broken in compat mode on big-endian machines today because the data returned from it is never copied back to user space. Move it over to the ndo_siocdevprivate callback, which also fixes the compat issue. Cc: Remi Denis-Courmont Signed-off-by: Arnd Bergmann --- drivers/net/usb/cdc-phonet.c | 5 +++-- net/phonet/pn_dev.c | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) -- 2.29.2 Acked-by: RĂ©mi Denis-Courmont diff --git a/drivers/net/usb/cdc-phonet.c b/drivers/net/usb/cdc-phonet.c index 8d1f69dad603..e1da9102a540 100644 --- a/drivers/net/usb/cdc-phonet.c +++ b/drivers/net/usb/cdc-phonet.c @@ -253,7 +253,8 @@ static int usbpn_close(struct net_device *dev) return usb_set_interface(pnd->usb, num, !pnd->active_setting); } -static int usbpn_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) +static int usbpn_siocdevprivate(struct net_device *dev, struct ifreq *ifr, + void __user *data, int cmd) { struct if_phonet_req *req = (struct if_phonet_req *)ifr; @@ -269,7 +270,7 @@ static const struct net_device_ops usbpn_ops = { .ndo_open = usbpn_open, .ndo_stop = usbpn_close, .ndo_start_xmit = usbpn_xmit, - .ndo_do_ioctl = usbpn_ioctl, + .ndo_siocdevprivate = usbpn_siocdevprivate, }; static void usbpn_setup(struct net_device *dev) diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c index ac0fae06cc15..876d0ae5f9fd 100644 --- a/net/phonet/pn_dev.c +++ b/net/phonet/pn_dev.c @@ -233,11 +233,11 @@ static int phonet_device_autoconf(struct net_device *dev) struct if_phonet_req req; int ret; - if (!dev->netdev_ops->ndo_do_ioctl) + if (!dev->netdev_ops->ndo_siocdevprivate) return -EOPNOTSUPP; - ret = dev->netdev_ops->ndo_do_ioctl(dev, (struct ifreq *)&req, - SIOCPNGAUTOCONF); + ret = dev->netdev_ops->ndo_siocdevprivate(dev, (struct ifreq *)&req, + NULL, SIOCPNGAUTOCONF); if (ret < 0) return ret;