Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp3516215ioo; Wed, 25 May 2022 02:20:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDBU+g3xyKDjU9vRInZupfRzBZU/M/HXJRi2voU8K4gry3zoWpcdMiDJKSx6jRuwZMpIfz X-Received: by 2002:a17:907:97d0:b0:6ff:e43:2145 with SMTP id js16-20020a17090797d000b006ff0e432145mr2668522ejc.273.1653470409712; Wed, 25 May 2022 02:20:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653470409; cv=none; d=google.com; s=arc-20160816; b=R8LHetdXjBP1/bQMUnjG9m+vxIKLld1QdNvkJcVwGHDxqhnAnSaeqzcGMbGPN71cz0 6hjQmkqcTFPQe+lmd/CajJzFP/T7m/JiI5HiHWXuLJqQoGPJVPwfif5jDXnW9sy1IweC VSzpRnbGYfhLCEweqzIFNvq6bcOEOIhS+nu4U56SfuSppxa3RNDvSnsV+VFd4GvhwNGk QgHU2JHSXNNXAC37yxaHUBj7VbJ7lZaoot8dTRZsmGuYSQFjL5CAW7fRTCOEk5npSXJC /wQ0H8fJWQR3u8UV+SxP9fBO2QlNOl6WFmtmSRCgre6VXzJA2+wnBPOB7RlbAp7kLCVo z3ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version:date :message-id:subject:references:in-reply-to:cc:to:from; bh=tFeWWqWul6sqf/As0yP+VkI9l3fZijZ8lh6v5V0QzhA=; b=IJGVDKxWCUhpvZnBWJKdUc9xOWGM9LdRVn2sjCW9pJMMp9H9QVGl++xOqA3L5WPEuA CJfmQlgf4vNYjsT5z59hX8X3Eful+dS+530z9/zYbcTLYCQPi2WDFuGSkcc+KnX5GUl6 aDfRRg1DVabhn0NFGi2BKVzDwmUbhxGon4AGuN918Dd6JPwj7CddJ/Xq8++aPF3PsHWU To5DWojh5RCcMBwCfTlYFzYorW17ZnJ0tjtZwtSTw1cc8oEX/aweBoa1tHd7GzgL+oQy i95Pk7AaGZapL9Xc+pb1SLXrBoAlOxwOyZU1TwUUrxx3esDQ1qcozQupWp/jZfeuq4vd 872w== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gb5-20020a170907960500b006f468ea7d57si21914460ejc.355.2022.05.25.02.19.43; Wed, 25 May 2022 02:20:09 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236552AbiEXLQG (ORCPT + 99 others); Tue, 24 May 2022 07:16:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236434AbiEXLPg (ORCPT ); Tue, 24 May 2022 07:15:36 -0400 Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5D8491553 for ; Tue, 24 May 2022 04:15:35 -0700 (PDT) Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4L6s7V0g8Wz4ySb; Tue, 24 May 2022 21:15:34 +1000 (AEST) From: Michael Ellerman To: Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Christophe Leroy Cc: Guenter Roeck , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org In-Reply-To: <2e35f0fd649c83c5add17a99514ac040767be93a.1652981047.git.christophe.leroy@csgroup.eu> References: <2e35f0fd649c83c5add17a99514ac040767be93a.1652981047.git.christophe.leroy@csgroup.eu> Subject: Re: [PATCH] powerpc/fsl_book3e: Don't set rodata RO too early Message-Id: <165339059929.1718562.6708480994090360470.b4-ty@ellerman.id.au> Date: Tue, 24 May 2022 21:09:59 +1000 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, 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 Thu, 19 May 2022 19:24:15 +0200, Christophe Leroy wrote: > On fsl_book3e, rodata is set read-only at the same time as > init text is set NX at the end of init. That's too early. > > As both action are performed at the same time, delay both > actions to the time rodata is expected to be made read-only. > > It means we will have a small window with init mem freed but > still executable. It shouldn't be an issue though, especially > because the said memory gets poisoned and should therefore > result to a bad instruction fault in case it gets executer. > > [...] Applied to powerpc/next. [1/1] powerpc/fsl_book3e: Don't set rodata RO too early https://git.kernel.org/powerpc/c/ad91f66f5fa7c6f9346e721c3159ce818568028b cheers