Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp3498277pxb; Tue, 7 Sep 2021 00:28:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5aN5gYeB9VZjGhjLppcw+DiuqEaTwXOB3ThUveanoA0i0+LS8rdg/8utJYAQeyTafpWRQ X-Received: by 2002:a6b:f817:: with SMTP id o23mr12765557ioh.205.1630999707291; Tue, 07 Sep 2021 00:28:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630999707; cv=none; d=google.com; s=arc-20160816; b=wwu1cj2ottCiGKMsTahEQtqRLp8aHhPgEdL2KhGGNPraoAAVW29sfJIqG7XQFGwGFk S53EaJeb7LNj3d/1rMwcSxE1XGNEpBfDJvt6Hk6Zba5o7aSGoom9EUsqtyD9e/UtYK7P /kGcXxH1E4D5D0gE953j2ixt5BeV6dHKRaMdzN+MSJGZqg42IsQiD4jm5tycIxETKY7N hsn+UDAVvxqLpw4g7lYB2QGBPqw4Xa2jYqh1IqTLik/V/oMC9aM5rk+inAEyzaZlZwvo VpCsyp3xzcXxUng7kP8XvgTF63itNvXzKavtLcQ2GuZeKT8ce7NbtAVlLqCXbY/XrRdo 2Xrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=1w8SkrLTufW1d2fW3qFZSf7yc/mr8gwI/3Hs6aG6qNo=; b=Z25l9Nok6eqpq+BqNohyNg7FewOiLDs2sKiG3ZfkQoePAo69VcoGIjewSP6PKyRSNA 5MxeZfFj5Kum9zXz1bZfOyvrZ6YORMKYMhPY5SoyO3vEBEhdQZpbFCHU6yrmLzlHHhzc knkTA7bCps/5Q7J9Go0sYBkqKjNwiWA7jgqTloQn7/Sc3THaCTJnrXvWCKSchK1zZJaU pqx9TBVx/WjFYfu34LJBwY6TLf69Pu38uO3NIaP33BNyEOCw6tKRBw+yC6r15ZMSeHBo aH/J3FzwzUocdkUS9JCichwD2n3UaLXnaPhGq/HZNEwp6MEMuoSZB30hHjWOot4MKR3b 6UjA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n21si9403997ioh.16.2021.09.07.00.28.15; Tue, 07 Sep 2021 00:28:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233506AbhIGGkU (ORCPT + 99 others); Tue, 7 Sep 2021 02:40:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233338AbhIGGkR (ORCPT ); Tue, 7 Sep 2021 02:40:17 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 814E3C061757 for ; Mon, 6 Sep 2021 23:39:11 -0700 (PDT) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=bjornoya.blackshift.org) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mNUl5-0003cx-6v; Tue, 07 Sep 2021 08:39:03 +0200 Received: from pengutronix.de (2a03-f580-87bc-d400-bd09-20f3-2295-682f.ip6.dokom21.de [IPv6:2a03:f580:87bc:d400:bd09:20f3:2295:682f]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: mkl-all@blackshift.org) by smtp.blackshift.org (Postfix) with ESMTPSA id BE641678816; Tue, 7 Sep 2021 06:39:00 +0000 (UTC) Date: Tue, 7 Sep 2021 08:38:59 +0200 From: Marc Kleine-Budde To: Tong Zhang Cc: Wolfgang Grandegger , "David S. Miller" , Jakub Kicinski , Andrew Lunn , Dario Binacchi , linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1] can: c_can: fix null-ptr-deref on ioctl() Message-ID: <20210907063859.llgedf5wc4n4rc73@pengutronix.de> References: <20210906233704.1162666-1-ztong0001@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="hbn3bbhn5ny2drbw" Content-Disposition: inline In-Reply-To: <20210906233704.1162666-1-ztong0001@gmail.com> X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: mkl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --hbn3bbhn5ny2drbw Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 06.09.2021 16:37:02, Tong Zhang wrote: > the pdev maybe not a platform device, e.g. c_can_pci device, > in this case, calling to_platform_device() would not make sense. > Also, per the comment in drivers/net/can/c_can/c_can_ethtool.c, @bus_info > sould match dev_name() string, so I am replacing this with dev_name() to ^^^^^ should Fixed while applying. > fix this issue. >=20 > [ 1.458583] BUG: unable to handle page fault for address: 000000010000= 0000 > [ 1.460921] RIP: 0010:strnlen+0x1a/0x30 > [ 1.466336] ? c_can_get_drvinfo+0x65/0xb0 [c_can] > [ 1.466597] ethtool_get_drvinfo+0xae/0x360 > [ 1.466826] dev_ethtool+0x10f8/0x2970 > [ 1.467880] sock_ioctl+0xef/0x300 >=20 > Fixes: 2722ac986e93 ("can: c_can: add ethtool support") > Signed-off-by: Tong Zhang Applied to linux-can/testing + added stable on Cc. regards, Marc --=20 Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung West/Dortmund | Phone: +49-231-2826-924 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | --hbn3bbhn5ny2drbw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEK3kIWJt9yTYMP3ehqclaivrt76kFAmE3CQAACgkQqclaivrt 76mPnQf9FlnF0qWsD40bZToqcod8lIoeZbZpp1TIqbe0jiVif3a5s3eohV7/ZyDb wyVKfYK3kDsRZrR8ooDXXhjW6KjtX9RPdxt7q26+bq3FnZz1yxb3XYDB2L3tKh/T WUY0xS0f+rBM+YprvBorusR/m1/RH1Y8FTVJplHNcyV4GYP3l+8DiYBkdYvDh5Pb Ki9DE7h1aPcGatI2GejClZ8graC6PCklIpuvtIw4A907RteARcvwvUZYKClv8KFP xgzUIABh60Tvz4BtC4FFB48WtMeaDp2rfxLXap06u+ZvEF2PNXmmCFAMnbP2demE Lkpxz5fHT40EmTo7E1g0sdbYG364Dw== =NJEs -----END PGP SIGNATURE----- --hbn3bbhn5ny2drbw--