From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755195AbcBWUbg (ORCPT ); Tue, 23 Feb 2016 15:31:36 -0500 Received: from mail-oi0-f48.google.com ([209.85.218.48]:33318 "EHLO mail-oi0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752204AbcBWUbe (ORCPT ); Tue, 23 Feb 2016 15:31:34 -0500 Date: Tue, 23 Feb 2016 13:31:31 -0700 From: David Brown To: kernel-hardening@lists.openwall.com Cc: PaX Team , Ard Biesheuvel , Laura Abbott , Greg Kroah-Hartman , Mark Rutland , Jeremy Linton , Arnd Bergmann , LKML Subject: Re: [kernel-hardening] Re: [PATCH] lkdtm: add test for executing .rodata Message-ID: <20160223203131.GA1797@davidb.org> References: <20160216214904.GA23723@www.outflux.net> <56C59DC5.19217.28FA99@pageexec.freemail.hu> <56C63747.819.280B3F5@pageexec.freemail.hu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 22, 2016 at 12:46:28PM -0800, Kees Cook wrote: >On Thu, Feb 18, 2016 at 1:27 PM, PaX Team wrote: >> On 18 Feb 2016 at 12:34, Ard Biesheuvel wrote: >> >>> 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 >> >> in that case why not use a top-level asm statement to set the section >> and its attributes (and compile the file with fno-toplevel-reorder)? > >GCC really wants to declare the section. :( Why not then just use its mechanism to set the section on the code? static void do_nothing_rodata(void) __attribute__((section(".rodata"))) { return; } David