From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36E66C433E0 for ; Wed, 10 Jun 2020 05:53:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1204920835 for ; Wed, 10 Jun 2020 05:53:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591768430; bh=/2TgyOGEKrd2FU+b646mx1YVglemkJKs7lxOPjEWCO8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=JMUvo98++3d3X19zJFVDxPuaeNQ3bKlhnHnTu2DVCU7H+rRl5a+sRzcBpFiC4q8Ex cGflBHPnVsLnZJ9Gl+Tug5NnJfINtiXiDq1w8ZaFIe6zVEoXOT2rIv2BcCp7nifVI2 MQEGZNX3XwLE9NkD3skb2Q/yHMhfHck0PzBE6nOs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726053AbgFJFxn (ORCPT ); Wed, 10 Jun 2020 01:53:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:34718 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725988AbgFJFxn (ORCPT ); Wed, 10 Jun 2020 01:53:43 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 481F32074B; Wed, 10 Jun 2020 05:53:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591768423; bh=/2TgyOGEKrd2FU+b646mx1YVglemkJKs7lxOPjEWCO8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZDEoFQ4frCiEzR+mN5Sk4MObIpGkmJ8vaIeJgYBsf8dx7/0YZORDC4LYzIbkoBQtN o2bUNLHnfP9dSG5qC4s+gfiM11CLPoJjHtBJ9VfdDUPrsj/nVDPLNFReMMGtIgggBC pKjpNjWDaTmqJDbJmZRZKEEiwmleYobMNTeQqdJg= Date: Wed, 10 Jun 2020 07:53:39 +0200 From: Greg KH To: Gaurav Singh Cc: Jeff Dike , Richard Weinberger , Anton Ivanov , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , John Fastabend , KP Singh , Alex Dewar , "open list:USER-MODE LINUX (UML)" , open list , "open list:BPF (Safe dynamic programs and tools)" , "open list:BPF (Safe dynamic programs and tools)" Subject: Re: [PATCH] Fix null pointer dereference in vector_user_bpf Message-ID: <20200610055339.GA1865470@kroah.com> References: <20200610034314.9290-1-gaurav1086@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200610034314.9290-1-gaurav1086@gmail.com> Sender: bpf-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On Tue, Jun 09, 2020 at 11:43:00PM -0400, Gaurav Singh wrote: > Signed-off-by: Gaurav Singh > > The bpf_prog is being checked for !NULL after uml_kmalloc but > later its used directly for example: > bpf_prog->filter = bpf and is also later returned upon success. > Fix this, do a NULL check and return right away. > > --- > arch/um/drivers/vector_user.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) No signed-off-by?