View Full Version : [ubuntu] Error when trying to patch grsec

May 28th, 2008, 09:40 PM
I am trying to patch grsec to the linux kernel

I downloaded the latest kernel ( with the latest grsecurity patch (2.1.11- and when I enter the command:

patch -p0 <./grsecurity-2.1.11-

I get this error message:

root@prime:/home# patch -p0 < ./grsecurity-2.1.11-
can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
|diff -urNp linux- linux-
|--- linux- 2008-02-24 15:38:03.000000000 -0500
|+++ linux- 2008-03-11 14:12:45.000000000 -0400
File to patch:

What do I do?

May 28th, 2008, 11:11 PM
Please, I need some help.

May 29th, 2008, 10:53 AM
You have downloaded the wrong patch. The patch you have is for Linux, but you have

Download the latest grsecurity patch from here:


Then patch it with this command:

patch -p0 < grsecurity-2.1.12-

Remember you need to have unzipped the kernel source code, and have the patch in the parent directory. For example, if you unzip the kernel to your home directory, you'll have a directory called "/home/<username>/linux-". In this case you'll need to put the patch into "/home/<username>/".

Also, the GRsecurity documentation is worse than useless. Take a look at http://www.tuxmachines.org/node/8676 -- this is much more helpful.