From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755938AbdJPRfn (ORCPT ); Mon, 16 Oct 2017 13:35:43 -0400 Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.217]:13616 "EHLO mo4-p00-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754391AbdJPRfl (ORCPT ); Mon, 16 Oct 2017 13:35:41 -0400 X-RZG-AUTH: :P2MHfkW8eP4Mre39l357AZT/I7AY/7nT2yrDxb8mjG14FZxedJy6qgO1rXnMaV+PPADNDZE4Se9B X-RZG-CLASS-ID: mo00 Subject: Re: [PATCH] can: check for null sk before deferencing it via the call to sock_net To: Josh Boyer Cc: Colin King , Marc Kleine-Budde , "David S . Miller" , linux-can@vger.kernel.org, netdev , kernel-janitors@vger.kernel.org, "Linux-Kernel@Vger. Kernel. Org" References: <20170908150235.2931-1-colin.king@canonical.com> From: Oliver Hartkopp Message-ID: Date: Mon, 16 Oct 2017 19:32:25 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/16/2017 06:37 PM, Josh Boyer wrote: > On Fri, Sep 8, 2017 at 1:46 PM, Oliver Hartkopp wrote: >> >> >> On 09/08/2017 05:02 PM, Colin King wrote: >>> >>> From: Colin Ian King >>> >>> 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 >> >> >> Acked-by: Oliver Hartkopp > > I don't see this one queued up in the net or net-next trees. Did it > fall through the cracks or did it get queued up elsewhere? Seems like > it's a good candidate to get into 4.14? It definitely is! Marc is our responsible guy for CAN related upstreams - but he seems to be busy as I already poked him here: https://marc.info/?l=linux-can&m=150771819505097&w=2 If he doesn't send a pull request by beginning of next week, I would ask Dave to grab these patches - to get them into 4.14. Best regards, Oliver