From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1869EC433F5 for ; Tue, 14 Sep 2021 09:46:25 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D9385610A2 for ; Tue, 14 Sep 2021 09:46:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D9385610A2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:Subject:Cc:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=KKZyy9ktxvucxxlyRih/3ze2FX9fP0VY4Q64H3yZnys=; b=0vcIYedcVUOsPk srOr/5pfxImSxf0TLwysRCWWODpAVOHvkYaELgUZQ8pXc50iheWaoZvVF7Q9/aX5PfC9MRwN+o9c+ acRigzc8OQFfDJv3BN87wN/acHLEEb/uuoZwiAHmJam5+fXNMx6K+zqQbyJcyEI28qb9FttFuSl4X TwJSXHpbodG4LfLRx/KpXa+dWJFYULpE6WOfn2SQhuACxkGvReVxbrk8gbogK3K0nxSnKD8vZOx3g evXPQb38NJjF3ltD7Zg7V3WM4YYssn8dmcuNA7cDXsZtkgtecTrA4CDK1kMfHiSAHMFlQ8dHxbUxi UgMb2cwjxekO8DMm11fQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mQ4zN-005420-6X; Tue, 14 Sep 2021 09:44:29 +0000 Received: from out30-42.freemail.mail.aliyun.com ([115.124.30.42]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mQ4zK-00540D-4s for linux-arm-kernel@lists.infradead.org; Tue, 14 Sep 2021 09:44:27 +0000 X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R111e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=e01e04407; MF=ashimida@linux.alibaba.com; NM=1; PH=DS; RN=5; SR=0; TI=SMTPD_---0UoNByb2_1631612648; Received: from localhost(mailfrom:ashimida@linux.alibaba.com fp:SMTPD_---0UoNByb2_1631612648) by smtp.aliyun-inc.com(127.0.0.1); Tue, 14 Sep 2021 17:44:20 +0800 From: Dan Li To: catalin.marinas@arm.com, will@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Dan Li Subject: [PATCH] [RFC]arm64:Mark __stack_chk_guard as __ro_after_init Date: Tue, 14 Sep 2021 17:44:02 +0800 Message-Id: <1631612642-102881-1-git-send-email-ashimida@linux.alibaba.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210914_024426_399457_00312359 X-CRM114-Status: GOOD ( 11.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org __stack_chk_guard is setup once while init stage and never changed after that. Although the modification of this variable at runtime will usually cause the kernel to crash (so dose the attacker), it should be marked as _ro_after_init, and it should not affect performance if it is placed in the ro_after_init section. This should also be the case on the ARM platform, or am I missing something? Signed-off-by: Dan Li --- arch/arm64/kernel/process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c index c8989b9..c858b85 100644 --- a/arch/arm64/kernel/process.c +++ b/arch/arm64/kernel/process.c @@ -60,7 +60,7 @@ #if defined(CONFIG_STACKPROTECTOR) && !defined(CONFIG_STACKPROTECTOR_PER_TASK) #include -unsigned long __stack_chk_guard __read_mostly; +unsigned long __stack_chk_guard __ro_after_init; EXPORT_SYMBOL(__stack_chk_guard); #endif -- 2.7.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel