Page 1 of 1
CONFIG_PAX_MEMORY_UDEREF breaks i915 driver
Posted:
Mon Nov 01, 2010 12:10 pm
by ThinkRob
Hi,
I'm trying to build a hardened kernel for a system of mine, and it
appears that CONFIG_PAX_MEMORY_UDEREF breaks the i915 driver. When
I enable the option, the system boots fine, but upon initialization of
X/gdm, I begin to get corruption and artifacting.
A quick check of dmesg output shows the driver reporting that it has
become wedged/hung -- which certainly makes sense, given the output.
Building the exact same kernel config without CONFIG_PAX_MEMORY_UDEREF
causes the problem to disappear.
Any help debugging this is welcome.
Thanks,
Rob
Re: CONFIG_PAX_MEMORY_UDEREF breaks i915 driver
Posted:
Tue Nov 02, 2010 6:39 pm
by ThinkRob
Just to follow-up, the problem persists 2.6.32.25 and the latest grsecurity patch.
Here's the kernel config from one of my unaffected builds. (The only difference between this and the faulty kernels is CONFIG_PAX_MEMORY_UDEREF.)
Thanks.
Re: CONFIG_PAX_MEMORY_UDEREF breaks i915 driver
Posted:
Tue Nov 02, 2010 8:29 pm
by spender
Do you have any OOPs messages in dmesg? If it's directly accessing userland memory, that should be reported and is something we can fix.
-Brad
Re: CONFIG_PAX_MEMORY_UDEREF breaks i915 driver
Posted:
Thu Nov 04, 2010 3:14 pm
by ThinkRob
I don't believe I saw any OOPSs.
I've just built myself a new package from .32.25 without CONFIG_PAX_MEMORY_UDEREF and have been running that with no issues -- but I can try to build one with the feature enabled and boot it tonight just to double check.
Other than looking for OOPS messages, is there anything else you'd like me to do when I boot the broken config?
Thanks,
Rob
Re: CONFIG_PAX_MEMORY_UDEREF breaks i915 driver
Posted:
Sat Nov 06, 2010 7:08 am
by PaX Team
ThinkRob wrote:Other than looking for OOPS messages, is there anything else you'd like me to do when I boot the broken config?
if there's no oops then it'll be a bit tricky to find out the offending userland access. for our purposes the kernel can make two kinds of memory accesses: one which is meant to access userland (and can potentially cause all kinds of CPU exceptions since the userland address is untrusted) and the rest which is not supposed to access userland at all. UDEREF protects both kinds (on i386), the latter being the easy case where you see an oops if it triggers. now the first kind is trickier because the kernel does expect such accesses to potentially fail and has a mechanism (the extable) to handle those failures, normally that means that the function that makes the bad userland access attempt will return some error code (-EFAULT) instead of success (e.g., number of bytes copied). and then it's up to the call chain higher up to do something with the error, but usually there's no report about them. the problem is how to separate the UDEREF faults from the rest. for an experiment you could add a
dump_stack() call into arch/x86/kernel/traps.c:do_general_protection() right after the
gp_in_kernel label, just before the call to fixup_exception() and see if you get any reports from that when the i915 driver fails.
Re: CONFIG_PAX_MEMORY_UDEREF breaks i915 driver
Posted:
Sat Nov 06, 2010 1:57 pm
by ThinkRob
for an experiment you could add a dump_stack() call into arch/x86/kernel/traps.c:do_general_protection() right after the gp_in_kernel label, just before the call to fixup_exception() and see if you get any reports from that when the i915 driver fails.
Alright. I should have some time to build a new image later this weekend, so I'll compile a couple of testing kernels and see what I can do.
Re: CONFIG_PAX_MEMORY_UDEREF breaks i915 driver
Posted:
Mon Jan 10, 2011 6:35 pm
by spender
Any updates on this? The current patch works fine with UDEREF and i915 for me.
-Brad
Re: CONFIG_PAX_MEMORY_UDEREF breaks i915 driver
Posted:
Mon Jan 10, 2011 6:54 pm
by ThinkRob
I can try again somtime this week. Should I try the 2.6.32.* series patch or the latest testing?
Cheers,
Rob
Re: CONFIG_PAX_MEMORY_UDEREF breaks i915 driver
Posted:
Mon Jan 10, 2011 7:54 pm
by spender
I had tested 2.6.32, but either should work.
-Brad
Re: CONFIG_PAX_MEMORY_UDEREF breaks i915 driver
Posted:
Tue Jan 11, 2011 9:53 pm
by ThinkRob
Is there a patch for the latest stable kernel (2.6.32.28)?
Re: CONFIG_PAX_MEMORY_UDEREF breaks i915 driver
Posted:
Tue Jan 11, 2011 10:03 pm
by spender
Not yet, I'm working on fixing some other issues before I port forward and release new patches.
-Brad
Re: CONFIG_PAX_MEMORY_UDEREF breaks i915 driver
Posted:
Tue Jan 11, 2011 10:23 pm
by ThinkRob
Ok, no worries. I'll give it a shot as soon as the patch is posted.
Re: CONFIG_PAX_MEMORY_UDEREF breaks i915 driver
Posted:
Sun Jan 16, 2011 2:25 am
by ThinkRob
I can confirm that 2.6.36.3 patched with grsecurity-2.2.1-2.6.36.3-201101131705.patch does not exhibit this problem.
Do you want me to test with 2.6.32.28 as well?
Thanks,
Rob