diff options
author | OGAWA Hirofumi <[email protected]> | 2024-11-19 23:42:23 +0900 |
---|---|---|
committer | Jens Axboe <[email protected]> | 2024-11-19 07:54:56 -0700 |
commit | b49125574cae26458d4aa02ce8f4523ba9a2a328 (patch) | |
tree | d644563dcc3cccb307b52a848c2e26374cb56518 /tools/testing/selftests/bpf/prog_tests/prog_array_init.c | |
parent | 46fd48ab3ea3eb3bb215684bd66ea3d260b091a9 (diff) |
loop: Fix ABBA locking race
Current loop calls vfs_statfs() while holding the q->limits_lock. If
FS takes some locking in vfs_statfs callback, this may lead to ABBA
locking bug (at least, FAT fs has this issue actually).
So this patch calls vfs_statfs() outside q->limits_locks instead,
because looks like no reason to hold q->limits_locks while getting
discord configs.
Chain exists of:
&sbi->fat_lock --> &q->q_usage_counter(io)#17 --> &q->limits_lock
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&q->limits_lock);
lock(&q->q_usage_counter(io)#17);
lock(&q->limits_lock);
lock(&sbi->fat_lock);
*** DEADLOCK ***
Reported-by: [email protected]
Closes: https://syzkaller.appspot.com/bug?extid=a5d8c609c02f508672cc
Reviewed-by: Ming Lei <[email protected]>
Signed-off-by: OGAWA Hirofumi <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/prog_array_init.c')
0 files changed, 0 insertions, 0 deletions