Received: by 10.223.185.116 with SMTP id b49csp3815859wrg; Tue, 6 Mar 2018 05:32:44 -0800 (PST) X-Google-Smtp-Source: AG47ELvRze0OFWpDVrqWQa/A16eZTkGV40+C3/oqChOOiBRFTWN3ETDSKj+2srMp9DQ7exnap/mk X-Received: by 2002:a17:902:b28b:: with SMTP id u11-v6mr16717445plr.146.1520343164828; Tue, 06 Mar 2018 05:32:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520343164; cv=none; d=google.com; s=arc-20160816; b=Y6tN/6HQJ6EfJjAKZsgg7h8yAi40PtShnWoOE62t6tvOsJSt6N8+p0+lVx2QhPFg1u vMUNQ84zor3WFX3xSwxEm/vQbDgQJDeRSgOac8zC+NJ3a1aUv5ZrUAOD9DgamU5+D9vT cjIoufojPXaFPHbq7dFlWDl+oKStSrRdU0VKKuu+w5QAkzg0mPDmKmFBcNDAoeQFRpnt oAJS4c5Tewd0ez1wNy3jcGKsUAoypit5so0F4M+RmxO8jXHILxMXO3e4lr7f53xHy/Gp Dfn9HDlM1QBvvlAk+nGbeHwy6clTGkyNPohuNqcaOdlspQFiM1XbUWvUcL0YjJdCOYcB 7YWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:subject:cc:from:to :in-reply-to:arc-authentication-results; bh=86+0PVcWKWyibMJebNJ1B0sb6EHqv5PRc2KjtDX7Smw=; b=JDF/b8UlPB9KQ4VyhyxDvBNStss8ywTFI5k/QUlTCDJcoJHMUVxBksO0l5/NnHTREY b0rXJHGNwtbYJom5TLhZNEo5RtHe38IlMiaRNVYw67Tg6s2Wc2CCp5LDnDQ1GjitsVHm NCybC+0xUenY+NH063ssoFWK5l6bCOUVgHiLQ/52uuLA5BDt2V8JM7AtmYkwAZsix8Pg 12sdSeYevqEsXJaaq9oGdpe1MzMMx4qh4PSrlJaLcjo8i2cEkiQyTFC0ADI3tRgD0AFs qEYiqeBGAyGgfx5rmhjCuzc4dei4XNJF2utZAw3JlSVQzljDQV65sd7he/22qMczJkcf FVwg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q13si9941211pgs.277.2018.03.06.05.32.30; Tue, 06 Mar 2018 05:32:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753776AbeCFNbX (ORCPT + 99 others); Tue, 6 Mar 2018 08:31:23 -0500 Received: from ozlabs.org ([103.22.144.67]:47539 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753720AbeCFNbV (ORCPT ); Tue, 6 Mar 2018 08:31:21 -0500 Received: by ozlabs.org (Postfix, from userid 1034) id 3zwd2v0v8nz9shN; Wed, 7 Mar 2018 00:31:17 +1100 (AEDT) X-powerpc-patch-notification: thanks X-powerpc-patch-commit: 51d42f0f5fd6c74144d19bf6a663521e2ea99765 In-Reply-To: <20180301010249.GA18370@beast> To: Kees Cook From: Michael Ellerman Cc: linux-kernel@vger.kernel.org, Paul Mackerras , linuxppc-dev@lists.ozlabs.org Subject: Re: powerpc: Keep const vars out of writable .sdata Message-Id: <3zwd2v0v8nz9shN@ozlabs.org> Date: Wed, 7 Mar 2018 00:31:17 +1100 (AEDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2018-03-01 at 01:02:49 UTC, Kees Cook wrote: > From: Segher Boessenkool > > Newer gcc will support "-mno-readonly-in-sdata"[1], which makes sure that > the optimization on PPC32 for variables getting moved into the .sdata > section will not apply to const variables (which must be in .rodata). > > This was originally noticed in mm/rodata_test.c when rodata_test_data > was not static: > > c0695034 g O .data 00000004 rodata_test_data > > After this patch with an updated compiler, this is correctly in .rodata. > > [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82411 > > Reported-by: Christophe Leroy > Signed-off-by: Segher Boessenkool > Signed-off-by: Kees Cook Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/51d42f0f5fd6c74144d19bf6a66352 cheers