mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 14:11:52 +00:00
f2ac54ebf8
In syzbot runs, lockdep reports that there's a (potential)
deadlock here of data->mtx being locked recursively. This
isn't really a deadlock since they are different instances,
but lockdep cannot know, and teaching it would be far more
difficult than other fixes.
At the same time we don't even really _need_ the mutex to
be locked in rfkill_fop_open(), since we're modifying only
a completely fresh instance of 'data' (struct rfkill_data)
that's not yet added to the global list.
However, to avoid any reordering etc. within the globally
locked section, and to make the code look more symmetric,
we should still lock the data->events list manipulation,
but also need to lock _only_ that. So do that.
Reported-by: syzbot+509238e523e032442b80@syzkaller.appspotmail.com
Fixes:
|
||
---|---|---|
.. | ||
core.c | ||
input.c | ||
Kconfig | ||
Makefile | ||
rfkill-gpio.c | ||
rfkill.h |