Patch "tools/rtla: Fix clang warning about mount_point var size" has been added to the 6.7-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    tools/rtla: Fix clang warning about mount_point var size

to the 6.7-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     tools-rtla-fix-clang-warning-about-mount_point-var-size.patch
and it can be found in the queue-6.7 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From 30369084ac6e27479a347899e74f523e6ca29b89 Mon Sep 17 00:00:00 2001
From: Daniel Bristot de Oliveira <bristot@xxxxxxxxxx>
Date: Tue, 6 Feb 2024 12:05:31 +0100
Subject: tools/rtla: Fix clang warning about mount_point var size

From: Daniel Bristot de Oliveira <bristot@xxxxxxxxxx>

commit 30369084ac6e27479a347899e74f523e6ca29b89 upstream.

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@xxxxxxxxxx

Cc: stable@xxxxxxxxxxxxxxx
Cc: Masami Hiramatsu <mhiramat@xxxxxxxxxx>
Cc: Nathan Chancellor <nathan@xxxxxxxxxx>
Cc: Nick Desaulniers <ndesaulniers@xxxxxxxxxx>
Cc: Bill Wendling <morbo@xxxxxxxxxx>
Cc: Justin Stitt <justinstitt@xxxxxxxxxx>
Cc: Donald Zickus <dzickus@xxxxxxxxxx>
Fixes: a957cbc02531 ("rtla: Add -C cgroup support")
Signed-off-by: Daniel Bristot de Oliveira <bristot@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 tools/tracing/rtla/src/utils.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/tools/tracing/rtla/src/utils.c
+++ b/tools/tracing/rtla/src/utils.c
@@ -530,7 +530,7 @@ int set_cpu_dma_latency(int32_t latency)
  */
 static const int find_mount(const char *fs, char *mp, int sizeof_mp)
 {
-	char mount_point[MAX_PATH];
+	char mount_point[MAX_PATH+1];
 	char type[100];
 	int found = 0;
 	FILE *fp;


Patches currently in stable-queue which might be from bristot@xxxxxxxxxx are

queue-6.7/tools-rtla-replace-setting-prio-with-nice-for-sched_other.patch
queue-6.7/tools-rv-fix-makefile-compiler-options-for-clang.patch
queue-6.7/tools-rtla-fix-uninitialized-bucket-data-bucket_size-warning.patch
queue-6.7/tools-rtla-exit-with-exit_success-when-help-is-invoked.patch
queue-6.7/tools-rtla-fix-clang-warning-about-mount_point-var-size.patch
queue-6.7/tools-rv-fix-curr_reactor-uninitialized-variable.patch
queue-6.7/tools-rtla-fix-makefile-compiler-options-for-clang.patch
queue-6.7/tracing-timerlat-move-hrtimer_init-to-timerlat_fd-open.patch
queue-6.7/tools-rtla-remove-unused-sched_getattr-function.patch




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux