How to turn off stack protector in linux kernel easily?

user126623

I wrote a simple module for the Linux Kernel and it has a stack buffer overflow vulnerability. I want to exploit the module, but I have to turn off the stack protector in the kernel first. How could I do this quickly and simply?

Is it required to compile the kernel every time?

Is there any other way to turn off stack protection in a module of the Linux Kernel (without compiling the kernel)?

WorBlux

Those options work by passing options to the compiler, so the most straightforward way is to recompile the kernel.

However for a reproducible and module-specific way kbuild allows you to set custom CFLAGs on a per-module basis.

https://www.kernel.org/doc/Documentation/kbuild/makefiles.txt

You particularly want to set -fno-stack-protector for the modules you want to exploit.

DKMS additionally allows you to set up automatic rebuild for out of tree drivers against arbitrary kernel versions.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related