summaryrefslogtreecommitdiff
path: root/lib/libcrc32c.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2022-05-26 09:34:52 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2022-05-27 20:45:59 +0300
commit189b0ddc245139af81198d1a3637cac74f96e13a (patch)
tree6efe4119c78622c4d198e3c0dc2501d9a239ff73 /lib/libcrc32c.c
parent7e284070abe53d448517b80493863595af4ab5f0 (diff)
downloadlinux-189b0ddc245139af81198d1a3637cac74f96e13a.tar.xz
pipe: Fix missing lock in pipe_resize_ring()
pipe_resize_ring() needs to take the pipe->rd_wait.lock spinlock to prevent post_one_notification() from trying to insert into the ring whilst the ring is being replaced. The occupancy check must be done after the lock is taken, and the lock must be taken after the new ring is allocated. The bug can lead to an oops looking something like: BUG: KASAN: use-after-free in post_one_notification.isra.0+0x62e/0x840 Read of size 4 at addr ffff88801cc72a70 by task poc/27196 ... Call Trace: post_one_notification.isra.0+0x62e/0x840 __post_watch_notification+0x3b7/0x650 key_create_or_update+0xb8b/0xd20 __do_sys_add_key+0x175/0x340 __x64_sys_add_key+0xbe/0x140 do_syscall_64+0x5c/0xc0 entry_SYSCALL_64_after_hwframe+0x44/0xae Reported by Selim Enes Karaduman @Enesdex working with Trend Micro Zero Day Initiative. Fixes: c73be61cede5 ("pipe: Add general notification queue support") Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-17291 Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib/libcrc32c.c')
0 files changed, 0 insertions, 0 deletions