[grsec] Kernel Hangs: Highmem and GRSECURITY

Syed Ahemed kingkhan at gmail.com
Fri Sep 8 20:33:25 EDT 2006


Hello ,
In the excerpts 2.1.9 grsecurity patch , kmem_cache_free is called
when kmem_cache_alloc fails (returns 0)   .Isn't this a case of
dereferencing a Null pointer.
The kernel code without the Patch  otherwise is filled with calls to
kmem_cache_alloc that just returns -ENOMEM in case of failure.

Could you please explain the reason ?

+#ifdef CONFIG_GRKERNSEC_PAX_SEGMEXEC
+   if ((current->mm->pax_flags & MF_PAX_SEGMEXEC) && (VM_STACK_FLAGS
& VM_MAYEXEC)) {
+       mpnt_m = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL);
+       if (!mpnt_m) {
+           kmem_cache_free(vm_area_cachep, mpnt);
+           return -ENOMEM;
+       }
+   }
+#endif
+

Regards
Syed Ahemed

On 9/6/06, pageexec at freemail.hu <pageexec at freemail.hu> wrote:
> On 6 Sep 2006 at 3:09, Syed Ahemed wrote:
>
> > Thanks.
> > I can't change/update the linux kernel  due to some inhouse userland
> > application dependency.
> > But i can try out the latest grsec version ,Can you suggest a latest
> > version that will apply cleanly to linux 2.4.28
>
> grsec and PaX support only the latest linux versions, so you can
> either backport it (not an easy exercise) or you're out of luck...
>
>


-- 
Azhar khan

I'm afraid that I've seen too many people fix bugs by looking at
debugger output, and that almost inevitably leads to fixing the
symptoms rather than the underlying problems.
	
--Linus


More information about the grsecurity mailing list