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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86A72C433F5 for ; Mon, 4 Oct 2021 12:54:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 72759611CA for ; Mon, 4 Oct 2021 12:54:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233398AbhJDM42 (ORCPT ); Mon, 4 Oct 2021 08:56:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:57690 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233452AbhJDM4S (ORCPT ); Mon, 4 Oct 2021 08:56:18 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B1A6B613A8; Mon, 4 Oct 2021 12:54:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633352069; bh=LXB02JFs8bgi6dxze1zOCYnPyFndr88EFEvdb5wjlqM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XvvlxqgHHRjmJ3gcLajM91Wnb+J/Mql6CN0piIiNtDlwtSvRyBoU1cCPKK7MMANJQ +BiE86VSsE0RtPi54wt7IlSt74z1yy5jXK1AHYFHKOdr4efm79eKIDP6Dplkel2tXR OSXrg48/NPEshOBWljeNLaimu7FrNSjgw3uB+PBQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Li , Mark Rutland , Catalin Marinas , Sasha Levin Subject: [PATCH 4.4 20/41] arm64: Mark __stack_chk_guard as __ro_after_init Date: Mon, 4 Oct 2021 14:52:11 +0200 Message-Id: <20211004125027.226245055@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211004125026.597501645@linuxfoundation.org> References: <20211004125026.597501645@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@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 10d6627673cb..6cd79888944e 100644 --- a/arch/arm64/kernel/process.c +++ b/arch/arm64/kernel/process.c @@ -55,7 +55,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.33.0