Skip to content

Commit 3001087

Browse files
committed
lkdtm: fix false positive warning from -Wmaybe-uninitialized
The variable in use here doesn't matter (it's just used to exercise taking up stack space), but this changes its use to pass its address instead, to avoid a compiler warning: drivers/misc/lkdtm_usercopy.c:54:15: warning: 'bad_stack' may be used uninitialized in this function [-Wmaybe-uninitialized] Reported-by: Arnd Bergmann <[email protected]> Signed-off-by: Kees Cook <[email protected]>
1 parent 0e06f5c commit 3001087

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/misc/lkdtm_usercopy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ static noinline void do_usercopy_stack(bool to_user, bool bad_frame)
4949

5050
/* This is a pointer to outside our current stack frame. */
5151
if (bad_frame) {
52-
bad_stack = do_usercopy_stack_callee((uintptr_t)bad_stack);
52+
bad_stack = do_usercopy_stack_callee((uintptr_t)&bad_stack);
5353
} else {
5454
/* Put start address just inside stack. */
5555
bad_stack = task_stack_page(current) + THREAD_SIZE;

0 commit comments

Comments
 (0)