Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1914681ybh; Tue, 14 Jul 2020 10:30:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsmZ2IKZX08HkLFDkgegaMhuU5QSP6cREUCukXrb9CGpsmkTGJtbBsCLPtrEh360Zhc/3x X-Received: by 2002:a17:906:1245:: with SMTP id u5mr5468287eja.286.1594747854996; Tue, 14 Jul 2020 10:30:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594747854; cv=none; d=google.com; s=arc-20160816; b=hKjX3MC9B0gezic5QnEjGQxKOyBkP332x2p5R6PfIFKtBpM6dcN8NDqTeajDc3s/RJ YzyABdtkAOaQHyTIYTKV0JoJsObbaXB3iBZpjy/f8DiPmXHX7dQ0Rm0J7lEMI+aIy6io aZa/DFWQIQuEW/pS5XHQD9a4OUQY0RPD2xiBLFqpbUV91dwEV4/byZMs/GkUgs92jkTJ TiU7bpoVyX636EpvbW2f6/ubu5CzEAf0UHZC+Cz+TxX3s2XL4HLYAtSbJgl1k3wC9Zcy g+f/xPzEj0rL8CzRMzKOsIM/C1JpfbjWf7+nckILtaDQ5IYsOT2GjTBbe89LbQYryco7 8skw== 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=rJflZjiXOdQ2b9X0uINcJ4Ucju/qSppPTgvRYeR307M=; b=nEaWDOk1aVaCOD4OVE9QQ3Tb857NYO4KwBodr6mgolf0M5svaXha6ZjxaYInro/ZMA WUFMaesaEq9Aa0Swph/0BAo5iX8zaBDNbTcxwKV4NTeFXK9caOXGoQqqaAR+dW4THiqB SgiJ5MY2C8O050MgEtGJZ6MN1iaAkPbqwjURYi/QHG4RbCMOWp2ZxU3GtrdqZqfNSCNW 8k6DB/SJQQOEHKrI3KXa1TFRYbljNI/znRbwlWmya39LHIQ5Cf7iRaMUdyGSOQ6aSJ8O bAWALwLmevleHGToKlNOkXpE1Axu1OC94ER8l26uC3GF5MnI7QVqu1cpspnWVT1MeEmj FR/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mrk8nP8Z; 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 z17si11561544ejo.11.2020.07.14.10.30.27; Tue, 14 Jul 2020 10:30:54 -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=mrk8nP8Z; 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 S1728926AbgGNR14 (ORCPT + 99 others); Tue, 14 Jul 2020 13:27:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726364AbgGNR1z (ORCPT ); Tue, 14 Jul 2020 13:27:55 -0400 Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A32DC061755; Tue, 14 Jul 2020 10:27:55 -0700 (PDT) Received: by mail-lj1-x242.google.com with SMTP id h22so24081103lji.9; Tue, 14 Jul 2020 10:27:55 -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=rJflZjiXOdQ2b9X0uINcJ4Ucju/qSppPTgvRYeR307M=; b=mrk8nP8ZaXDxwoSsyA8k3vVqLdKjX86zxjouhivf+G7iTeVFciVWjDwblY2qlwRa9V 9emGm1OFwkHsv0RNh6k8KhURGH1D+FwH8FkT9vHm1WjxGSwkBcc7aO9Y48XsU2c2Ndfp ncNp8CUw5jw3N9JSVvpdTbpMguEDLfXGvNBMVwFLUb+lT15MUcBJEF7DDDa2ApoKe2px /yca6v25q5b+Ew54GU19aO3kaPD9/jBteoDRN5SWUr1u5ykP8GzprDDHxTAHJoLMATxH L2Itbr80hoTwWdfBBNrcSmyBVo7l9b1xeyICzyCQG5N5jUV/3HnVVjmUfM6PWg6pxsNZ 6wcA== 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=rJflZjiXOdQ2b9X0uINcJ4Ucju/qSppPTgvRYeR307M=; b=ET10/RrCXX3P6owUfagMkf0F59cQkj4lMqorDfThTR08/3iHauj8+fW55m8TA/Vg88 qLZFkJZGsi4KatUVHxXehJBsyv3utbjY7xrDh8BCimVCF+TKkVo/3H/lMeqeHHBeTSaz 4+lRiHLYzrfPMf6NpDUnbXPfZCCIIYKfgGlaaHzDGUgwAqvvnKWAY121nd6itBt+DruG SswYVc6sJ8DLxpRsnFfK0F29Kox+ZgXz9meTTDPPKy5aH0INGdq0hShlxKZgsxOA5bG/ DBIz3ogC8hg/7EmfPwEu0UY0LK0dpDHf4vQSXYZ3HchrZ+sTxr9f0khpbhNKhzLZORbL Ip1g== X-Gm-Message-State: AOAM532BdN0pyMUdsKZOgY9jkGw8oBX6mDyl7p6M/TurDAcVc38mQSIp mIUyrGtXqPfVKmBkFmw4CRMPqcrrSmQDhAeLeGj17A== X-Received: by 2002:a2e:9a4d:: with SMTP id k13mr2946227ljj.283.1594747673686; Tue, 14 Jul 2020 10:27:53 -0700 (PDT) MIME-Version: 1.0 References: <20200714012732.195466-1-yepeilin.cs@gmail.com> In-Reply-To: From: Alexei Starovoitov Date: Tue, 14 Jul 2020 10:27:42 -0700 Message-ID: Subject: Re: [Linux-kernel-mentees] [PATCH v2] bpf: Fix NULL pointer dereference in __btf_resolve_helper_id() To: Andrii Nakryiko Cc: Peilin Ye , Andrii Nakryiko , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Greg Kroah-Hartman , Networking , bpf , syzkaller-bugs , 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 9:38 PM Andrii Nakryiko wrote: > > 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 The link looks wrong? Nothing in the stack trace indicates this issue. > > 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(+) > > > > [...]