]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: Use scnprintf() for avoiding potential buffer overflow
authorTakashi Iwai <tiwai@suse.de>
Wed, 26 Oct 2022 06:28:26 +0000 (11:58 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 29 Oct 2022 08:20:33 +0000 (10:20 +0200)
commit3a8db3eea98a1b1df87b2473bed74a2e4b98cfb2
tree9736c6825686d6d2034bb1da7fe7975bfb494f01
parent96d6affa727d436d51f27c64e7610b4ae911675e
xfs: Use scnprintf() for avoiding potential buffer overflow

commit 9df0d0b2dececf39f45bae96b2542362d9ae440a upstream.

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>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Acked-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandan.babu@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/xfs/xfs_stats.c