Skip to content
Commit 57787fa4 authored by Johannes Thumshirn's avatar Johannes Thumshirn Committed by Jens Axboe
Browse files

block: check if zone_wplugs_hash exists in queue_zone_wplugs_show



Changhui reported a kernel crash when running this simple shell
reproducer:
 # cd /sys/kernel/debug/block && find  . -type f   -exec grep -aH . {} \;

The above results in a NULL pointer dereference if a device does not have
a zone_wplugs_hash allocated.

To fix this, return early if we don't have a zone_wplugs_hash.

Reported-by: default avatarChanghui Zhong <czhong@redhat.com>
Fixes: a98b05b0 ("block: Replace zone_wlock debugfs entry with zone_wplugs entry")
Signed-off-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: default avatarDamien Le Moal <dlemoal@kernel.org>
Link: https://lore.kernel.org/r/e5fec079dfca448cc21c425cfa5d7b291f5faa67.1714046443.git.johannes.thumshirn@wdc.com


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent a8f59e5a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment