[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <640921eb.170a0220.28e72.38c8@mx.google.com>
Date: Wed, 8 Mar 2023 16:01:46 -0800
From: Kees Cook <keescook@...omium.org>
To: Nick Desaulniers <ndesaulniers@...gle.com>
Cc: Shuah Khan <shuah@...nel.org>,
Linux Kernel Functional Testing <lkft@...aro.org>,
Naresh Kamboju <naresh.kamboju@...aro.org>,
KERNEL SELFTEST FRAMEWORK <linux-kselftest@...r.kernel.org>,
linux-api@...r.kernel.org, linux-kernel@...r.kernel.org,
lkft-triage@...ts.linaro.org, Thomas Gleixner <tglx@...utronix.de>,
"Chang S. Bae" <chang.seok.bae@...el.com>,
Len Brown <len.brown@...el.com>, Borislav Petkov <bp@...e.de>,
Stas Sergeev <stsp@...t.ru>, Arnd Bergmann <arnd@...db.de>,
Anders Roxell <anders.roxell@...aro.org>,
Andy Lutomirski <luto@...nel.org>,
Nathan Chancellor <nathan@...nel.org>, llvm@...ts.linux.dev
Subject: Re: [PATCH] selftests: sigaltstack: fix -Wuninitialized
On Wed, Mar 08, 2023 at 11:59:33AM -0800, Nick Desaulniers wrote:
> Building sigaltstack with clang via:
> $ ARCH=x86 make LLVM=1 -C tools/testing/selftests/sigaltstack/
>
> produces the following warning:
> warning: variable 'sp' is uninitialized when used here [-Wuninitialized]
> if (sp < (unsigned long)sstack ||
> ^~
>
> Clang expects these to be declared at global scope; we've fixed this in
> the kernel proper by using the macro `current_stack_pointer`. This is
> defined in different headers for different target architectures, so just
> create a new header that defines the arch-specific register names for
> the stack pointer register, and define it for more targets (at least the
> ones that support current_stack_pointer/ARCH_HAS_CURRENT_STACK_POINTER).
>
> Reported-by: Linux Kernel Functional Testing <lkft@...aro.org>
> Link: https://lore.kernel.org/lkml/CA+G9fYsi3OOu7yCsMutpzKDnBMAzJBCPimBp86LhGBa0eCnEpA@mail.gmail.com/
> Signed-off-by: Nick Desaulniers <ndesaulniers@...gle.com>
Looks good!
Reviewed-by: Kees Cook <keescook@...omium.org>
--
Kees Cook
Powered by blists - more mailing lists