diff options
author | Ming Lei <ming.lei@redhat.com> | 2019-11-02 09:02:15 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-11-02 15:02:21 +0100 |
commit | 8962842ca5abdcf98e22ab3b2b45a103f0408b95 (patch) | |
tree | 8c2587331bbd6da0d4a520af10c30a23b2a55f63 /fs | |
parent | blk-mq: Make blk_mq_run_hw_queue() return void (diff) | |
download | linux-8962842ca5abdcf98e22ab3b2b45a103f0408b95.tar.xz linux-8962842ca5abdcf98e22ab3b2b45a103f0408b95.zip |
blk-mq: avoid sysfs buffer overflow with too many CPU cores
It is reported that sysfs buffer overflow can be triggered if the system
has too many CPU cores(>841 on 4K PAGE_SIZE) when showing CPUs of
hctx via /sys/block/$DEV/mq/$N/cpu_list.
Use snprintf to avoid the potential buffer overflow.
This version doesn't change the attribute format, and simply stops
showing CPU numbers if the buffer is going to overflow.
Cc: stable@vger.kernel.org
Fixes: 676141e48af7("blk-mq: don't dump CPU -> hw queue map on driver load")
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs')
0 files changed, 0 insertions, 0 deletions