diff options
author | Daniel Bristot de Oliveira <bristot@kernel.org> | 2024-02-06 12:05:31 +0100 |
---|---|---|
committer | Daniel Bristot de Oliveira <bristot@kernel.org> | 2024-02-12 09:57:14 +0100 |
commit | 30369084ac6e27479a347899e74f523e6ca29b89 (patch) | |
tree | 29e3d4ead88920a1087590830a51a8cc5e780277 /net/switchdev/switchdev.c | |
parent | 64dc40f7523369912d7adb22c8cb655f71610505 (diff) | |
download | linux-30369084ac6e27479a347899e74f523e6ca29b89.tar.gz linux-30369084ac6e27479a347899e74f523e6ca29b89.tar.bz2 linux-30369084ac6e27479a347899e74f523e6ca29b89.zip |
tools/rtla: Fix clang warning about mount_point var size
clang is reporting this warning:
$ make HOSTCC=clang CC=clang LLVM_IAS=1
[...]
clang -O -g -DVERSION=\"6.8.0-rc3\" -flto=auto -fexceptions
-fstack-protector-strong -fasynchronous-unwind-tables
-fstack-clash-protection -Wall -Werror=format-security
-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS
$(pkg-config --cflags libtracefs) -c -o src/utils.o src/utils.c
src/utils.c:548:66: warning: 'fscanf' may overflow; destination buffer in argument 3 has size 1024, but the corresponding specifier may require size 1025 [-Wfortify-source]
548 | while (fscanf(fp, "%*s %" STR(MAX_PATH) "s %99s %*s %*d %*d\n", mount_point, type) == 2) {
| ^
Increase mount_point variable size to MAX_PATH+1 to avoid the overflow.
Link: https://lkml.kernel.org/r/1b46712e93a2f4153909514a36016959dcc4021c.1707217097.git.bristot@kernel.org
Cc: stable@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Bill Wendling <morbo@google.com>
Cc: Justin Stitt <justinstitt@google.com>
Cc: Donald Zickus <dzickus@redhat.com>
Fixes: a957cbc02531 ("rtla: Add -C cgroup support")
Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
Diffstat (limited to 'net/switchdev/switchdev.c')
0 files changed, 0 insertions, 0 deletions