Moderator Control Panel ]

v160219 drivers do not compile with CONFIG_PAX_KERNEXEC

It's important to keep your driver and software updated.

v160219 drivers do not compile with CONFIG_PAX_KERNEXEC

Postby fordfrog » Fri Mar 11, 2016 8:58 am

i'm compiling tbs drivers on gentoo linux amd64 arch.

i have installed:
* sys-kernel/hardened-sources-4.4.2
* sys-kernel/linux-headers-4.4

when running make command, i get this error:

# LC_ALL=C make
make -C /usr/src/tbs/linux-tbs-drivers/v4l
make[1]: Entering directory '/usr/src/tbs/linux-tbs-drivers/v4l'
creating symbolic links...
make -C firmware prep
make[2]: Entering directory '/usr/src/tbs/linux-tbs-drivers/v4l/firmware'
make[2]: Leaving directory '/usr/src/tbs/linux-tbs-drivers/v4l/firmware'
make -C firmware
make[2]: Entering directory '/usr/src/tbs/linux-tbs-drivers/v4l/firmware'
make[2]: Nothing to be done for 'default'.
make[2]: Leaving directory '/usr/src/tbs/linux-tbs-drivers/v4l/firmware'
Kernel build directory is /lib/modules/4.4.2-hardened/build
make -C /lib/modules/4.4.2-hardened/build SUBDIRS=/usr/src/tbs/linux-tbs-drivers/v4l modules
make[2]: Entering directory '/usr/src/linux-4.4.2-hardened'
CC [M] /usr/src/tbs/linux-tbs-drivers/v4l/dvbdev.o
/usr/src/tbs/linux-tbs-drivers/v4l/dvbdev.c: In function 'dvb_register_device':
/usr/src/tbs/linux-tbs-drivers/v4l/dvbdev.c:232:9: warning: passing argument 1 of 'memcpy' discards 'const' qualifier from pointer target type
memcpy(dvbdevfops, template->fops, sizeof(struct file_operations));
^
In file included from ./arch/x86/include/asm/string.h:4:0,
from include/linux/string.h:17,
from include/linux/dynamic_debug.h:111,
from include/linux/printk.h:277,
from include/linux/kernel.h:13,
from include/linux/list.h:8,
from include/linux/preempt.h:10,
from include/linux/spinlock.h:50,
from include/linux/seqlock.h:35,
from include/linux/time.h:5,
from include/linux/input.h:11,
from /usr/src/tbs/linux-tbs-drivers/v4l/compat.h:9,
from <command-line>:0:
./arch/x86/include/asm/string_64.h:30:14: note: expected 'void *' but argument is of type 'const struct file_operations *'
extern void *memcpy(void *to, const void *from, size_t len);
^
/usr/src/tbs/linux-tbs-drivers/v4l/dvbdev.c:233:20: error: assignment of member 'owner' in read-only object
dvbdevfops->owner = adap->module;
^
scripts/Makefile.build:258: návod pro cíl „/usr/src/tbs/linux-tbs-drivers/v4l/dvbdev.o“ selhal
make[3]: *** [/usr/src/tbs/linux-tbs-drivers/v4l/dvbdev.o] Chyba 1
Makefile:1399: recipe for target '_module_/usr/src/tbs/linux-tbs-drivers/v4l' failed
make[2]: *** [_module_/usr/src/tbs/linux-tbs-drivers/v4l] Error 2
make[2]: Leaving directory '/usr/src/linux-4.4.2-hardened'
Makefile:51: recipe for target 'default' failed
make[1]: *** [default] Error 2
make[1]: Leaving directory '/usr/src/tbs/linux-tbs-drivers/v4l'
Makefile:26: recipe for target 'all' failed
make: *** [all] Error 2


any idea how to avoid this error?
Last edited by fordfrog on Fri Mar 11, 2016 10:19 am, edited 1 time in total.
fordfrog
 
Posts: 10
Joined: Wed Dec 30, 2015 5:44 pm

Re: Cannot compile tbs-linux-drivers_v160219 with kernel 4.4

Postby fordfrog » Fri Mar 11, 2016 9:44 am

tried kernel 4.3.3 with the same result:

