From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1426189AbcBRMHu (ORCPT ); Thu, 18 Feb 2016 07:07:50 -0500 Received: from mout.kundenserver.de ([217.72.192.75]:49641 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1425480AbcBRMHt (ORCPT ); Thu, 18 Feb 2016 07:07:49 -0500 From: Arnd Bergmann To: Ard Biesheuvel Cc: PaX Team , Laura Abbott , Kees Cook , Greg Kroah-Hartman , Mark Rutland , Jeremy Linton , "kernel-hardening@lists.openwall.com" , LKML Subject: Re: [PATCH] lkdtm: add test for executing .rodata Date: Thu, 18 Feb 2016 13:07:24 +0100 Message-ID: <3013719.NTkGVd5eeC@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: References: <20160216214904.GA23723@www.outflux.net> <56C59DC5.19217.28FA99@pageexec.freemail.hu> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:NFmfc9HB6f5AV+L5GDBYRZA48aBBt2YnTC2yhV2Cz1sxq8vNF2v P7Z8/MqoG89WEis5syJvj1PV2IMnrAiaj4jLxc1WOJT+90dOMgL4IQgDGxNGblV/EdH+W59 +wxPzs06HhRh0oH1P27K+z7XJ4Y6D6VEY6FPloRawtmx+WAjoxTzn1TPqg1GA0AhMW1WaRf pOB/LBybtmbZZWKT/iXGA== X-UI-Out-Filterresults: notjunk:1;V01:K0:AZ/O9v2xNzE=:1XCQdMF6DUuQAr4A9MI+pi ie8c+CCex2k4oEZ+yKPAnbfkWLS6M3L5ITZHhcZOjo2IdRRlsSAcdrzrPPIW6efkF9LCFw21x bGGpDBsKAEOiwh8iFD3r0rpjyG3+KR02jrSOfS9xffvdxd/Hwk9jx1r35MX9fp9aSmRRfVhAo U9EXkQSwGPw/zSjfxKzIivKfCa5pWkwkMP0T0nqoFjbXKNlufp8itEYt3TTI7pbY7fD67UTXh YJXsB9GJbkk9ukIy8p934uokImUXuGcU4Mrt6DN6+M4YZxnvSMCi2QvRqThm7kqA9EaQh8j8K PDpRY49V+/mmzh3g/bzyDT3eFTF+Y1V4um9u7UUHiN0JlC4gaxuduq4m8TzTbBBmyGMvUNkTY cOUwFNHwem1Me2YpfH5x07v7I94AHqXIHdPO3q45NGpeBmjJg2dJCgRH5eIgj8nNzlF8E5nSY 4/zdFDh/LGvYkYKvj+K2Aaw47tFqcKcYmLJtYSqQKT6elRQd5Lm8A4vfgWwBTMeUQDtJOfczS XfBjralMcvLfjcJAgT3y3Pr+5FArii3+jIV7yeLulljAmHJnJ96xTIuUHQQwRVeSasm+kCUWi s7Vp0kpeqZja7Knw7Aud+tB1zHbbD07hI3dEBZREzSg0F/ST3gejd5XWvl0AHhc/lQNfRJQRu fkS+hCyTTL4hwOlp3k9HSvHn9E0lLlBTyz0wtXAdxgRmb11BKaCAii/mYh4Id3Pd/LT9M4qir eLEFlaPKGtnKHmAn Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday 18 February 2016 12:34:50 Ard Biesheuvel wrote: > > We have __section() as an alias for __attribute__((__section__())), so > we could use that instead. > > However, that does not fix the issue Kees is trying to solve, where a > .rodata section is emitted with the "x" bit set, which causes the > linker to complain: > > /tmp/cc50ffWw.s: Assembler messages: > /tmp/cc50ffWw.s:2: Warning: setting incorrect section attributes for > .rodata.text > > I wonder if we could get away with doing something like > > AFLAGS_lkdtm.o += -Wa,-W > > here? This just hides the warnings, but may result in the .rodata > section in the vmlinux file to have X permissions as well. I don't > think anyone uses an ELF loader to load their kernel, but who knows > ... Don't we also get a warning when we link objects with conflicting section attributes? Maybe a solution would be to define a separate section for this one function, and then use a linker script to move it into .rodata? Or maybe "objcopy --set-section-flags --rename-section"? Arnd