Received: by 2002:ab2:788f:0:b0:1ee:8f2e:70ae with SMTP id b15csp549941lqi; Thu, 7 Mar 2024 05:19:55 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXgAhQ12jvzQH6pzs0vG8+iNTg+TWkDt101/F9eXbQBKTxeUbrRIe0xigQfi7wmLUgAiyT0hV4w4iZVbB0bIieClsmVoiypARfR2g2dMA== X-Google-Smtp-Source: AGHT+IFIlWuit2ql6MhAOC6B2P85lHLNZ/7eCgiyGxP97e2XwyIQPdKOSOABkhBlT3oVKcX+doNl X-Received: by 2002:a17:903:2442:b0:1dc:b320:9475 with SMTP id l2-20020a170903244200b001dcb3209475mr9703474pls.13.1709817595209; Thu, 07 Mar 2024 05:19:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709817595; cv=pass; d=google.com; s=arc-20160816; b=O5+xVIC4QF2Ggsz6YamjjVwVWpC5reP0xkvhJrg1gWpmJbHNnhp6/eDgqP6jo2sUNl 9xWVxR4zJzQvpNQ1IyGF28dA9+n8NhVKO4Hn58Jfx+clq94GgrDnQocXHQATPhsYYOdC PROyuKYABDMp2Afy4RLY3Z3j5QOTRxLF1k1gXUJryGrKjGod6IzegzWw1SpWrmK5ZlL4 A3YZH5D0qt+MBlz0CETfYrbCtLOA3lfBx8LkCPHVeZb6rDa+V+/1QTZsR7BmCKlLX+h0 QsYvLzpmz/pX2dfCOG7n/ImJrbCR23/2mpoztqqfUd3IXDFfTyCbSnnoJX7Tg7oF89VJ r+aw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=RpO8XsDPtb8U+xMIfXeWV9Y/zodZ6+wzJqmD0EE77MU=; fh=i/3o5bfeJi9GdI5Kw7iksrvD/QZ7mDpR7TP7nXKmQe8=; b=M6uucp0/3JBuIs5alNbZLofF0nfBNqJmzvgBOgkeaDSKHn33HDHZz/+Z22l8S48+EM kp58BXkjx4VPP7XrrAOpr7kEUVK/p5f27FzwX2zTP3VfB2JpScw4bpCiS88EZmWawr/k 8cWJX+VVxkInlNx6IHbmDZA6eBptdTxiwAs6JTrhPydDmhKNPV1Msp0MqrEEbsRyLhfQ B3LqZ/FgT30P2kHo6oxjqwR06K+8ZywsXoEEw5H32NBxeNbpqfIKvBiO+pXlq+wNEZ// SFlsBU646z+OjQWSDeio9tAFcWMHkNusuOc1R06BiMhn9DWJ4tVgwPLdfmBUAHZ7Ov+u SPoA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=arR+2yp5; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-95582-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95582-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id q18-20020a170902dad200b001d95a6b0b54si14480897plx.252.2024.03.07.05.19.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 05:19:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-95582-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=arR+2yp5; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-95582-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95582-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 4B44CB2263D for ; Thu, 7 Mar 2024 13:16:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0A7CA12C53F; Thu, 7 Mar 2024 13:16:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="arR+2yp5" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 122A912BE94 for ; Thu, 7 Mar 2024 13:16:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709817390; cv=none; b=V+TFo9u7/7f4vinN2vmfT73I4AD698iRkas5Ot7zY0yeoMw2GeLKVhC11ItRXcOG+nVWU1TnFIQSd0AQUNoOASmGJeSxrGWRapcmhPH55nMSoVE0Bqyg5TQu9Ua4sZX5yPz4yRJzer9rtLULQYL6+Qu0CMFXZyYnnbqpLrmguEg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709817390; c=relaxed/simple; bh=bITik7f0tV0KfNuQDs2gR/X8OuM8n9clFtDD8njHsaM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=LfoelS7Qd9LnD7z9C/4JC+BCfOBmV3/kLycres6FN7s6tW47xFzy67GjFbSIoaW7wwtKLYVhO4Wd/KFFnFzSSrAeZ1hCyu7i2qy3lCTbCQuQbBHAyvPND3mKsisodSCmCepihLEJCYe8QGg+LDhmfPehpP78roQ4HxcQWj3o5JY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=arR+2yp5; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 53923C433F1; Thu, 7 Mar 2024 13:16:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1709817389; bh=bITik7f0tV0KfNuQDs2gR/X8OuM8n9clFtDD8njHsaM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=arR+2yp5ddEX2qGGCa7cSDJ4m+Y6/WmDPiNjDcEqxfg9zWjnscBdlPA+X8da3ebQL ETHwzMEcwwFp6Dd64u+qGBcJKGPemuxREycWjpFZ1vOlvkfBdylXQrw0ogTMTw+XxD tNkXgS1usqie1mGt+wzWsmzWDaC7fDCnIw1QdHiU= Date: Thu, 7 Mar 2024 13:16:26 +0000 From: Greg Kroah-Hartman To: Michal Hocko Cc: cve@kernel.org, linux-kernel@vger.kernel.org, Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa Subject: Re: CVE-2023-52592: libbpf: Fix NULL pointer dereference in bpf_object__collect_prog_relos Message-ID: <2024030706-unscathed-wilt-e310@gregkh> References: <2024030645-CVE-2023-52592-4693@gregkh> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Mar 07, 2024 at 10:58:19AM +0100, Michal Hocko wrote: > On Wed 06-03-24 06:45:50, Greg KH wrote: > > Description > > =========== > > > > In the Linux kernel, the following vulnerability has been resolved: > > > > libbpf: Fix NULL pointer dereference in bpf_object__collect_prog_relos > > > > An issue occurred while reading an ELF file in libbpf.c during fuzzing: > > > > Program received signal SIGSEGV, Segmentation fault. > > 0x0000000000958e97 in bpf_object.collect_prog_relos () at libbpf.c:4206 > > 4206 in libbpf.c > > (gdb) bt > > #0 0x0000000000958e97 in bpf_object.collect_prog_relos () at libbpf.c:4206 > > #1 0x000000000094f9d6 in bpf_object.collect_relos () at libbpf.c:6706 > > #2 0x000000000092bef3 in bpf_object_open () at libbpf.c:7437 > > #3 0x000000000092c046 in bpf_object.open_mem () at libbpf.c:7497 > > #4 0x0000000000924afa in LLVMFuzzerTestOneInput () at fuzz/bpf-object-fuzzer.c:16 > > #5 0x000000000060be11 in testblitz_engine::fuzzer::Fuzzer::run_one () > > #6 0x000000000087ad92 in tracing::span::Span::in_scope () > > #7 0x00000000006078aa in testblitz_engine::fuzzer::util::walkdir () > > #8 0x00000000005f3217 in testblitz_engine::entrypoint::main::{{closure}} () > > #9 0x00000000005f2601 in main () > > (gdb) > > > > scn_data was null at this code(tools/lib/bpf/src/libbpf.c): > > > > if (rel->r_offset % BPF_INSN_SZ || rel->r_offset >= scn_data->d_size) { > > > > The scn_data is derived from the code above: > > > > scn = elf_sec_by_idx(obj, sec_idx); > > scn_data = elf_sec_data(obj, scn); > > > > relo_sec_name = elf_sec_str(obj, shdr->sh_name); > > sec_name = elf_sec_name(obj, scn); > > if (!relo_sec_name || !sec_name)// don't check whether scn_data is NULL > > return -EINVAL; > > > > In certain special scenarios, such as reading a malformed ELF file, > > it is possible that scn_data may be a null pointer > > > > The Linux kernel CVE team has assigned CVE-2023-52592 to this issue. > > OK, so this one is quite interesting. This is a userspace tooling > gaining a kernel CVE. Is this just an omission or is this really > expected. "omission"? I don't understand the question. We are responsible for assigning CVEs to stuff that is in the "Linux kernel source tree" (some have tried to get us to assign CVEs to programs like git that are just hosted on kernel.org), so for now, yes, this includes libbpf as well as stuff like perf. > Also what is the security threat model here? If a malformed ELF file is > loaded then the process gets SEGV which is perfectly reasonable thing to > do. Again, we do not do "threat modeling", we do "does this fix a weakness", and I think this does as causing SEGV might not be a good thing, right? But we'll defer to the libbpf maintainers on this, if they feel this is just a "normal bugfix" then we can revoke this (added them to the cc: here.) thanks, greg k-h