mbox series

[SRU,J,0/1] CVE-2023-52621

Message ID 20240924152936.233013-1-massimiliano.pellizzer@canonical.com
Headers show
Series CVE-2023-52621 | expand

Message

Massimiliano Pellizzer Sept. 24, 2024, 3:29 p.m. UTC
[Impact]

bpf: Check rcu_read_lock_trace_held() before calling bpf map helpers

The three bpf_map_{lookup,update,delete}_elem() helper functions are also
available for sleepable bpf programs, the patch adds the corresponding lock
assertion for sleepable bpf programs.

[Fix]

Noble:  Fixed
Jammy:  Backported the fix commit from linux-6.1.y
Focal:  Not affected
Bionic: Not affected
Xenial: Not affected

[Test Case]

Compile tested.

[Where problems could occur]

The fix for CVE-2023-52621 affetcs the BPF subsystem, in particular the
handling of BPF map operations in sleepable BPF programs. A bug in the
patch could lead to kernel warnings or crashes when using BPF maps,
especially when BPF JIT is disabled.

Hou Tao (1):
  bpf: Check rcu_read_lock_trace_held() before calling bpf map helpers

 kernel/bpf/helpers.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

Comments

Mehmet Basaran Oct. 1, 2024, 8:12 p.m. UTC | #1
Acked-by: Mehmet Basaran <mehmet.basaran@canonical.com>
Massimiliano Pellizzer <massimiliano.pellizzer@canonical.com> writes:

> [Impact]
>
> bpf: Check rcu_read_lock_trace_held() before calling bpf map helpers
>
> The three bpf_map_{lookup,update,delete}_elem() helper functions are also
> available for sleepable bpf programs, the patch adds the corresponding lock
> assertion for sleepable bpf programs.
>
> [Fix]
>
> Noble:  Fixed
> Jammy:  Backported the fix commit from linux-6.1.y
> Focal:  Not affected
> Bionic: Not affected
> Xenial: Not affected
>
> [Test Case]
>
> Compile tested.
>
> [Where problems could occur]
>
> The fix for CVE-2023-52621 affetcs the BPF subsystem, in particular the
> handling of BPF map operations in sleepable BPF programs. A bug in the
> patch could lead to kernel warnings or crashes when using BPF maps,
> especially when BPF JIT is disabled.
>
> Hou Tao (1):
>   bpf: Check rcu_read_lock_trace_held() before calling bpf map helpers
>
>  kernel/bpf/helpers.c | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
>
> -- 
> 2.43.0
>
>
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
Chris Chiu Oct. 2, 2024, 4:12 a.m. UTC | #2
Massimiliano Pellizzer <massimiliano.pellizzer@canonical.com> writes:
> [Impact]
>
> bpf: Check rcu_read_lock_trace_held() before calling bpf map helpers
>
> The three bpf_map_{lookup,update,delete}_elem() helper functions are also
> available for sleepable bpf programs, the patch adds the corresponding lock
> assertion for sleepable bpf programs.
>
> [Fix]
>
> Noble:  Fixed
> Jammy:  Backported the fix commit from linux-6.1.y
> Focal:  Not affected
> Bionic: Not affected
> Xenial: Not affected
>
> [Test Case]
>
> Compile tested.
>
> [Where problems could occur]
>
> The fix for CVE-2023-52621 affetcs the BPF subsystem, in particular the
> handling of BPF map operations in sleepable BPF programs. A bug in the
> patch could lead to kernel warnings or crashes when using BPF maps,
> especially when BPF JIT is disabled.
>
> Hou Tao (1):
>   bpf: Check rcu_read_lock_trace_held() before calling bpf map helpers
>
>  kernel/bpf/helpers.c | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
>

Acked-by: Chris Chiu <chris.chiu@canonical.com>
Chris Chiu Oct. 2, 2024, 4:14 a.m. UTC | #3
Massimiliano Pellizzer <massimiliano.pellizzer@canonical.com> writes:
> [Impact]
>
> bpf: Check rcu_read_lock_trace_held() before calling bpf map helpers
>
> The three bpf_map_{lookup,update,delete}_elem() helper functions are also
> available for sleepable bpf programs, the patch adds the corresponding lock
> assertion for sleepable bpf programs.
>
> [Fix]
>
> Noble:  Fixed
> Jammy:  Backported the fix commit from linux-6.1.y
> Focal:  Not affected
> Bionic: Not affected
> Xenial: Not affected
>
> [Test Case]
>
> Compile tested.
>
> [Where problems could occur]
>
> The fix for CVE-2023-52621 affetcs the BPF subsystem, in particular the
> handling of BPF map operations in sleepable BPF programs. A bug in the
> patch could lead to kernel warnings or crashes when using BPF maps,
> especially when BPF JIT is disabled.
>
> Hou Tao (1):
>   bpf: Check rcu_read_lock_trace_held() before calling bpf map helpers
>
>  kernel/bpf/helpers.c | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
>

Acked-by: Chris Chiu <chris.chiu@canonical.com>
Roxana Nicolescu Oct. 7, 2024, 7:39 a.m. UTC | #4
On 24/09/2024 17:29, Massimiliano Pellizzer wrote:
> [Impact]
>
> bpf: Check rcu_read_lock_trace_held() before calling bpf map helpers
>
> The three bpf_map_{lookup,update,delete}_elem() helper functions are also
> available for sleepable bpf programs, the patch adds the corresponding lock
> assertion for sleepable bpf programs.
>
> [Fix]
>
> Noble:  Fixed
> Jammy:  Backported the fix commit from linux-6.1.y
> Focal:  Not affected
> Bionic: Not affected
> Xenial: Not affected
>
> [Test Case]
>
> Compile tested.
>
> [Where problems could occur]
>
> The fix for CVE-2023-52621 affetcs the BPF subsystem, in particular the
> handling of BPF map operations in sleepable BPF programs. A bug in the
> patch could lead to kernel warnings or crashes when using BPF maps,
> especially when BPF JIT is disabled.
>
> Hou Tao (1):
>    bpf: Check rcu_read_lock_trace_held() before calling bpf map helpers
>
>   kernel/bpf/helpers.c | 14 +++++++++-----
>   1 file changed, 9 insertions(+), 5 deletions(-)
>
Applied to jammy:linux master-next branch. Thanks!