[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8825.1291049944@localhost>
Date: Mon, 29 Nov 2010 11:59:04 -0500
From: Valdis.Kletnieks@...edu
To: mat <castet.matthieu@...e.fr>
Cc: linux-kernel@...r.kernel.org,
linux-security-module@...r.kernel.org, linux-next@...r.kernel.org,
Arjan van de Ven <arjan@...radead.org>,
James Morris <jmorris@...ei.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Andi Kleen <ak@....de>, Thomas Gleixner <tglx@...utronix.de>,
"H. Peter Anvin" <hpa@...or.com>, Ingo Molnar <mingo@...e.hu>,
Rusty Russell <rusty@...tcorp.com.au>,
Stephen Rothwell <sfr@...b.auug.org.au>,
Dave Jones <davej@...hat.com>,
Siarhei Liakh <sliakh.lkml@...il.com>,
Kees Cook <kees.cook@...onical.com>
Subject: Re: [PATCH 3/3 V13] RO/NX protection for loadable kernel
On Fri, 26 Nov 2010 18:23:55 +0100, mat said:
> Le Wed, 24 Nov 2010 22:41:07 -0500,
> Valdis.Kletnieks@...edu a =E9crit :
> > This is incompatible with CONFIG_JUMP_LABEL:
> >
> > [ 252.093624] BUG: unable to handle kernel paging request at
> > ffffffffa0680764 [ 252.094008] IP: [<ffffffff81225ee0>]
> > generic_swap+0xa/0x1a [ 252.094008] PGD 1a1e067 PUD 1a22063 PMD
> > 1093ac067 PTE 8000000109786161 [ 252.094008] Oops: 0003 [#1] PREEMPT
> > SMP
> > > +config DEBUG_SET_MODULE_RONX
> > > + bool "Set loadable kernel module data as NX and text as RO"
> > > + default n
> > > + depends on X86 && MODULES
> >
> > depends on X86 && MODULES && !JUMP_LABEL
> could you try the attached patch ?
>
> on module load, we sort the __jump_table section. So we should make it
> writable.
> diff --git a/arch/x86/include/asm/jump_label.h b/arch/x86/include/asm/jump_la
bel.h
> index f52d42e..574dbc2 100644
> --- a/arch/x86/include/asm/jump_label.h
> +++ b/arch/x86/include/asm/jump_label.h
> @@ -14,7 +14,7 @@
> do { \
> asm goto("1:" \
> JUMP_LABEL_INITIAL_NOP \
> - ".pushsection __jump_table, \"a\" \n\t"\
> + ".pushsection __jump_table, \"aw\" \n\t"\
Confirming that fixes the issue I was seeing, thanks...
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists