All of lore.kernel.org
 help / color / mirror / Atom feed
* please help me make reiser4 work with grsecurity
@ 2011-11-09 14:53 Piotr Sawuk
  2011-11-09 19:01 ` Edward Shishkin
  0 siblings, 1 reply; 3+ messages in thread
From: Piotr Sawuk @ 2011-11-09 14:53 UTC (permalink / raw)
  To: reiserfs-devel

of course reiser4 wont be able to provide the root fs. there simply is no
xattr support in reiser4. however, reiser4 doesn't even compile with grsecurity.

of course, as with most filesystems which aren't part of the kernel, I
got a .rej while applying reiser4 patch on grsecurity-patched linux-2.6.32.46,
but that was quickly resolved, so I thought. the problem was include/linux/fs.h,
the "struct super_operations" which got modified immensely by grsecurity. so I
add the 2 functions writeback_inodes and sync_inodes inserted there by reiser4.
during compilation another problem got apparent: PF_FLUSHER isn't defined in
include/linux/sched.h, just like in "newer" kernels.

the problem I couldn't solve, as I hint above, has to do with super_operations.
on my HLFS system I did do a 'make CC="gcc -fno-PIE -no-fatal-warnings"' and got

init_super.c: in function 'reiser4_init_super_data':
init_super.c:399:2: error: assignment of read-only member 'ops'
init_super.c:400:2: error: assignment of read-only member 'ops'
init_super.c:401:2: error: assignment of read-only member 'ops'

and I have no idea how to solve this. I don't know c,
I only know c++ and assembler, so I really am without
a clue how const-assignment of objects gets handled in c.
super_operations and others must get assigned to members of ops.
but how? seems grsecurity changed the way how this is supposed to happen.
please fetch linux-2.6.32.46 apply the stable patch on http://grsecurity.net
and then reiser4 for 2.6.32, and explain how grsecurity affected reiser4.

ext2 seems to initialize this struct into static variables, and compiles well.
(is that even thread-save?) does it make sense to copy that behaviour?
I fear I'd break something in reiser4 if I'd do away with ops...

btw, as grsecurity made changes on fs-code maybe reiser4 should get changed too?

P

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: please help me make reiser4 work with grsecurity
  2011-11-09 14:53 please help me make reiser4 work with grsecurity Piotr Sawuk
@ 2011-11-09 19:01 ` Edward Shishkin
  2011-11-20 21:30   ` Piotr Sawuk
  0 siblings, 1 reply; 3+ messages in thread
From: Edward Shishkin @ 2011-11-09 19:01 UTC (permalink / raw)
  To: Piotr Sawuk; +Cc: reiserfs-devel

On 11/09/2011 03:53 PM, Piotr Sawuk wrote:
> of course reiser4 wont be able to provide the root fs. there simply is no
> xattr support in reiser4. however, reiser4 doesn't even compile with
> grsecurity.
>
> of course, as with most filesystems which aren't part of the kernel, I
> got a .rej while applying reiser4 patch on grsecurity-patched
> linux-2.6.32.46,
> but that was quickly resolved, so I thought. the problem was
> include/linux/fs.h,
> the "struct super_operations" which got modified immensely by
> grsecurity. so I
> add the 2 functions writeback_inodes and sync_inodes inserted there by
> reiser4.
> during compilation another problem got apparent: PF_FLUSHER isn't
> defined in
> include/linux/sched.h, just like in "newer" kernels.


Mainline folks got rid of this flag, since nobody uses it.
Feel free to get it back.


>
> the problem I couldn't solve, as I hint above, has to do with
> super_operations.
> on my HLFS system I did do a 'make CC="gcc -fno-PIE -no-fatal-warnings"'
> and got
>
> init_super.c: in function 'reiser4_init_super_data':
> init_super.c:399:2: error: assignment of read-only member 'ops'
> init_super.c:400:2: error: assignment of read-only member 'ops'
> init_super.c:401:2: error: assignment of read-only member 'ops'
>
> and I have no idea how to solve this. I don't know c,
> I only know c++ and assembler, so I really am without
> a clue how const-assignment of objects gets handled in c.
> super_operations and others must get assigned to members of ops.
> but how? seems grsecurity changed the way how this is supposed to happen.
> please fetch linux-2.6.32.46 apply the stable patch on
> http://grsecurity.net
> and then reiser4 for 2.6.32, and explain how grsecurity affected reiser4.


I'll try to take a look at weekends.
If this takes a lot of time, then excuse me..

Thanks,
Edward.



>
> ext2 seems to initialize this struct into static variables, and compiles
> well.
> (is that even thread-save?) does it make sense to copy that behaviour?
> I fear I'd break something in reiser4 if I'd do away with ops...
>
> btw, as grsecurity made changes on fs-code maybe reiser4 should get
> changed too?
>
> P
> --
> To unsubscribe from this list: send the line "unsubscribe
> reiserfs-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: please help me make reiser4 work with grsecurity
  2011-11-09 19:01 ` Edward Shishkin
