All of lore.kernel.org
 help / color / mirror / Atom feed
* CVE-2023-52793: samples/bpf: syscall_tp_user: Fix array out-of-bound access
@ 2024-05-21 15:31 Greg Kroah-Hartman
  0 siblings, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2024-05-21 15:31 UTC (permalink / raw)
  To: linux-cve-announce; +Cc: Greg Kroah-Hartman

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: CVE-2023-52793: samples/bpf: syscall_tp_user: Fix array out-of-bound access
@ 2024-05-24  3:58 Shung-Hsi Yu
  2024-05-24  4:36 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 3+ messages in thread
From: Shung-Hsi Yu @ 2024-05-24  3:58 UTC (permalink / raw)
  To: cve, Greg Kroah-Hartman; +Cc: linux-kernel, Michal Hocko

On Tue, 21 May 2024 17:31:29 +0200, Greg Kroah-Hartman wrote:
> 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.

I would like to dispute this CVE.

Files in samples/bpf are meant to serve as an example and not code that
are directly used at run-time, hence I believe this bug does not have
security implication.

--
Shung-Hsi Yu

> ...

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: CVE-2023-52793: samples/bpf: syscall_tp_user: Fix array out-of-bound access
  2024-05-24  3:58 CVE-2023-52793: samples/bpf: syscall_tp_user: Fix array out-of-bound access Shung-Hsi Yu
@ 2024-05-24  4:36 ` Greg Kroah-Hartman
  0 siblings, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2024-05-24  4:36 UTC (permalink / raw)
  To: Shung-Hsi Yu; +Cc: cve, linux-kernel, Michal Hocko

On Fri, May 24, 2024 at 11:58:54AM +0800, Shung-Hsi Yu wrote:
> On Tue, 21 May 2024 17:31:29 +0200, Greg Kroah-Hartman wrote:
> > 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.
> 
> I would like to dispute this CVE.
> 
> Files in samples/bpf are meant to serve as an example and not code that
> are directly used at run-time, hence I believe this bug does not have
> security implication.

You are right, sorry about that, now rejected.  Thanks for the review!

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-05-24  4:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-24  3:58 CVE-2023-52793: samples/bpf: syscall_tp_user: Fix array out-of-bound access Shung-Hsi Yu
2024-05-24  4:36 ` Greg Kroah-Hartman
  -- strict thread matches above, loose matches on Subject: below --
2024-05-21 15:31 Greg Kroah-Hartman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.