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=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 5106FC433EF for ; Tue, 14 Sep 2021 10:01:13 +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 1C2146109E for ; Tue, 14 Sep 2021 10:01:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1C2146109E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=armlinux.org.uk 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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6NU5N/Dgga/RTgxIhbL55V5vCV9Du1w8VADwovtsNtE=; b=4gXrI2MCJ+5JJd bAYOXXq0Jdunjwc9AGg3wztyPQXAGX3eU2IuVa/5OMlsf3+brMUXwQjbK4TmwfaDe5/YnfprpNGKj U/GVGq2wIEt4Wz0SGDuhWAUZNVDWdzHvKXIe6wSO9rd6ZbBoNLAI44ogfzRpYFKW5qS2oBFtBJySb lL/jzdfzGasauSSvxjdQGc8YlURKOqXB2YraVq20lkloGp5ESy+CTpVhzX2TRPZmkc4IEn0t1DOfB Ylg1TeqYjq4pkgkhXwAO7Trov3QPYuYic63jt363ahB7IgxDTYDUe/NFLkTGts1d1CwN8SlsUWBe5 UsxMg7Qg+y1oirIKzs2A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mQ5DQ-0056nu-2K; Tue, 14 Sep 2021 09:59:00 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mQ5DM-0056n2-1c for linux-arm-kernel@lists.infradead.org; Tue, 14 Sep 2021 09:58:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=BqQzYsxdLI8kcCJ94d+ycuGwOhuCfKsKES6cCvOkuhw=; b=zuqt9x6fxJyg0fI06T9xftv6dj g0H9xMeXRbXxt/e2N2ljSYNIdgLN2W7Y+frI+rFGT7CKhN69IkYRE14nAWzqfDz1KYokXZJKjfC2O 8mvzaG2V1ismwIcxYQqpLKk3JQGAkD+/Hk9EE5n4fB78LKVUR6yUn4LyOwC6OdtlNy+mIAKA286vG dlXjbSoo4er4mirDVDWGVrWbzCRUuelEY9EF/NTLvsMsCElavgrx4aZ+SeV2FIUs5oSqYePChCOFR 9TjlPzUpacufF9Fp4StFIlRuxo/rciGrbzOaY/Rhv8qS0JU/PyL8neiJ0wzOZVBG2nD0OXOr7GEqV sbRv824Q==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:45092) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mQ5DG-0004hH-0A; Tue, 14 Sep 2021 10:58:48 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1mQ5DC-0002si-VO; Tue, 14 Sep 2021 10:58:46 +0100 Date: Tue, 14 Sep 2021 10:58:46 +0100 From: "Russell King (Oracle)" To: Dan Li Cc: catalin.marinas@arm.com, will@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] [RFC]arm64:Mark __stack_chk_guard as __ro_after_init Message-ID: References: <1631612642-102881-1-git-send-email-ashimida@linux.alibaba.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1631612642-102881-1-git-send-email-ashimida@linux.alibaba.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210914_025856_134110_A57902C4 X-CRM114-Status: GOOD ( 14.74 ) 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 On Tue, Sep 14, 2021 at 05:44:02PM +0800, Dan Li wrote: > __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? I don't see why it can't be - we only write to it in boot_init_stack_canary(), same as ARM64. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ 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=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 66EA4C433EF for ; Tue, 14 Sep 2021 09:58:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4700460F6F for ; Tue, 14 Sep 2021 09:58:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231190AbhINKAO (ORCPT ); Tue, 14 Sep 2021 06:00:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230282AbhINKAN (ORCPT ); Tue, 14 Sep 2021 06:00:13 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49DEDC061574 for ; Tue, 14 Sep 2021 02:58:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=BqQzYsxdLI8kcCJ94d+ycuGwOhuCfKsKES6cCvOkuhw=; b=zuqt9x6fxJyg0fI06T9xftv6dj g0H9xMeXRbXxt/e2N2ljSYNIdgLN2W7Y+frI+rFGT7CKhN69IkYRE14nAWzqfDz1KYokXZJKjfC2O 8mvzaG2V1ismwIcxYQqpLKk3JQGAkD+/Hk9EE5n4fB78LKVUR6yUn4LyOwC6OdtlNy+mIAKA286vG dlXjbSoo4er4mirDVDWGVrWbzCRUuelEY9EF/NTLvsMsCElavgrx4aZ+SeV2FIUs5oSqYePChCOFR 9TjlPzUpacufF9Fp4StFIlRuxo/rciGrbzOaY/Rhv8qS0JU/PyL8neiJ0wzOZVBG2nD0OXOr7GEqV sbRv824Q==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:45092) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mQ5DG-0004hH-0A; Tue, 14 Sep 2021 10:58:48 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1mQ5DC-0002si-VO; Tue, 14 Sep 2021 10:58:46 +0100 Date: Tue, 14 Sep 2021 10:58:46 +0100 From: "Russell King (Oracle)" To: Dan Li Cc: catalin.marinas@arm.com, will@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] [RFC]arm64:Mark __stack_chk_guard as __ro_after_init Message-ID: References: <1631612642-102881-1-git-send-email-ashimida@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1631612642-102881-1-git-send-email-ashimida@linux.alibaba.com> Sender: Russell King (Oracle) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 14, 2021 at 05:44:02PM +0800, Dan Li wrote: > __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? I don't see why it can't be - we only write to it in boot_init_stack_canary(), same as ARM64. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!