Re: WOLK v4.16s: Grsecurity compile error/bug?

Marc-Christian Petersen <[email protected]> Tue, 26 Oct 2004 21:20:14 +0200
Newsgroups gmane.linux.wolk.devel
Organization Working Overloaded Linux Kernel
Message-ID <200410262120.14195@WOLK>
On Tuesday 26 October 2004 20:55, Carl Hagmueller wrote:

Hi Carl,

> I ran into the following compile error in linux-2.4.20-wolk4.16s, with
> Grsecurity/Pax options enabled. Specifically, CONFIG_PAX_PAGEEXEC=y
> binfmt_elf.c: In function `load_elf_binary':
> binfmt_elf.c:1006: warning: passing arg 2 of `__do_mmap_pgoff' makes
> pointer from integer without a cast
> binfmt_elf.c:1006: too few arguments to function `__do_mmap_pgoff'
> make[2]: *** [binfmt_elf.o] Error 1
> make[2]: Leaving directory
> `/home/chagmuel/devel/RPM/BUILD/wolk-4.16/linux-2.4.20/fs'

erm, even if my mind is sometimes vary bad, I am quite sure I've fixed that in 
some previous wolk versions, didn't I? Lance? You hit that too no? some months 
ago?

hmmm ... funny ;()


> This leads me to believe that the proper call should be as follows:
> #ifdef CONFIG_GRKERNSEC_PAX_PAGEEXEC
>     if (current->flags & PF_PAX_PAGEEXEC)
>         load_addr_random = __do_mmap_pgoff(current->mm, NULL,
> ELF_PAGESTART(load_bias_random + vaddr), 0UL, elf_prot, elf_flags |
> MAP_MIRROR, error);
>                                            ^^^^^^^^^^^
> #endif

you are correct. current->mm is missing to the __do_mmap_pgoff call :)

and _now_ I see, I didn't fix that, I fixed that some time ago for SEGMEXEC 
and RANDEXEC but forgot PAGEEXEC, mostly because PAGEEXEC is a lot of shit 
(as in it really really megareally hurts performance of the whole machine :(

This is an issue of PaX itself. PaX developers already did some improvements 
to that code but unfortunately only for 2.6 (yet), but even there it's still 
a lot of shit as in slow :)

You better disable that config option. Or you might give it a try after you've 
changed that code in binfmt_elf.c (or you want me to send a patch? :)) and 
notice the difference in overall performance of your machine. I'll bet it 
hurts ;)


> I realize this is probably a Grsecurity issue, but I wanted to run it by
> you first, since I'm very fuzzy on the mmap/rmap issues, and I'm not really
> a kernel hacker!  I'm also new to Grsecurity and Pax.  In retrospect, I
> probably don't need this option (that's why the issue has never come up
> before?) but I need to learn more about the various options.  This was a
> first cut following the Grsecurity 'QuickStart Guide'
> Let me know what you think.

this isn't a grsecurity issue, or, well, not by itself but caused by the UML 
(user-mode-linux) SKAS stuff :)

Thanks alot for noticing this and your interest!


Anyway, I'll fix that for 4.17s. If you are interested (so far the changelog)


Changelog from v4.16s -> v4.17s
-------------------------------
o   added:    for whatever fscking reason: netdev-random was missing
o   added:    manual oom killer invocation via sysrq
o   added:    CRC32 library backport (usbnet needs this for example)
o   fixed:    RAID1 error handling locking
o   fixed:    some compiler warnings in fs/proc/kconfig.c
o   fixed:    tmpfs: shmem_file_write return value
o   fixed:    tmpfs: stop negative dentries
o   fixed:    compile error in fs/binfmt_elf.c when PAGEEXEC is used.
o   updated:  Broadcom Tigon3 (tg3) v3.10
o   updated:  SysKonnect SK-98xx v7.08
o   updated:  grsecurity v2.0.2 as an replacement patch you have to apply
                manually to use v2.0.2 instead of v1.9.15. Please use
                gradm2 from ./gradm2 directory and make sure, /dev/grsec
                has minor number 12 instead of 10.
o   updated:  Intel/ICP RAID Controller support v3.04
o   updated:  CryptoAPI (up to 2.4.28-pre4)
o   updated:  Intel Software RAID Driver (iswraid) v0.1.4.3
o   updated:  Intel e1000 v5.4.11-k1

ciao, Marc



-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
WOLK - Working Overloaded Linux Kernel
[email protected]
https://lists.sourceforge.net/lists/listinfo/wolk-devel