Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC6F9C64EC4 for ; Thu, 9 Mar 2023 00:11:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230033AbjCIALw (ORCPT ); Wed, 8 Mar 2023 19:11:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230028AbjCIALd (ORCPT ); Wed, 8 Mar 2023 19:11:33 -0500 Received: from mail-oa1-x2e.google.com (mail-oa1-x2e.google.com [IPv6:2001:4860:4864:20::2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 222CC93848 for ; Wed, 8 Mar 2023 16:11:31 -0800 (PST) Received: by mail-oa1-x2e.google.com with SMTP id 586e51a60fabf-1763e201bb4so655933fac.1 for ; Wed, 08 Mar 2023 16:11:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1678320691; h=in-reply-to:content-disposition:mime-version:references:subject:cc :to:from:date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=nTISrXpO300lpFWqqY1St1bGS5UZ70h7TsS28CdZuhA=; b=lU5xSvmlhAG3b54eH9/zfnEiAPfx7QvAHsSPdxlykPJsaaaYd1OYKDgFWAsIskGfVE 5tT6P46oQF192NRv767GA7kUhio8TRgM5MrHM+zRHEXrvQDC8lLhCJKONo4p326w5uyP f30CspMb/hizzGnKnTRyTEI354UhNhP7nK3MY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678320691; h=in-reply-to:content-disposition:mime-version:references:subject:cc :to:from:date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=nTISrXpO300lpFWqqY1St1bGS5UZ70h7TsS28CdZuhA=; b=c4NfFzMKanqVxEeVzyDzr5BjXbWZif6VVKn8bgEtZCOvOIAWWYQxcFEnShyJsC5SSL GPYeMTYWU+uQMaL9GJhJlM/JiO5B+FL5Zhk4H5Mdvvj0YrYR6IotFeGII/bNJlmDUhuh tW40mqEpnwcVcastNwpUIpCXXAWdehhipr14K/0jM+MjbUvdI2S02bBApp7dEv5D/tBC D1aaVijLGOTSfNkWSMwEAk5czzIeljmL5Wa8GA6NsWtDwPUmZUIHZDFHet+/E5Re2OP0 Mr1sH6r3cAyimXMnB8XYddx9DJMnPULQEuwEGPpOttEfWnKru6+5DILKOQHs7YUH6WR2 iINw== X-Gm-Message-State: AO0yUKXjo1dahjx5GtEpcGzHVpBejyDz7pnuL1/wix3xsc8HP+oeDQlr 4YIJOWdl+WIaD+BYEIi7BHoKUl53PVLiMBhGuC0= X-Google-Smtp-Source: AK7set8ApWx6kr+SfAyfzkE3zoJmXnq6ygcwKo6GPYa61JZgMWxU/LDFmiGNI9zIm/KYlrc1vCUDPA== X-Received: by 2002:a17:903:18d:b0:19a:eb93:6165 with SMTP id z13-20020a170903018d00b0019aeb936165mr27011036plg.22.1678320108014; Wed, 08 Mar 2023 16:01:48 -0800 (PST) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id t18-20020a170902d21200b00185402cfedesm10299288ply.246.2023.03.08.16.01.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 16:01:47 -0800 (PST) Message-ID: <640921eb.170a0220.28e72.38c8@mx.google.com> X-Google-Original-Message-ID: <202303081601.@keescook> Date: Wed, 8 Mar 2023 16:01:46 -0800 From: Kees Cook To: Nick Desaulniers Cc: Shuah Khan , Linux Kernel Functional Testing , Naresh Kamboju , KERNEL SELFTEST FRAMEWORK , linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, lkft-triage@lists.linaro.org, Thomas Gleixner , "Chang S. Bae" , Len Brown , Borislav Petkov , Stas Sergeev , Arnd Bergmann , Anders Roxell , Andy Lutomirski , Nathan Chancellor , llvm@lists.linux.dev Subject: Re: [PATCH] selftests: sigaltstack: fix -Wuninitialized References: <20230308195933.806917-1-ndesaulniers@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230308195933.806917-1-ndesaulniers@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Link: https://lore.kernel.org/lkml/CA+G9fYsi3OOu7yCsMutpzKDnBMAzJBCPimBp86LhGBa0eCnEpA@mail.gmail.com/ > Signed-off-by: Nick Desaulniers Looks good! Reviewed-by: Kees Cook -- Kees Cook