Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1480134ybh; Mon, 13 Jul 2020 21:40:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9zgaX5xQDc12/ulTwHoJq/csGbGaocPU5uBX59rBb5apFULzrOqwliNDnP7gBzlvAK70t X-Received: by 2002:a17:906:594c:: with SMTP id g12mr2781229ejr.255.1594701658466; Mon, 13 Jul 2020 21:40:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594701658; cv=none; d=google.com; s=arc-20160816; b=OY5YWjt77mO3/SpPP0L8TgufbKUDgdwKCboQVpdb/29woeCot0RyXmTeqVJ3GGvioF C60sgjaM2uz9DAJ5nvhp3inPWyVxuGNncvwWzw4Y8HTGpKe5dxr+FjdfgkTEb2daFdAc 073iP4B8H5ZYfWtxiagbFUvJfKh8uA3lijM1nGZt8gGFMK4ulKbGDsgJeaS038ea3DGK 7CXh2JZhXh+Qa5Erpw45alonqGYXWXGcydljDqXQw8tvkkrJihbVVNSiOPcmyONvpQzK 7Yn72f+i0f0YN2lRriOhz73SKtZN1ADH4eyTroMaaLRRagitCR5KG/aGpp0PbFMm0Mw1 JzoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Y31BNb/eGqFyJBN9GqgydpHsgPuWi+UTnaYm/dyFLoI=; b=dmf7oZSAKr9BHHubMpicGTDYFN85yvNb4aPlKrFa76yTqFSqo3JHNbOEcBssglNp59 GFagSSlmlG8qJaJxDwElImdkBdV0NlTE1JnrtzBg6GAEvrU22uDtsRm75Kp+/OxrFEma KMKnU7zmgLYodRHx+jDhIg5/jDaT9xo8QUrda/dSGmbuBKdIEXI8apchG67/LiQlt4Q8 nLNDtTJWDt/hr0wHswxWNbl86IR99dMpPk9xhuNcPkYDg8Mt0aDdhv3j6OdtK5hosOp4 Ir9HLbuW40YYAczxVGDHpY5hohkoQcr/9Gri+UhYD7bCvuirur41ddiH6Dat4uVfjXco PPyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=e9tDNzCI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id hh3si10412809ejb.490.2020.07.13.21.40.35; Mon, 13 Jul 2020 21:40:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=e9tDNzCI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726282AbgGNEiL (ORCPT + 99 others); Tue, 14 Jul 2020 00:38:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725816AbgGNEiL (ORCPT ); Tue, 14 Jul 2020 00:38:11 -0400 Received: from mail-qv1-xf43.google.com (mail-qv1-xf43.google.com [IPv6:2607:f8b0:4864:20::f43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FB69C061755; Mon, 13 Jul 2020 21:38:11 -0700 (PDT) Received: by mail-qv1-xf43.google.com with SMTP id di5so6892848qvb.11; Mon, 13 Jul 2020 21:38:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Y31BNb/eGqFyJBN9GqgydpHsgPuWi+UTnaYm/dyFLoI=; b=e9tDNzCI8y6XASca3rMyCwClFiMfEEI33PXc7benargRe/+17u5jsFnueV7HBXITtv HW7eiKWN9OyTktMyjHfLdSdu1lFnayYfED8Hc20dYOGvDztyJwrwHA1BZxD/ld+eD1bI Tvlzza0S1EufFf7AKFAu7ib8CAw1wrSaQIYgQff15LoL5h+yoAfC//rsneKxzDVEyS0e Az/2R3VhPPK3gjIcC4kZn8O6uRVJwUGKLhGFNynZU/09OIisazZUhZFDwZkosLjgvrUY z3uHf/da1SZLzfnI+bNcxuos69+KRIvdGNto+jcGoQ//ki3PNsKRUYBMFXPxKhkTjKss gATw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Y31BNb/eGqFyJBN9GqgydpHsgPuWi+UTnaYm/dyFLoI=; b=tdWO4Vloi8wHbnsjlmAmj5/rOj7FZ9sC6ayXVv21emrEvvQggCeRKyaadT5yXdd74X UwIS+/PHHLJH5SYg90r7d0TavczPxBIXhSntNTonPMcO+hKjShu61YHaZ3MSzcJjtCDC 5N//o/ZQ8Yzl7qxOGo5bCR9QSUUkZ2u+WZZz1xJvEqaSj18+NgwznC3J6B919bm74cpM B3tCsUyFDrsXMBYl6lFEZf0li3zDEE1z/UUYy5ZVCxBgh/hGY3ScUDN6IF+EPjCPpyiC JvIn4QvoFa8S42AUxalh0KbE3SOD1RyVU5Sug/yFykafsEmuKxe2UEjDlqJUm6pnOJX0 kmHw== X-Gm-Message-State: AOAM530aBxF0QFnFvHLQ6EAIv/UE9w5/x1KebncL3KJ82j7g1Ic7LtbM FCnsgHScKmZIj/ooKAeNa5Vul8nPQVSi8zIu+nniYf/B X-Received: by 2002:a05:6214:bce:: with SMTP id ff14mr2751110qvb.196.1594701489859; Mon, 13 Jul 2020 21:38:09 -0700 (PDT) MIME-Version: 1.0 References: <20200714012732.195466-1-yepeilin.cs@gmail.com> In-Reply-To: <20200714012732.195466-1-yepeilin.cs@gmail.com> From: Andrii Nakryiko Date: Mon, 13 Jul 2020 21:37:59 -0700 Message-ID: Subject: Re: [Linux-kernel-mentees] [PATCH v2] bpf: Fix NULL pointer dereference in __btf_resolve_helper_id() To: Peilin Ye Cc: Andrii Nakryiko , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Greg Kroah-Hartman , Networking , bpf , syzkaller-bugs@googlegroups.com, linux-kernel-mentees@lists.linuxfoundation.org, open list , clang-built-linux Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 13, 2020 at 6:29 PM Peilin Ye wrote: > > Prevent __btf_resolve_helper_id() from dereferencing `btf_vmlinux` > as NULL. This patch fixes the following syzbot bug: > > https://syzkaller.appspot.com/bug?id=5edd146856fd513747c1992442732e5a0e9ba355 > > Reported-by: syzbot+ee09bda7017345f1fbe6@syzkaller.appspotmail.com > Signed-off-by: Peilin Ye > --- > Thank you for reviewing my patch! I am new to Linux kernel development; would > the log message and errno be appropriate for this case? I think it's good enough, thanks for the fix. Acked-by: Andrii Nakryiko > > Change in v2: > - Split NULL and IS_ERR cases. > > kernel/bpf/btf.c | 5 +++++ > 1 file changed, 5 insertions(+) > [...]