Page 1 of 1

issue with 3.2.60 and P4/old xeon arch

PostPosted: Fri Jun 13, 2014 1:38 am
by klimo
Hi,

there is a bug in latest 3.2 grsec patch. It won't compile kernel with this error:
CC fs/aio.o
fs/aio.c: Assembler messages:
fs/aio.c:1718: Error: operand type mismatch for `add'
make[1]: *** [fs/aio.o] Error 1
make: *** [fs] Error 2

This error appears with P4/Old xeon processor archtecture selected. Selecting new xeon and kernel compiles with same config without error.

gcc version 4.7.3 (Gentoo Hardened 4.7.3-r1 p1.3, pie-0.5.5)

I first noticed this compile error in hardened-sources-3.2.59-r5

Re: issue with 3.2.60 and P4/old xeon arch

PostPosted: Fri Jun 13, 2014 6:18 am
by PaX Team
can you post aio.i and aio.s produced by make fs/aio.i ; make fs/aio.s?

Re: issue with 3.2.60 and P4/old xeon arch

PostPosted: Sat Jun 14, 2014 7:49 am
by klimo
both requested files can be found in archive located at https://www.klimo.sk/~klimo/grsec.tgz

Re: issue with 3.2.60 and P4/old xeon arch

PostPosted: Sat Jun 14, 2014 9:49 am
by PaX Team
thanks, it's actually a bug in vanilla linux too (wrong asm constraint somewhere) that triggers in PaX and with march=nocona for some reason. i'll fix it in the next patch, you can apply this in the meantime:
Code: Select all
--- linux-3.2.60-pax/arch/x86/include/asm/uaccess.h     2014-06-02 19:01:44.774236502 +0200
+++ linux-3.2.60-pax/arch/x86/include/asm/uaccess.h     2014-06-14 15:40:54.028938748 +0200
@@ -58,7 +58,7 @@
        __chk_user_ptr(addr);                                           \
        asm("add %3,%1 ; sbb %0,%0 ; cmp %1,%4 ; sbb $0,%0"             \
            : "=&r" (flag), "=r" (roksum)                               \
-           : "1" (addr), "g" ((long)(size)),                           \
+           : "1" (addr), "rm" ((long)(size)),                          \
              "rm" (current_thread_info()->addr_limit.seg));            \
        flag;                                                           \
 })