[[wiki:experiences/igraltist|Back to igraltist's experiences]] ====== Patch for kernel rsbac-pax 2.6.32.11 ===== The follow source have to download and the patches have to apply like the links are. * [[http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.32.11.tar.bz2|linux-kernel]] * [[http://download.rsbac.org/pre/rsbac-1.4.3-2.6.32.11.diff.bz2|rsbac-patch]] * [[http://www.grsecurity.net/~paxguy1/pax-linux-2.6.32.11-test33.patch|pax-patch]] At least apply this patch. diff -u -r rsbac-2.6.32.11/fs/exec.c rsbac-pax-2.6.32.11/fs/exec.c --- rsbac-2.6.32.11/fs/exec.c 2010-04-20 23:13:00.736182773 +0200 +++ rsbac-pax-2.6.32.11/fs/exec.c 2010-04-20 23:01:46.866545785 +0200 @@ -56,6 +56,13 @@ #include #include #include +#include +#include + +#ifdef CONFIG_PAX_REFCOUNT +#include +#include +#endif #include #include @@ -64,6 +71,11 @@ #include +#ifdef CONFIG_PAX_HOOK_ACL_FLAGS +void (*pax_set_initial_flags_func)(struct linux_binprm *bprm); +EXPORT_SYMBOL(pax_set_initial_flags_func); +#endif + int core_uses_pid; char core_pattern[CORENAME_MAX_SIZE] = "core"; unsigned int core_pipe_limit; diff -u -r rsbac-2.6.32.11/fs/pipe.c rsbac-pax-2.6.32.11/fs/pipe.c --- rsbac-2.6.32.11/fs/pipe.c 2010-04-20 23:13:01.507420612 +0200 +++ rsbac-pax-2.6.32.11/fs/pipe.c 2010-04-20 23:03:12.873670404 +0200 @@ -776,10 +776,10 @@ mutex_lock(&inode->i_mutex); pipe = inode->i_pipe; - pipe->readers -= decr; - pipe->writers -= decw; - - if (!pipe->readers && !pipe->writers) { + atomic_sub(decr, &pipe->readers); + atomic_sub(decw, &pipe->writers); + + if (!atomic_read(&pipe->readers) && !atomic_read(&pipe->writers)) { #ifdef CONFIG_RSBAC union rsbac_target_id_t rsbac_target_id; diff -u -r rsbac-2.6.32.11/init/do_mounts.c rsbac-pax-2.6.32.11/init/do_mounts.c --- rsbac-2.6.32.11/init/do_mounts.c 2010-04-20 23:13:03.600420511 +0200 +++ rsbac-pax-2.6.32.11/init/do_mounts.c 2010-04-20 23:05:08.094420553 +0200 @@ -424,8 +424,8 @@ mount_root(); out: devtmpfs_mount("dev"); - sys_mount(".", "/", NULL, MS_MOVE, NULL); - sys_chroot("."); + sys_mount((__force char __user *)".", (__force char __user *)"/", NULL, MS_MOVE, NULL); + sys_chroot((__force char __user *)"."); /* RSBAC: OK, most stuff initialized and root mounted: Init RSBAC. */ #ifdef CONFIG_RSBAC diff -u -r rsbac-2.6.32.11/mm/mprotect.c rsbac-pax-2.6.32.11/mm/mprotect.c --- rsbac-2.6.32.11/mm/mprotect.c 2010-04-20 23:13:05.084420401 +0200 +++ rsbac-pax-2.6.32.11/mm/mprotect.c 2010-04-20 23:06:58.428670265 +0200 @@ -24,10 +24,16 @@ #include #include #include + +#ifdef CONFIG_PAX_MPROTECT +#include +#endif + #include #include #include #include +#include #include #ifndef pgprot_modify