This is a note to let you know that I've just added the patch titled tools/rv: Fix curr_reactor uninitialized variable 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-rv-fix-curr_reactor-uninitialized-variable.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 61ec586bc0815959d3314cf7ce242529c977b357 Mon Sep 17 00:00:00 2001 From: Daniel Bristot de Oliveira <bristot@xxxxxxxxxx> Date: Tue, 6 Feb 2024 12:05:34 +0100 Subject: tools/rv: Fix curr_reactor uninitialized variable From: Daniel Bristot de Oliveira <bristot@xxxxxxxxxx> commit 61ec586bc0815959d3314cf7ce242529c977b357 upstream. clang is reporting: $ 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) -I include -c -o src/in_kernel.o src/in_kernel.c [...] src/in_kernel.c:227:6: warning: variable 'curr_reactor' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] 227 | if (!end) | ^~~~ src/in_kernel.c:242:9: note: uninitialized use occurs here 242 | return curr_reactor; | ^~~~~~~~~~~~ src/in_kernel.c:227:2: note: remove the 'if' if its condition is always false 227 | if (!end) | ^~~~~~~~~ 228 | goto out_free; | ~~~~~~~~~~~~~ src/in_kernel.c:221:6: warning: variable 'curr_reactor' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] 221 | if (!start) | ^~~~~~ src/in_kernel.c:242:9: note: uninitialized use occurs here 242 | return curr_reactor; | ^~~~~~~~~~~~ src/in_kernel.c:221:2: note: remove the 'if' if its condition is always false 221 | if (!start) | ^~~~~~~~~~~ 222 | goto out_free; | ~~~~~~~~~~~~~ src/in_kernel.c:215:20: note: initialize the variable 'curr_reactor' to silence this warning 215 | char *curr_reactor; | ^ | = NULL 2 warnings generated. Which is correct. Setting curr_reactor to NULL avoids the problem. Link: https://lkml.kernel.org/r/3a35551149e5ee0cb0950035afcb8082c3b5d05b.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: 6d60f89691fc ("tools/rv: Add in-kernel monitor interface") Signed-off-by: Daniel Bristot de Oliveira <bristot@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- tools/verification/rv/src/in_kernel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/tools/verification/rv/src/in_kernel.c +++ b/tools/verification/rv/src/in_kernel.c @@ -210,9 +210,9 @@ static char *ikm_read_reactor(char *moni static char *ikm_get_current_reactor(char *monitor_name) { char *reactors = ikm_read_reactor(monitor_name); + char *curr_reactor = NULL; char *start; char *end; - char *curr_reactor; if (!reactors) return NULL; 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