@ 2011-11-20 21:30   ` Piotr Sawuk
  0 siblings, 0 replies; 3+ messages in thread
From: Piotr Sawuk @ 2011-11-20 21:30 UTC (permalink / raw)
  To: reiserfs-devel

Edward Shishkin wrote:
> On 11/09/2011 03:53 PM, Piotr Sawuk wrote:
>> of course reiser4 wont be able to provide the root fs. there simply is no
>> xattr support in reiser4. however, reiser4 doesn't even compile with
>> grsecurity.
>>
>> of course, as with most filesystems which aren't part of the kernel, I
>> got a .rej while applying reiser4 patch on grsecurity-patched
>> linux-2.6.32.46,
>> but that was quickly resolved, so I thought. the problem was
>> include/linux/fs.h,
>> the "struct super_operations" which got modified immensely by
>> grsecurity. so I
>> add the 2 functions writeback_inodes and sync_inodes inserted there by
>> reiser4.
>> during compilation another problem got apparent: PF_FLUSHER isn't
>> defined in
>> include/linux/sched.h, just like in "newer" kernels.
> 
> 
> Mainline folks got rid of this flag, since nobody uses it.
> Feel free to get it back.
> 
> 
>>
>> the problem I couldn't solve, as I hint above, has to do with
>> super_operations.
>> on my HLFS system I did do a 'make CC="gcc -fno-PIE -no-fatal-warnings"'
>> and got
>>
>> init_super.c: in function 'reiser4_init_super_data':
>> init_super.c:399:2: error: assignment of read-only member 'ops'
>> init_super.c:400:2: error: assignment of read-only member 'ops'
>> init_super.c:401:2: error: assignment of read-only member 'ops'
>>
>> and I have no idea how to solve this. I don't know c,
>> I only know c++ and assembler, so I really am without
>> a clue how const-assignment of objects gets handled in c.
>> super_operations and others must get assigned to members of ops.
>> but how? seems grsecurity changed the way how this is supposed to happen.
>> please fetch linux-2.6.32.46 apply the stable patch on
>> http://grsecurity.net
>> and then reiser4 for 2.6.32, and explain how grsecurity affected reiser4.
> 
> 
> I'll try to take a look at weekends.
> If this takes a lot of time, then excuse me..

obviously it took a lot of time, or he forgot.
sad that noone did help me so I had to solve this the brutal way:
those 3 offending lines of reiser4_init_super_data() I replaced with

> memcpy(&sbinfo->ops.super,&reiser4_super_operations,sizeof(struct super_operations));
> memcpy(&sbinfo->ops.export,&reiser4_export_operations,sizeof(struct export_operations));
> memcpy(&sbinfo->ops.dentry,&reiser4_dentry_operations,sizeof(struct dentry_operations));

which of course produces a warning (both arguments still are const pointer),
but it works. I hope this (along with my hint to revert the removal
of PF_FLUSHER to some earlier kernel) helps people who are capable of manual
patch-merging to get reiser4 running on stable grsecurity, even without
having much programming knowledge. more detailed instructions I'll only
give when someone explains to me what the proper C-way should have been...

P

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-11-20 21:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-09 14:53 please help me make reiser4 work with grsecurity Piotr Sawuk
2011-11-09 19:01 ` Edward Shishkin
2011-11-20 21:30   ` Piotr Sawuk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.