From patchwork Tue Jul 20 14:46:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 481528 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp5228706jao; Tue, 20 Jul 2021 08:17:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxImTReqNTZIddBFj4mtCI/6cpkYpQFqcuw+vqipOG31sG8I2QTaXm8rD/jiEsQmMbvrxaN X-Received: by 2002:a05:6512:1116:: with SMTP id l22mr22447080lfg.391.1626794223994; Tue, 20 Jul 2021 08:17:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626794223; cv=none; d=google.com; s=arc-20160816; b=ctkOqD7MAn4kfSMj1EUX89l5AzwnlNbYpMb5MtkBBDZkuq4rVZOzmt+sgVg9BDPMAj 0l8i3jrbzefIAe5xy9H6HGwOAK9UCA3ZbXXqFwyz+c1cpczNecGdx1ytjKopm1L8M/DK IKZ0TQOKV4GZvWlYOi1AxKALIimBzEygjR3XhvVBmrrxaORtOudY8rYF7qJHNGeiSZv7 uJSisnCH5YFecZdUC/CjICkpMngDIiF7yQRlXxLtYRfpKwSbIW/juHwFIKuhw1fq/sf2 uD8fWnIpxv6kIx78AfOk6EcqBe4+D93kkBERDMUDmtnsCrN3MkGjfWZOCy0QbCwIatZW kBtg== 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=PcGwqFz0965DL06/qVX8yTvCFqV4JYL7/eyiqGIuFGc=; b=dxCV54zu37wz4JTG2HeGZOa91TL9niQQLN5xV0iANknN1NW4tbs1vbcc02W9rk3qMb ijxwfTrqEfOZytCisBL7/KvymAwXgM0mlSlnubLFYpEdrr+H26qOKmiiuBHBQaATx7hz t5LW2uqiLGFjc9g8UGbmDEiSs+A/iBK1QP3Oqnfc4vLmcutOoZEG+2rtLQd9+/gSbKRl BDGwdlYnCpOhx4aKdJ/ZwNuCDBq+T7dBl4YOuedZb4pNBQ9lC0UZDeZY6G+KWhmrvuUB PaPdQO3d2WUxtvz0BBv5OVlJhnzZl2+oxUfaS2z/OKHEoGoad8pOCcjhC2R0n20mEVsS sTIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CU3FxOTT; 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 j8si24247821ljq.554.2021.07.20.08.17.03; Tue, 20 Jul 2021 08:17:03 -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=CU3FxOTT; 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 S240044AbhGTOfU (ORCPT + 8 others); Tue, 20 Jul 2021 10:35:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:55722 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237368AbhGTORU (ORCPT ); Tue, 20 Jul 2021 10:17:20 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CB73B61222; Tue, 20 Jul 2021 14:46:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626792419; bh=3U5cHZKM8awP+zSxZS1EIJAve4S7wCshkfB/0fjPCio=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CU3FxOTTjkiYuPjrfEcw2Y4nW6o++8SBX/VbNf/F0YM4jTEd73zGuANVEzsc0bmBT N/QQGELQXhF9oPKSF+LgdupZi/obfubPGr4HjLGjV6Y9rE3NZq44bgl2f61r6SN4lD XxjoHXmUs9R/RLYI+J3wH9FqBLnLQCH+9X4GJPTMl3ByN0gU32V8+zI3SkAvzf1nQX 6poTT9RN0zjtiI6gc2K12Bwodx563Q+jRclKJOOmh++2BqUZs775+YTBgB8d2G0uj1 QwNUynCF1flCZrNir0LW2oMrxNngTp+v1IxAAnkrtg/eHNnFypOXUuiZ/bPhQrYumS REg72AmybTuxQ== From: Arnd Bergmann To: netdev@vger.kernel.org Cc: Christoph Hellwig , Arnd Bergmann Subject: [PATCH net-next v2 06/31] phonet: use siocdevprivate Date: Tue, 20 Jul 2021 16:46:13 +0200 Message-Id: <20210720144638.2859828-7-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210720144638.2859828-1-arnd@kernel.org> References: <20210720144638.2859828-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. 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 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;