[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <8fdd94bd-da4e-784e-3832-6c1bb5e1f432@pengutronix.de>
Date: Tue, 17 Oct 2017 07:49:58 +0200
From: Marc Kleine-Budde <mkl@...gutronix.de>
To: Colin King <colin.king@...onical.com>,
Oliver Hartkopp <socketcan@...tkopp.net>,
"David S . Miller" <davem@...emloft.net>,
linux-can@...r.kernel.org, netdev@...r.kernel.org
Cc: kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] can: check for null sk before deferencing it via the call
to sock_net
On 09/08/2017 05:02 PM, Colin King wrote:
> From: Colin Ian King <colin.king@...onical.com>
>
> The assignment of net via call sock_net will dereference sk. This
> is performed before a sanity null check on sk, so there could be
> a potential null dereference on the sock_net call if sk is null.
> Fix this by assigning net after the sk null check. Also replace
> the sk == NULL with the more usual !sk idiom.
>
> Detected by CoverityScan CID#1431862 ("Dereference before null check")
>
> Fixes: 384317ef4187 ("can: network namespace support for CAN_BCM protocol")
> Signed-off-by: Colin Ian King <colin.king@...onical.com>
Applied to can.
Tnx,
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists