Files
linux/mm
yahia ahmed 5af3f83dcf mm/shmem: fix data-race in shmem_fault
shmem_fault and shmem_writeout access inode->i_private without holding a
lock, while shmem_fallocate is modifying it while holding a lock, thus a
data-race is created.

Fix this by using READ_ONCE and WRITE_ONCE, which provides an atomic,
lockless read and write of inode->i_private which prevents compiler
optimizations such as caching in registers and add writing to
inode->i_private with WRITE_ONCE to prevent the compiler from writing in
registers.

Link: https://lore.kernel.org/20260630120222.11562-1-yahia.a.abdrabou@gmail.com
Signed-off-by: yahia ahmed <yahia.a.abdrabou@gmail.com>
Reported-by: syzbot+76cc716982cf0254f302@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=76cc716982cf0254f302
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2026-07-30 19:40:29 -07:00
..
2026-07-28 21:12:03 -07:00
2025-11-20 13:43:57 -08:00
2026-05-28 21:04:41 -07:00
2026-07-28 21:12:03 -07:00
2026-07-28 21:11:47 -07:00
2026-07-28 21:12:03 -07:00
2026-06-02 15:22:15 -07:00
2026-07-30 19:40:29 -07:00