]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
bcache: Use scnprintf() for avoiding potential buffer overflow
authorTakashi Iwai <tiwai@suse.de>
Sun, 22 Mar 2020 06:03:03 +0000 (14:03 +0800)
committerJens Axboe <axboe@kernel.dk>
Sun, 22 Mar 2020 16:06:57 +0000 (10:06 -0600)
commit9876e38609a8ea98bbb447eb5a8f1c0400a6ccb8
treec8cd41f891b631399a578b22e7fd1ce115441f82
parentb144e45fc57649e15cbc79ff2d32a942af1d91d5
bcache: Use scnprintf() for avoiding potential buffer overflow

Since snprintf() returns the would-be-output size instead of the
actual output size, the succeeding calls may go beyond the given
buffer limit.  Fix it by replacing with scnprintf().

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/bcache/sysfs.c