From mboxrd@z Thu Jan 1 00:00:00 1970 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 3F2EC145333 for ; Tue, 21 May 2024 15:35:50 +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=1716305750; cv=none; b=mIjPQJiwIdRNSPmJ84tYhB6EgpoTGKXHFl1jxTfhf47zG0ha7RtN/vaB5rEYGKlBM9JA+5gI8lzfqtpmTo6yGVDqrYY21iTSyr8duFJpxfQm0RicvR5c5tV7+PH5WpL1pADZqjnVaPDUz6xFmKdl118o2yxbsdEmPRMJW3iqicw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716305750; c=relaxed/simple; bh=3EZQO4RRzBhdR0CmBGPNiCEWEnu/pMWmK3L5475tS+w=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ARn1pH7QteWXMqbo80V/MlGVRxRA8NYSmUuwyifhxos7afWNZCFluFotPg5hIP1MnlyHKq5+7OcVttjCre2oLpPh0SCYIDLJNlVZ5BdPC1+bFgf5YV2dMz/7zEFEDi8y88tqJmNYmjaLwF0Tfe1iJ1ta8WkyfxHq9eKXoIqXUMI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=UlCZEv5X; 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="UlCZEv5X" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD949C2BD11; Tue, 21 May 2024 15:35:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1716305750; bh=3EZQO4RRzBhdR0CmBGPNiCEWEnu/pMWmK3L5475tS+w=; h=From:To:Cc:Subject:Date:Reply-to:From; b=UlCZEv5XPX6Hv0wZQZ6AUpRJyPFMqo1KlAzsCNWkKn8QHL6PejCQjewYzlYj1nbg8 OEqhTBc1wtR6/0w2QHsPemWrPzd89QMaAkAN/NMdPcoPRQFTeojpdzbSLkAlaf5YM+ tiPFL4u5jZIZoJ7acaPftL7qm69OWCqHqtDCdLWo= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-52793: samples/bpf: syscall_tp_user: Fix array out-of-bound access Date: Tue, 21 May 2024 17:31:29 +0200 Message-ID: <2024052157-CVE-2023-52793-18ab@gregkh> X-Mailer: git-send-email 2.45.1 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=2547; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=3EZQO4RRzBhdR0CmBGPNiCEWEnu/pMWmK3L5475tS+w=; b=kA0DAAIRMUfUDdst+ykByyZiAGZMvjHIWY2HT35JZT0hQNDRf5AX+wDzgLPYB2bTdy7wT5Vlh IhdBAARAgAdFiEE9LYMxb94wiFKMT3LMUfUDdst+ykFAmZMvjEACgkQMUfUDdst+ymH5wCfQ3kv fTHMAWFJFgRwk5Yr25ueSz0AniO58rBKdkfxch0TLGXq/MEOwU0i 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: samples/bpf: syscall_tp_user: Fix array out-of-bound access Commit 06744f24696e ("samples/bpf: Add openat2() enter/exit tracepoint to syscall_tp sample") added two more eBPF programs to support the openat2() syscall. However, it did not increase the size of the array that holds the corresponding bpf_links. This leads to an out-of-bound access on that array in the bpf_object__for_each_program loop and could corrupt other variables on the stack. On our testing QEMU, it corrupts the map1_fds array and causes the sample to fail: # ./syscall_tp prog #0: map ids 4 5 verify map:4 val: 5 map_lookup failed: Bad file descriptor Dynamically allocate the array based on the number of programs reported by libbpf to prevent similar inconsistencies in the future The Linux kernel CVE team has assigned CVE-2023-52793 to this issue. Affected and fixed versions =========================== Issue introduced in 6.3 with commit 06744f24696e and fixed in 6.5.13 with commit 61576b7a0f28 Issue introduced in 6.3 with commit 06744f24696e and fixed in 6.6.3 with commit de4825a44456 Issue introduced in 6.3 with commit 06744f24696e and fixed in 6.7 with commit 9220c3ef6fef 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-2023-52793 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: samples/bpf/syscall_tp_user.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/61576b7a0f28f924da06bead92a39a6d9aa2404a https://git.kernel.org/stable/c/de4825a444560f8cb78b03dda3ba873fab88bc4f https://git.kernel.org/stable/c/9220c3ef6fefbf18f24aeedb1142a642b3de0596