mmx.c fails to compile (2.6.20.4/test)

Discuss usability issues, general maintenance, and general support issues for a grsecurity-enabled system.

mmx.c fails to compile (2.6.20.4/test)

Postby bjorn » Tue Mar 27, 2007 11:42 am

Hi, I'm new here.
I just sat down to make a new kernel for my home gw, and thought i'd give 2.6.20.4 and the testing grsec patches a shot. I guess it failed.
what made me spit out my coffee is this:
Code: Select all
CC      arch/i386/lib/mmx.o
arch/i386/lib/mmx.c: In function '_mmx_memcpy':
arch/i386/lib/mmx.c:75: error: 'cr0' undeclared (first use in this function)
arch/i386/lib/mmx.c:75: error: (Each undeclared identifier is reported only once
arch/i386/lib/mmx.c:75: error: for each function it appears in.)
arch/i386/lib/mmx.c:46: error: invalid lvalue in asm output 0
arch/i386/lib/mmx.c:80: error: invalid lvalue in asm output 0
arch/i386/lib/mmx.c: In function 'fast_copy_page':
arch/i386/lib/mmx.c:238: error: 'cr0' undeclared (first use in this function)
arch/i386/lib/mmx.c:209: error: invalid lvalue in asm output 0
arch/i386/lib/mmx.c:242: error: invalid lvalue in asm output 0
make[1]: *** [arch/i386/lib/mmx.o] Error 1
make: *** [arch/i386/lib] Error 2


I don't know ASM, i do a little bit of C, but the deepness of the C code here is more than i can handle so i wasn't able to find/solve the problem myself.
I know it's just testing versions and all, but i was just wondering if there is a quick solution to it.. if not i'll simply go back to .19.2 for now. :)

And, do i really need the patched mmx.c? or can i just remove the mmx.c part of the patch and use the vanilla one? would that work?

CPU: 1.2GHz Athlon
GCC version: 4.1.2
Dist: archlinux

anyway thanks :]
bjorn
 
Posts: 1
Joined: Tue Mar 27, 2007 11:22 am

Re: mmx.c fails to compile (2.6.20.4/test)

Postby PaX Team » Tue Mar 27, 2007 5:54 pm

bjorn wrote:
Code: Select all
CC      arch/i386/lib/mmx.o
arch/i386/lib/mmx.c: In function '_mmx_memcpy':
arch/i386/lib/mmx.c:75: error: 'cr0' undeclared (first use in this function)
arch/i386/lib/mmx.c:75: error: (Each undeclared identifier is reported only once
arch/i386/lib/mmx.c:75: error: for each function it appears in.)
arch/i386/lib/mmx.c:46: error: invalid lvalue in asm output 0
arch/i386/lib/mmx.c:80: error: invalid lvalue in asm output 0
arch/i386/lib/mmx.c: In function 'fast_copy_page':
arch/i386/lib/mmx.c:238: error: 'cr0' undeclared (first use in this function)
arch/i386/lib/mmx.c:209: error: invalid lvalue in asm output 0
arch/i386/lib/mmx.c:242: error: invalid lvalue in asm output 0
make[1]: *** [arch/i386/lib/mmx.o] Error 1
make: *** [arch/i386/lib] Error 2
try -test11 from the PaX test directory, it should be fixed. alternatively you can enable KERNEXEC :-).
I don't know ASM, i do a little bit of C, but the deepness of the C code here is more than i can handle so i wasn't able to find/solve the problem myself.
the very first error message gives you a big hint: cr0 is not declared and if you look at the code you'll see that it's in an ifdef/endif block, whereas one of its uses isn't -> the compiler will complain if the ifdef is skipped, which i guess is your case as you probably didn't enable KERNEXEC.
And, do i really need the patched mmx.c? or can i just remove the mmx.c part of the patch and use the vanilla one? would that work?
if you don't use KERNEXEC then you don't need to patch it either, but the latest PaX patch should fix it anyway.
PaX Team
 
