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 0C71814D28A for ; Wed, 19 Jun 2024 13:38:24 +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=1718804304; cv=none; b=TFtzeR/2p7dwARXfKF34mXsZbsJ8cYuZlLtYPDl6hipDURH8ZxwiZiM9yA4Od5kv21yfOBZzxWTIRPXKf5/kg2qpQQNXXuCcAE8B7ag6udt56PZeLnttMoTLITmH0iYbATQPmtXT32k7R5bMkBdWGAzHmWe7STOftbQkkmu5DYw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718804304; c=relaxed/simple; bh=e9F2lWFcnvlYBiHhCqH/cJ9RoxnbvK3xQfDdyiABl3E=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=awPD/m8LfOvs4B1GzrkCCJL032lDFBxQRfbBRps4RBHPER4/jbp0eU/c5hsK/GUYjpqj+/Pa60RnyK/wB3Nc9ITcao1MHyPtRIZ/DihPIT1aw2AxTouvRJxq6MsOUhRrDcpBLylKd50D8iJXPki0sJE8wwiqj5+Q0A+K36OLmfw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=j6d5LxEW; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="j6d5LxEW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84DAAC2BBFC; Wed, 19 Jun 2024 13:38:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718804303; bh=e9F2lWFcnvlYBiHhCqH/cJ9RoxnbvK3xQfDdyiABl3E=; h=From:To:Cc:Subject:Date:Reply-to:From; b=j6d5LxEWpU14uTLJwuD0CnbSDEFvtySOvd8D2XixguvccVsKAsukXnPjlffiplXRL zDBbOPHi52vCNWb6xMoKPmo5FS8JkXMVrK9eaSdd1A9ZVz+gcx8Q8tMEEINpQ8ajea LkrDnfshgaqMedLjEfCNbplook648mkpgbcZg8ak= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-38574: libbpf: Prevent null-pointer dereference when prog to load has no BTF Date: Wed, 19 Jun 2024 15:36:23 +0200 Message-ID: <2024061958-CVE-2024-38574-d9a9@gregkh> X-Mailer: git-send-email 2.45.2 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=2277; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=e9F2lWFcnvlYBiHhCqH/cJ9RoxnbvK3xQfDdyiABl3E=; b=owGbwMvMwCRo6H6F97bub03G02pJDGlF9/adfLnyzrdXXwJe1HwVLvz9+PGln48zEq99uNP8N ETs1dH1VztiWRgEmRhkxRRZvmzjObq/4pCil6HtaZg5rEwgQxi4OAVgIjG2DPOdv6595zXHdNUT p/+TdDm6ZkgxbN/OsOBU8huL/ZrvJcWW87+L/lWhHNK4KwoA X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: libbpf: Prevent null-pointer dereference when prog to load has no BTF In bpf_objec_load_prog(), there's no guarantee that obj->btf is non-NULL when passing it to btf__fd(), and this function does not perform any check before dereferencing its argument (as bpf_object__btf_fd() used to do). As a consequence, we get segmentation fault errors in bpftool (for example) when trying to load programs that come without BTF information. v2: Keep btf__fd() in the fix instead of reverting to bpf_object__btf_fd(). The Linux kernel CVE team has assigned CVE-2024-38574 to this issue. Affected and fixed versions =========================== Issue introduced in 6.8 with commit df7c3f7d3a3d and fixed in 6.8.12 with commit ef80b59acfa4 Issue introduced in 6.8 with commit df7c3f7d3a3d and fixed in 6.9.3 with commit 1fd91360a758 Issue introduced in 6.8 with commit df7c3f7d3a3d and fixed in 6.10-rc1 with commit 9bf48fa19a4b Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2024-38574 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: tools/lib/bpf/libbpf.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/ef80b59acfa4dee4b5eaccb15572b69248831104 https://git.kernel.org/stable/c/1fd91360a75833b7110af9834ae26c977e1273e0 https://git.kernel.org/stable/c/9bf48fa19a4b1d186e08b20bf7e5de26a15644fb