diff options
| author | Mikulas Patocka <mpatocka@redhat.com> | 2026-09-23 12:40:16 +0200 |
|---|---|---|
| committer | Mikulas Patocka <mpatocka@redhat.com> | 2026-09-30 14:14:38 +0200 |
| commit | c9417c1c5269e2bd0570fbe53e4ec03a8d31f008 (patch) | |
| tree | 087830a61410ff86e0837725145af5b239816aac /include/linux/workqueue.h | |
| parent | 9b3fcf519d370df94a56f3b272d9eddffffa5be8 (diff) | |
| download | linux-next-c9417c1c5269e2bd0570fbe53e4ec03a8d31f008.tar.gz linux-next-c9417c1c5269e2bd0570fbe53e4ec03a8d31f008.zip | |
dm: fix reading free memory in do_resume
When do_resume calls dm_table_get_mode(new_map), the call is done without
holding any locks (it only holds a reference to the md). It may be
possible that another concurrent ioctl on the same device will swap table
after dm_swap_table and before dm_table_get_mode. In this case,
dm_table_get_mode(new_map) reads freed memory.
This race condition was triggered by syzbot.
This commit fixes the race by reading mode of the new table before
dm_swap_table. Note that new_map is also passed to dm_ima_need_measure,
but this function doesn't attempt to dereference it, so this call should
be safe.
Note that this is not a security bug because only root can trigger it and
the commonly used tools such as lvm or cryptsetup do not call the ioctls
concurrently, so that they can't trigger it acceidentally.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Reported-by: syzbot+bdff1ecf726d2af66afd@syzkaller.appspotmail.com
Cc: stable@vger.kernel.org
Diffstat (limited to 'include/linux/workqueue.h')
0 files changed, 0 insertions, 0 deletions
