Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp196479imu; Fri, 16 Nov 2018 20:53:37 -0800 (PST) X-Google-Smtp-Source: AJdET5epmLREW63faH2PZLEf4ghd3IbNWHQLhzbnSQNoqlCnqQ6EKHPW/X6cWk+Ti4BfG4Qq4mLX X-Received: by 2002:a63:5d14:: with SMTP id r20mr12642613pgb.329.1542430416949; Fri, 16 Nov 2018 20:53:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542430416; cv=none; d=google.com; s=arc-20160816; b=OF5eelIpkjbxn5iwkIINAq4PIlCt3MOnggZ1KLVqTMQPWFkh4AXtncNtq/lo4+/nc9 8i4SorGtz2tf6YqN3llUz1ax23i+jAA088fIcXkXDNVyL/Fn6Ir+DOuRk0t8fvEZWldc 42BK/JIRpO9Jl5rgcTQRdtE3XyViso0KmuPtDG3RCyNh/P7JD8YiEJNXkn2xw3hsuscl 3KR4xTXEMZ4JdASgIXLrA2MhHsKyfrILMCt8dXx/0BlcFy1NB9n+vj8YTBzkyV6FgHqq drzDMqF7GDAORau8eIpeqE7ZodY9paxaHtzHYGAP87Jid6PGVI3BYS1ZhQocFMAKenNH YvMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=7iWpdyJV590O4cSCeR1t6B4S8oj3mdJVRzZM2wdQU3s=; b=yAA8NipHFfxUnVWjn+CNnwFR0OEzs3WTkXOHE4aX5j/VwcZj3s/5hu0SNm4Y8ESvEC KAw4VplXFSExirPdo65uyhlPt3aa92c82Q7BGI7pQMYJCkcqYkJeqXySu94brdRyexi/ o82rSOWx8jQ5A94ybz/yjPQtUhKmvZDnvO8/2250EAQuJS+Z3BGGq8kbPJOMUafvCo0k cx8qMV5rxUCOE3xca/Vt3ajjKdInq3qc6+bdo6GcC7R0eCY+Cn1n+ueU+e0XcRve08IP WGNOGOUPRVP9V9uMkLkM+C5sb956BnFK9EEgrVYotKHHvfDNc5hCWID1+Ux5QAvJ82Xd EhHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tkdtgRzr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t130si4630759pgb.521.2018.11.16.20.53.09; Fri, 16 Nov 2018 20:53:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tkdtgRzr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730743AbeKQPFY (ORCPT + 99 others); Sat, 17 Nov 2018 10:05:24 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:34377 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728478AbeKQPFX (ORCPT ); Sat, 17 Nov 2018 10:05:23 -0500 Received: by mail-pg1-f193.google.com with SMTP id 17so11207437pgg.1; Fri, 16 Nov 2018 20:50:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=7iWpdyJV590O4cSCeR1t6B4S8oj3mdJVRzZM2wdQU3s=; b=tkdtgRzrXXnxwiknKQjiupdYzEeC9ZxCIkjm7/trJCfyTGMmmqTal+lfkrva4yakeT /5+7JIOfBY5CGY/p2b7caXQlytedhA88b7ZjWEoPg9aFdgkeJu/EFN8xOclNEMfKbkjO IvVK+4++gKmF3RyiC7xSdRdNyap2uK5uEyFSlKtFHkRgjPOvbwopnqY8uDNYO4RKvbru 5F4riZquHa0HkD131yH2YoZV+1m7jjSqASDalvMGmUl/XxPa/AnMsjvzCZFpiClvhqm8 HxetDKFwDTFczdeifogAK4w0f73kr2YjK3lmp4o+6eqNRun0lJzHr2E+DO8Fhnoh2g8A zStA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=7iWpdyJV590O4cSCeR1t6B4S8oj3mdJVRzZM2wdQU3s=; b=VtdOm9dlkOYdb2TThbZj0iWxE4H73SOVADWs1LsPcQRYa75bgdGW7tahShOiH5Hzqj Q1MWaX1R/Ak77g8EUsz2PJdXXwKzbWR368XidSy/9eL2c3r24bgVlGD8uQ/SHnMgR9XX kVvJdvidoIHHHikn/lR7BuSus8ziNil2mXJkXtDPVLuwt0cjIptw5nMKnbEcujVl34uT jCZpPQtB0gOks3E0yqysoTqhUgwsGTizT0HQxAo1gi1cQ/p7EDsEgOKlk+6GqFm1biWY R+0zzT7B4gra3k2YLsz7i+3XuhrNq2ruGB92VLhdlT+YctfbZhZhcG3XYn085JgYL05n hdow== X-Gm-Message-State: AGRZ1gLmex+SlnLumQ0v4q/4j4xB4iYZsbKCy7PkdJt5Zh2P3+TmUzJI 2ScXFBsLQHXmrF7/M9bY1qI= X-Received: by 2002:a63:484c:: with SMTP id x12mr12399807pgk.375.1542430200217; Fri, 16 Nov 2018 20:50:00 -0800 (PST) Received: from ast-mbp.dhcp.thefacebook.com ([2620:10d:c090:180::1:eb1f]) by smtp.gmail.com with ESMTPSA id s22-v6sm60067166pfi.15.2018.11.16.20.49.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 20:49:59 -0800 (PST) Date: Fri, 16 Nov 2018 20:49:57 -0800 From: Alexei Starovoitov To: Colin King Cc: Alexei Starovoitov , Daniel Borkmann , netdev@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH][bpf-next] bpf: fix null pointer dereference on pointer offload Message-ID: <20181117044955.c6x6lnajgrlnpoeq@ast-mbp.dhcp.thefacebook.com> References: <20181113092926.27081-1-colin.king@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181113092926.27081-1-colin.king@canonical.com> User-Agent: NeoMutt/20180223 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 13, 2018 at 09:29:26AM +0000, Colin King wrote: > From: Colin Ian King > > Pointer offload is being null checked however the following statement > dereferences the potentially null pointer offload when assigning > offload->dev_state. Fix this by only assigning it if offload is not > null. > > Detected by CoverityScan, CID#1475437 ("Dereference after null check") > > Fixes: 00db12c3d141 ("bpf: call verifier_prep from its callback in struct bpf_offload_dev") > Signed-off-by: Colin Ian King Applied, Thanks