qwe 64 | 30 Sep 2010 16:18
Picon
Favicon
Gravatar

grsecurity breaks reiser4 compilation

Hi, today i tried to compile kernel (2.6.32.23) with reiser4 patch and latest grsecurity, however i got "assignment to read-only structure" error.
I found a reason for that.
grsecurity patch modifies file include/linux/fs.h , in particular - struct super_operations , adding "const"s there.
It causes compilation error in reiser4's reiser4_init_super_data at init_super.c line 399 when it tries to do sbinfo->ops.super = reiser4_super_operations .
As a workaround, i created include/linux/fs_reiser4.h and seded reiser4 tree to use this instead of fs.h .

But it would be nice if you patched grsecurity, or maybe submit a separate patch for reiser4-patched kernel.
As there are many people who use reiser4 and will be quite confused by grsecurity breaking it.

_______________________________________________
grsecurity mailing list
grsecurity@...
http://grsecurity.net/cgi-bin/mailman/listinfo/grsecurity
pageexec | 1 Oct 2010 02:15
Picon
Favicon

Re: grsecurity breaks reiser4 compilation

On 30 Sep 2010 at 17:18, qwe 64 wrote:

>  Hi, today i tried to compile kernel (2.6.32.23) with reiser4 patch
>  and latest grsecurity, however i got "assignment to read-only
>  structure" error.
>  I found a reason for that.
>  grsecurity patch modifies file include/linux/fs.h , in particular -
>  struct super_operations , adding "const"s there.
>  It causes compilation error in reiser4's reiser4_init_super_data at
>  init_super.c line 399 when it tries to do sbinfo->ops.super =
>  reiser4_super_operations .

the main question to answer is why reiser4 needs to modify this structure
at runtime in the first place as it is a no-go in vanilla linux as well,
it's just not enforced at the compiler level (but try to get it past Al
Viro and you'll see ;). so where's this patch/code exactly and why does
it do this?
Kerin Millar | 1 Oct 2010 04:27
Picon
Gravatar

Re: grsecurity breaks reiser4 compilation

On 1 October 2010 01:15,  <pageexec@...> wrote:
> On 30 Sep 2010 at 17:18, qwe 64 wrote:
>
>>  Hi, today i tried to compile kernel (2.6.32.23) with reiser4 patch
>>  and latest grsecurity, however i got "assignment to read-only
>>  structure" error.
>>  I found a reason for that.
>>  grsecurity patch modifies file include/linux/fs.h , in particular -
>>  struct super_operations , adding "const"s there.
>>  It causes compilation error in reiser4's reiser4_init_super_data at
>>  init_super.c line 399 when it tries to do sbinfo->ops.super =
>>  reiser4_super_operations .
>
> the main question to answer is why reiser4 needs to modify this structure
> at runtime in the first place as it is a no-go in vanilla linux as well,
> it's just not enforced at the compiler level (but try to get it past Al
> Viro and you'll see ;). so where's this patch/code exactly and why does
> it do this?

There are known good (so to speak) patches here:

http://kernel.sysresccd.org/sysresccd-1.6.1/

--Kerin
pageexec | 1 Oct 2010 17:09
Picon
Favicon

Re: grsecurity breaks reiser4 compilation

On 1 Oct 2010 at 3:27, Kerin Millar wrote:

> > the main question to answer is why reiser4 needs to modify this structure
> > at runtime in the first place as it is a no-go in vanilla linux as well,
> > it's just not enforced at the compiler level (but try to get it past Al
> > Viro and you'll see ;). so where's this patch/code exactly and why does
> > it do this?
> 
> There are known good (so to speak) patches here:
> 
> http://kernel.sysresccd.org/sysresccd-1.6.1/

thanks, from what i can tell based on a quick glance at the affected
code, there's no reason for reiser4 to make runtime copies of these
ops structures (there's export and dentry ops involved too), so someone
should rewrite the code to directly use the ops structures (which should
be defined as const as well while at it).
Radoslav Bodó | 1 Oct 2010 07:06
Picon

Re: grsecurity breaks reiser4 compilation

i think i had the similar problem with recent grsec and openafs. spender
creates this patch for me

http://www.grsecurity.com/~spender/openafs_const_address_space_ops.patch

b

P.S: openafs developers says, yeah, but you have to wait, it does not
fit in our new build scripts, but we'll find out someday ;)

pageexec@... napsal(a):
> On 30 Sep 2010 at 17:18, qwe 64 wrote:
> 
>>  Hi, today i tried to compile kernel (2.6.32.23) with reiser4 patch
>>  and latest grsecurity, however i got "assignment to read-only
>>  structure" error.
>>  I found a reason for that.
>>  grsecurity patch modifies file include/linux/fs.h , in particular -
>>  struct super_operations , adding "const"s there.
>>  It causes compilation error in reiser4's reiser4_init_super_data at
>>  init_super.c line 399 when it tries to do sbinfo->ops.super =
>>  reiser4_super_operations .
> 
> the main question to answer is why reiser4 needs to modify this structure
> at runtime in the first place as it is a no-go in vanilla linux as well,
> it's just not enforced at the compiler level (but try to get it past Al
> Viro and you'll see ;). so where's this patch/code exactly and why does
> it do this?
> 

Gmane