Posts: 2310
Joined: Mon Mar 18, 2002 4:35 pm

Postby forsaken » Wed Mar 28, 2007 3:19 am

Which option is PAX_KERNEXEC ? I'm not seeing it.
forsaken
 
Posts: 74
Joined: Tue May 18, 2004 3:04 am

Postby PaX Team » Wed Mar 28, 2007 4:36 am

forsaken wrote:Which option is PAX_KERNEXEC ? I'm not seeing it.
first, it's for i386 only, second, even there it has a few dependencies, in menuconfig you can hit '/' then enter the option name and you'll see where it is and what it depends on.
PaX Team
 
Posts: 2310
Joined: Mon Mar 18, 2002 4:35 pm

Postby forsaken » Wed Mar 28, 2007 5:49 am

PaX Team wrote:
forsaken wrote:Which option is PAX_KERNEXEC ? I'm not seeing it.
first, it's for i386 only, second, even there it has a few dependencies, in menuconfig you can hit '/' then enter the option name and you'll see where it is and what it depends on.


I seem to fulfill all these:

PAX && PAX_NOEXEC && X86_32 && !HOTPLUG_PCI_COMPAQ_NVRAM && !PCI_BIOS && !EFI && !COMPAT_VDSO && X86_WP_WORKS_OK

But I'm still not seeing any kernexec under "Non-executable pages" only "Enforce non-executable pages".
forsaken
 
Posts: 74
Joined: Tue May 18, 2004 3:04 am

Postby amdfanatyk » Wed Mar 28, 2007 12:42 pm

for me it's just broken grsec patch
amdfanatyk
 
Posts: 50
Joined: Tue Oct 18, 2005 3:52 pm

Postby PaX Team » Wed Mar 28, 2007 4:55 pm

forsaken wrote:I seem to fulfill all these:

PAX && PAX_NOEXEC && X86_32 && !HOTPLUG_PCI_COMPAQ_NVRAM && !PCI_BIOS && !EFI && !COMPAT_VDSO && X86_WP_WORKS_OK

But I'm still not seeing any kernexec under "Non-executable pages" only "Enforce non-executable pages".
does this also happen with the PaX patch alone?
PaX Team
 
Posts: 2310
Joined: Mon Mar 18, 2002 4:35 pm

Postby forsaken » Thu Mar 29, 2007 7:58 am

PaX Team wrote:
forsaken wrote:I seem to fulfill all these:

PAX && PAX_NOEXEC && X86_32 && !HOTPLUG_PCI_COMPAQ_NVRAM && !PCI_BIOS && !EFI && !COMPAT_VDSO && X86_WP_WORKS_OK

But I'm still not seeing any kernexec under "Non-executable pages" only "Enforce non-executable pages".
does this also happen with the PaX patch alone?


Yes it does, you can get my config at: *poof gone*
Last edited by forsaken on Fri Mar 30, 2007 12:28 am, edited 1 time in total.
forsaken
 
Posts: 74
Joined: Tue May 18, 2004 3:04 am

Postby PaX Team » Thu Mar 29, 2007 4:03 pm

forsaken wrote:
PaX Team wrote:
forsaken wrote:I seem to fulfill all these:

PAX && PAX_NOEXEC && X86_32 && !HOTPLUG_PCI_COMPAQ_NVRAM && !PCI_BIOS && !EFI && !COMPAT_VDSO && X86_WP_WORKS_OK

But I'm still not seeing any kernexec under "Non-executable pages" only "Enforce non-executable pages".
does this also happen with the PaX patch alone?
Yes it does, you can get my config at: https://www.forsaken.se/paxteam
how about CONFIG_COMPAT_VDSO=y?
PaX Team
 
Posts: 2310
Joined: Mon Mar 18, 2002 4:35 pm

Postby forsaken » Fri Mar 30, 2007 12:27 am

Oops, I must have misspelled VDSO when i grepped for it in the config.
Thanks for the help.
forsaken
 
Posts: 74
Joined: Tue May 18, 2004 3:04 am


Return to grsecurity support