# LC_ALL=C make
make -C /usr/src/tbs/linux-tbs-drivers/v4l
make[1]: Entering directory '/usr/src/tbs/linux-tbs-drivers/v4l'
creating symbolic links...
make -C firmware prep
make[2]: Entering directory '/usr/src/tbs/linux-tbs-drivers/v4l/firmware'
make[2]: Leaving directory '/usr/src/tbs/linux-tbs-drivers/v4l/firmware'
make -C firmware
make[2]: Entering directory '/usr/src/tbs/linux-tbs-drivers/v4l/firmware'
make[2]: Nothing to be done for 'default'.
make[2]: Leaving directory '/usr/src/tbs/linux-tbs-drivers/v4l/firmware'
Kernel build directory is /lib/modules/4.3.3-hardened-r4/build
make -C /lib/modules/4.3.3-hardened-r4/build SUBDIRS=/usr/src/tbs/linux-tbs-drivers/v4l modules
make[2]: Entering directory '/usr/src/linux-4.3.3-hardened-r4'
CC [M] /usr/src/tbs/linux-tbs-drivers/v4l/dvbdev.o
/usr/src/tbs/linux-tbs-drivers/v4l/dvbdev.c: In function 'dvb_register_device':
/usr/src/tbs/linux-tbs-drivers/v4l/dvbdev.c:232:9: warning: passing argument 1 of 'memcpy' discards 'const' qualifier from pointer target type
memcpy(dvbdevfops, template->fops, sizeof(struct file_operations));
^
In file included from ./arch/x86/include/asm/string.h:4:0,
from include/linux/string.h:17,
from include/linux/dynamic_debug.h:111,
from include/linux/printk.h:277,
from include/linux/kernel.h:13,
from include/linux/list.h:8,
from include/linux/preempt.h:10,
from include/linux/spinlock.h:50,
from include/linux/seqlock.h:35,
from include/linux/time.h:5,
from include/linux/input.h:11,
from /usr/src/tbs/linux-tbs-drivers/v4l/compat.h:9,
from <command-line>:0:
./arch/x86/include/asm/string_64.h:30:14: note: expected 'void *' but argument is of type 'const struct file_operations *'
extern void *memcpy(void *to, const void *from, size_t len);
^
/usr/src/tbs/linux-tbs-drivers/v4l/dvbdev.c:233:20: error: assignment of member 'owner' in read-only object
dvbdevfops->owner = adap->module;
^
scripts/Makefile.build:258: návod pro cíl „/usr/src/tbs/linux-tbs-drivers/v4l/dvbdev.o“ selhal
make[3]: *** [/usr/src/tbs/linux-tbs-drivers/v4l/dvbdev.o] Chyba 1
Makefile:1469: recipe for target '_module_/usr/src/tbs/linux-tbs-drivers/v4l' failed
make[2]: *** [_module_/usr/src/tbs/linux-tbs-drivers/v4l] Error 2
make[2]: Leaving directory '/usr/src/linux-4.3.3-hardened-r4'
Makefile:51: recipe for target 'default' failed
make[1]: *** [default] Error 2
make[1]: Leaving directory '/usr/src/tbs/linux-tbs-drivers/v4l'
Makefile:26: recipe for target 'all' failed
make: *** [all] Error 2
fordfrog
 
Posts: 10
Joined: Wed Dec 30, 2015 5:44 pm

Re: v160219 drivers do not compile with CONFIG_PAX_KERNEXEC

Postby fordfrog » Fri Mar 11, 2016 10:20 am

disabling CONFIG_PAX_KERNEXEC in kernel config makes the drivers to compile
fordfrog
 
Posts: 10
Joined: Wed Dec 30, 2015 5:44 pm

Re: v160219 drivers do not compile with CONFIG_PAX_KERNEXEC

Postby SergioDanielG » Fri Mar 11, 2016 11:00 am

Thaks for shareing solution.
In my cases version 20160219 compile without problems, Debian sid with kernel 4.4.2-3

Kind regards.
SergioDanielG
 
Posts: 356
Joined: Tue May 31, 2011 3:53 am
Location: Tostado (SF) Argentina

Re: v160219 drivers do not compile with CONFIG_PAX_KERNEXEC

Postby fordfrog » Fri Mar 11, 2016 4:29 pm

it fails because i use hardened kernel (kernel with security patches) and the code violates "Enforce non-executable kernel pages":

CONFIG_PAX_KERNEXEC:

│ This is the kernel land equivalent of PAGEEXEC and MPROTECT,
│ that is, enabling this option will make it harder to inject
│ and execute 'foreign' code in kernel memory itself.

│ Note that on amd64, CONFIG_EFI enabled with "efi=old_map" on
│ the kernel command-line will result in an RWX physical map.

│ Likewise, the EFI runtime services are necessarily mapped as
│ RWX. If CONFIG_EFI is enabled on an EFI-capable system, it
│ is recommended that you boot with "noefi" on the kernel
│ command-line if possible to eliminate the mapping.
fordfrog
 
Posts: 10
Joined: Wed Dec 30, 2015 5:44 pm


Return to Driver & Software Update

Who is online

Users browsing this forum: No registered users and 3 guests