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=-18.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 3E65AC43219 for ; Thu, 23 Sep 2021 03:42:58 +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 0F21061250 for ; Thu, 23 Sep 2021 03:42:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0F21061250 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=tzRbWFdn3SIvQc73iFT5iG9vrHMu1jkzlMbznzwLC28=; b=fUvL1BPUl9WlEf /uZ9E/0pBrinUI2YKm11RqJwB3JF7L6R4Aqjpa7B/kTk+xR/9c7VOJfsIKJf2OGCprcOav1yJggpk gXXTPm8WCA1jqVtQ8Px9+n5HFN4YUWyqxDZRaTGBMF9ZMxCj8Ht4au9WLUFjbIUNAE/yjf0Ob5Iw+ VpXZzcmIZ2qHexvIlSXW8ZS1asGTITNKuyxeWvFMBA3Fn2zqXqRW44RKTsIDJa4LD5BQHD58chIHp YhL2ctjC5ELtdVn5g7TWUOGuUYu9I4fuo9IKlaaqY4TrU1Xfa/S2fhWoxPs20O8Sdhc63/yFaMR5b 3/vGw5AqCOpFC9zJQpcA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mTFc1-00ABuA-1f; Thu, 23 Sep 2021 03:41:29 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mTFbL-00ABUd-Ke for linux-arm-kernel@lists.infradead.org; Thu, 23 Sep 2021 03:40:49 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 365A161357; Thu, 23 Sep 2021 03:40:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632368447; bh=ILNT5vUGs2uITvDM8T1+ufsBENVFasIh7Q2M+DkMJYQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eXA1/DoQmMHN0ruPDoq4ykg+XLHIjfPTwOQa1Td76wZuDxtI6FQzbkQ7yrVfpZk/U wWlEOPar0Cse/l3Kbg/Gx8sTHr8hrkKGzBz7U3Lv2Vn3rwpL9eo1NQSgpn+c4SKAYQ Lis5xBzl6Bn2TGpKrPk2B1VwDnxaFqqusBaWEOCU/xL6cFXINe/BrIQFf/qadvDIWd Ucyz/B3UnN5Ic3xLEmEE7gmJHdE3QLGmYZakjc7Vxaf03sEwut/QfC1rxFvYcnNEM6 BJ27uQmPyaMOa2vIpYEQqHjqS+8LJvYbUfSVXrII2fDpkOhvIbmlXidEK35ggVVSVW w41wYXraWuz1A== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Dan Li , Mark Rutland , Catalin Marinas , Sasha Levin , will@kernel.org, maz@kernel.org, peterz@infradead.org, pcc@google.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 4.9 08/11] arm64: Mark __stack_chk_guard as __ro_after_init Date: Wed, 22 Sep 2021 23:40:24 -0400 Message-Id: <20210923034028.1421876-8-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210923034028.1421876-1-sashal@kernel.org> References: <20210923034028.1421876-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210922_204047_734652_13CF74A4 X-CRM114-Status: GOOD ( 11.13 ) 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: , 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 From: Dan Li [ Upstream commit 9fcb2e93f41c07a400885325e7dbdfceba6efaec ] __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 does 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. Signed-off-by: Dan Li Acked-by: Mark Rutland Link: https://lore.kernel.org/r/1631612642-102881-1-git-send-email-ashimida@linux.alibaba.com Signed-off-by: Catalin Marinas Signed-off-by: Sasha Levin --- 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 e917d119490c..9c62365f8267 100644 --- a/arch/arm64/kernel/process.c +++ b/arch/arm64/kernel/process.c @@ -57,7 +57,7 @@ #ifdef CONFIG_CC_STACKPROTECTOR #include -unsigned long __stack_chk_guard __read_mostly; +unsigned long __stack_chk_guard __ro_after_init; EXPORT_SYMBOL(__stack_chk_guard); #endif -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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=-20.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 3BBD0C4332F for ; Thu, 23 Sep 2021 03:44:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 254F360F4C for ; Thu, 23 Sep 2021 03:44:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239866AbhIWDpa (ORCPT ); Wed, 22 Sep 2021 23:45:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:41464 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239178AbhIWDnf (ORCPT ); Wed, 22 Sep 2021 23:43:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 365A161357; Thu, 23 Sep 2021 03:40:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632368447; bh=ILNT5vUGs2uITvDM8T1+ufsBENVFasIh7Q2M+DkMJYQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eXA1/DoQmMHN0ruPDoq4ykg+XLHIjfPTwOQa1Td76wZuDxtI6FQzbkQ7yrVfpZk/U wWlEOPar0Cse/l3Kbg/Gx8sTHr8hrkKGzBz7U3Lv2Vn3rwpL9eo1NQSgpn+c4SKAYQ Lis5xBzl6Bn2TGpKrPk2B1VwDnxaFqqusBaWEOCU/xL6cFXINe/BrIQFf/qadvDIWd Ucyz/B3UnN5Ic3xLEmEE7gmJHdE3QLGmYZakjc7Vxaf03sEwut/QfC1rxFvYcnNEM6 BJ27uQmPyaMOa2vIpYEQqHjqS+8LJvYbUfSVXrII2fDpkOhvIbmlXidEK35ggVVSVW w41wYXraWuz1A== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Dan Li , Mark Rutland , Catalin Marinas , Sasha Levin , will@kernel.org, maz@kernel.org, peterz@infradead.org, pcc@google.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 4.9 08/11] arm64: Mark __stack_chk_guard as __ro_after_init Date: Wed, 22 Sep 2021 23:40:24 -0400 Message-Id: <20210923034028.1421876-8-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210923034028.1421876-1-sashal@kernel.org> References: <20210923034028.1421876-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Li [ Upstream commit 9fcb2e93f41c07a400885325e7dbdfceba6efaec ] __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 does 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. Signed-off-by: Dan Li Acked-by: Mark Rutland Link: https://lore.kernel.org/r/1631612642-102881-1-git-send-email-ashimida@linux.alibaba.com Signed-off-by: Catalin Marinas Signed-off-by: Sasha Levin --- 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 e917d119490c..9c62365f8267 100644 --- a/arch/arm64/kernel/process.c +++ b/arch/arm64/kernel/process.c @@ -57,7 +57,7 @@ #ifdef CONFIG_CC_STACKPROTECTOR #include -unsigned long __stack_chk_guard __read_mostly; +unsigned long __stack_chk_guard __ro_after_init; EXPORT_SYMBOL(__stack_chk_guard); #endif -- 2.30.2