Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp268861iog; Tue, 28 Jun 2022 22:53:55 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sjCA+00X39ftHCPZC79gfzV5rEPE7F8BYl4WDF0jhq6OLFxTcU27QD2whI1rBgzSAhKnui X-Received: by 2002:a17:90b:507:b0:1ee:de8c:6aa2 with SMTP id r7-20020a17090b050700b001eede8c6aa2mr2009519pjz.105.1656482035502; Tue, 28 Jun 2022 22:53:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656482035; cv=none; d=google.com; s=arc-20160816; b=hEHskGl8vGUiatxKhNEx4a3UvzOU0S8iyY9CTiwjqR40xgQqpmmKVAXxpfwj5cS6Yd 7bYkFHEwMQNlN8sAtizfCtNSyjovWDOYU9A6yd56ccOOyBHNy19NGIqD8TjGr8tVvskL g0xGTRjSvrWGPcYwQrBCafE8BMuhfHa0Ggjt+SK0humPt/u7rhSs0w9i2JeSNJDLFe4M uSjXpnoAYkGj6Gu1qSe1/JWR9FWJHLsXebAJ6NoPszvuC+F7wOu1V6ZFQjv68Fi/JUDA NF3mNGOcVsuHOgfXDhN5X2tOLam8I36ZjuxTlLu1fmnz+Bbt7DOmcZr6yMLBHx5IPfh0 BrTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=ORadTpsSARfu/o+R6cbn+WXN+6UWW6PvbKf0jlLw6W8=; b=p5tHLLyQp5URn8uq/zLxVe2WQta5rcQb7wWzDgdrAbl71htwmSfhsITvW+5IjRZw6H gnfEd61VJy3Cdl5O3Z3PbjgeoJfxd5uF8A0/OTs4xqH8Up0hcOmnmoL+4c5vk3UHDOb8 E64XGRLCyA0ArVlWIvvOlwD7ljlBygSYcx674B1s+l79pvMvEwt56DDkhzM2lZtG73wy UY25U/YfCPmhXcb7Cr6j4OP8VU+zlf/LUdqdjZ/LGbT7IhCZDkZnCbVAjMSN9bdyLgVm 6ZFGr7bT098iqCyLDYcQAivIoMk6fiCEQ80zLx0ZyHhOoQX10aN/PzgLmSLtC69xErYI RJwA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n21-20020a634d55000000b003fd60345d13si22270033pgl.693.2022.06.28.22.53.41; Tue, 28 Jun 2022 22:53:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229608AbiF2Fvr (ORCPT + 99 others); Wed, 29 Jun 2022 01:51:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229475AbiF2Fvq (ORCPT ); Wed, 29 Jun 2022 01:51:46 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08A911658C for ; Tue, 28 Jun 2022 22:51:45 -0700 (PDT) Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4LXrBZ1KwczhYrL; Wed, 29 Jun 2022 13:49:26 +0800 (CST) Received: from dggpemm500016.china.huawei.com (7.185.36.25) by dggpemm500022.china.huawei.com (7.185.36.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 29 Jun 2022 13:51:42 +0800 Received: from [10.67.108.157] (10.67.108.157) by dggpemm500016.china.huawei.com (7.185.36.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 29 Jun 2022 13:51:42 +0800 Message-ID: <6c274345-3370-16c8-f5f1-68521de0f51a@huawei.com> Date: Wed, 29 Jun 2022 13:51:15 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH] stack: Declare {randomize_,}kstack_offset to fix Sparse warnings Content-Language: en-US To: Christophe Leroy , Kees Cook , Marco Elver CC: Xiu Jianfeng , "kernel-hardening@lists.openwall.com" , "linuxppc-dev@lists.ozlabs.org" , "linux-kernel@vger.kernel.org" References: <20220629032939.2506773-1-gongruiqi1@huawei.com> From: Gong Ruiqi In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.108.157] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm500016.china.huawei.com (7.185.36.25) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/06/29 13:10, Christophe Leroy wrote: > > > Le 29/06/2022 à 05:29, GONG, Ruiqi a écrit : >> Fix the following Sparse warnings that got noticed when the PPC-dev >> patchwork was checking another patch (see the link below): >> >> init/main.c:862:1: warning: symbol 'randomize_kstack_offset' was not declared. Should it be static? >> init/main.c:864:1: warning: symbol 'kstack_offset' was not declared. Should it be static? >> >> Which in fact are triggered on all architectures that have >> HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET support (for instances x86, arm64 >> etc). >> >> Link: https://lore.kernel.org/lkml/e7b0d68b-914d-7283-827c-101988923929@huawei.com/T/#m49b2d4490121445ce4bf7653500aba59eefcb67f >> Cc: Christophe Leroy >> Cc: Xiu Jianfeng >> Signed-off-by: GONG, Ruiqi >> --- >> init/main.c | 4 ++++ >> 1 file changed, 4 insertions(+) >> >> diff --git a/init/main.c b/init/main.c >> index e2490387db2b..6aa0fb2340cc 100644 >> --- a/init/main.c >> +++ b/init/main.c >> @@ -101,6 +101,10 @@ >> #include >> #include >> >> +#ifdef CONFIG_RANDOMIZE_KSTACK_OFFSET > > You don't need this #ifdef, there is already one inside > linux/randomize_kstack.h > Ah yes, I didn't notice the config was there already. I will send a new version. Thanks for your reminder! >> +#include >> +#endif >> + >> #include >> #include >> #include >> -- >> 2.25.1