summaryrefslogtreecommitdiff
path: root/scripts/basic
diff options
context:
space:
mode:
authorMing Lei <ming.lei@redhat.com>2019-11-02 16:02:15 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-12-21 10:35:24 +0100
commit6eca9292c59b7a5719276e0e78ea3f0deb7b6cbe (patch)
tree2a9684969a1c34476b32b9da5e17358c20980273 /scripts/basic
parent7ed2977335813cdedaa6739543f000af7860dff8 (diff)
blk-mq: avoid sysfs buffer overflow with too many CPU cores
commit 8962842ca5abdcf98e22ab3b2b45a103f0408b95 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'scripts/basic')
0 files changed, 0 insertions, 0 deletions