Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7391353imu; Wed, 14 Nov 2018 16:54:00 -0800 (PST) X-Google-Smtp-Source: AJdET5cOnTtnht4aV0V4qiMZnRO0UcnDTu1HRWWwhy1lRJ1COExXqj4y2UPZKRa9b0+ujEhPE561 X-Received: by 2002:a63:9712:: with SMTP id n18mr3756154pge.295.1542243240203; Wed, 14 Nov 2018 16:54:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542243240; cv=none; d=google.com; s=arc-20160816; b=ndVnI/eFpOqK1w5LsbBBfvQoeM6UooWLD90bjL4tNwJkIq0Cm2RHtoViWOFijACN4Z p8iphMrRx8LOPIC8SeuTnHb3zbuDrVc/64z2lLpX5ojhFZWPPVieOxZyMNIQ2Q4FPxAi ohrwpDhpfQr8ULJfYkUMpCaDHll8zWQsUqO4QHXBGAlcjP1Xsn8C87tPNm8F3i30EAaJ i+pezKKLWTeaW2j09nuYJUSmnqLxXf5O3iuE8qwxRtVEO0lyv8wW7ATyZJP8AfbqkKdr FCUSe/qwEPjGfhXxDypkqK8LsimUI0uTvUc7k9HG9S9ejE3KdK9pAweLmwKpIpGYtRov tyWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=PH9TZWPv3eKyjOGYG8VjoG7+n0qNQyxSzNew9XQnMh0=; b=McPBUGoLU6sm+NDjMnNDMNAwJ6ar4xwHFxpp/EF4CUkfk6rUzvC2sFuAcOiDkcAMps gp6IHZxC2QVyklIfgf03nrO9DXZJezULGOqN96I12bQMRVpsicac8KDNwqb1IdfRSrt1 Bz+lRNOF2X9eal07SfZEZ8eVSCQErHk4Dhx9GEQaQl0rta1xZFvocECokHkH4KT0Zw47 kXtNgSfxlaHy/y46PQVYIKhdEzUol74mGRCEjcY9XwRV26Yr/z8USYN6+ipIclgEzuYa Rh57dYeP0cPoY9eeYNCFxjAa6SZmwe+ulw4qAa8k0m0QyF17EQoJvmhKd+LRBq/wuADN 3yOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=UFScXvyc; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f69-v6si25879408pgc.304.2018.11.14.16.53.45; Wed, 14 Nov 2018 16:54:00 -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=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=UFScXvyc; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727310AbeKOK6H (ORCPT + 99 others); Thu, 15 Nov 2018 05:58:07 -0500 Received: from mail-pf1-f178.google.com ([209.85.210.178]:37331 "EHLO mail-pf1-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726579AbeKOK6H (ORCPT ); Thu, 15 Nov 2018 05:58:07 -0500 Received: by mail-pf1-f178.google.com with SMTP id u3-v6so6098978pfm.4 for ; Wed, 14 Nov 2018 16:52:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=PH9TZWPv3eKyjOGYG8VjoG7+n0qNQyxSzNew9XQnMh0=; b=UFScXvycx1DdSuVOAXeAo7Pk00NnSUNCG0EMdWVKfzbdVKPowZqlD0krN0CD2WMmNV 43do4TnS3iBn0DUSYxOd27tfdAM5x8hejIhR++0Uoz+GB3B0xU6xqvDpS7lrTSAjuMIj Zk81Kwo0Zpi3yWXOdxbfGG0tuHooPv9+uvqQ7rzZDD2cauMkYiSxmAECcMHvDrU6eD8C FaHqtPXUkNTGxrLK1ybi23/QSNnmA1e2L1/c+pu4MQXGLDF3oSv9ovF4BH1HsjbfPbAy 3SwUx6pCS+mbA+7O799a+GZz8NASbnSvxEI1n7KfVQXLrbWrPmRyeoywSOlvm7K6lTTB 18ow== 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:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=PH9TZWPv3eKyjOGYG8VjoG7+n0qNQyxSzNew9XQnMh0=; b=KYhn1m57rgtnBjhhZ+tW+2xGfjmMhUAoocg1N6weL2j9fNkVlS2l7f/ginZjF3bixj 3PxJN0S1W0yPlFWzVCTPmIsWycZhkTDM2QELKWG3T+H07NxSXC7kIlmkzHtwrT8zfN3o eYNGYidDLL+2r2TU25F/+CNxhhrpuqPIpj3Yc7oCxdorraGs+K+r1kiiw5JyF1zO0KXz lwe82DcCGmyhuEOg5Dr4uqD+vRvgoqkhlJiC75LVrVAfd78iATeklidrvotbV200mV6D zPhBryEWlVe4rCC8bHeFDswHKHtAw2s3OKDhgNBtn5nwJhJqH6lmh1GX3XlhI89Kyf+h cTSg== X-Gm-Message-State: AGRZ1gIp/ahzRix/Xr9gu3bAl5Lwkwfz6ea3osz5QOHLonaUwioDSegX NMIWl1hvckqGrW0TZWKRs8BstmSBakqSrg== X-Received: by 2002:a63:6483:: with SMTP id y125mr3767861pgb.91.1542243150569; Wed, 14 Nov 2018 16:52:30 -0800 (PST) Received: from cakuba.netronome.com ([64.114.255.114]) by smtp.gmail.com with ESMTPSA id j12-v6sm27520045pfi.61.2018.11.14.16.52.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 14 Nov 2018 16:52:30 -0800 (PST) Date: Wed, 14 Nov 2018 16:52:27 -0800 From: Jakub Kicinski 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: <20181114165227.222663d5@cakuba.netronome.com> In-Reply-To: <20181113092926.27081-1-colin.king@canonical.com> References: <20181113092926.27081-1-colin.king@canonical.com> Organization: Netronome Systems, Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 13 Nov 2018 09:29:26 +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 Acked-by: Jakub Kicinski Thanks!