CVE-2024-56368 Information
Description
In the Linux kernel the following vulnerability has been resolved:
ring-buffer: Fix overflow in __rb_map_vma
An overflow occurred when performing the following calculation:
nr_pages = ((nr_subbufs + 1) « subbuf_order) - pgoff;
Add a check before the calculation to avoid this problem.
syzbot reported this as a slab-out-of-bounds in __rb_map_vma:
BUG: KASAN: slab-out-of-bounds in __rb_map_vma+0x9ab/0xae0 kernel/trace/ring_buffer.c:7058 Read of size 8 at addr ffff8880767dd2b8 by task syz-executor187/5836
CPU: 0 UID: 0 PID: 5836 Comm: syz-executor187 Not tainted 6.13.0-rc2-syzkaller-00159-gf932fb9b4074 0
Hardware name: Google Google Compute Engine/Google Compute Engine BIOS Google 11/25/2024
Call Trace:
The reproducer for this bug is:
————————8<————————- include <fcntl.h> include <stdlib.h> include <unistd.h> include <asm/types.h> include <sys/mman.h>
int main(int argc char argv)
int page_size = getpagesize();
int fd;
void meta;
system(cho 1 > /sys/kernel/tracing/buffer_size_kb\);
fd = open(\/sys/kernel/tracing/per_cpu/cpu0/trace_pipe_raw\ O_RDONLY);
meta = mmap(NULL page_size PROT_READ MAP_SHARED fd page_size 5);
————————>8————————-
Reference
https://git.kernel.org/stable/c/c58a812c8e49ad688f94f4b050ad5c5b388fc5d2 https://git.kernel.org/stable/c/ec12f30fe54234dd40ffee50dda8d2df10bd0871
Share on: