Patching CentOS' Kernel

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

Patching CentOS' Kernel

Postby Daytona » Fri Feb 13, 2015 2:12 am

Hello, I am trying to patch the CentOS Linux kernel "kernel-3.10.0-123.20.1.el7" with https://grsecurity.net/stable/grsecurit ... 2101.patch

I ended up with a file not found error and it's asking for which file to patch. I'm assuming this is a conflict. Do I need to modify the grsec patch file to remove conflicts, or do I have to take the default Linux kernel and work on that one?

Any help is appreciated, thanks.

End of output from patch:

Code: Select all
patching file arch/arm/mach-omap2/omap_hwmod.c
can't find file to patch at input line 3708
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/arch/arm/mach-omap2/powerdomains43xx_data.c b/arch/arm/mach-omap2/powerdomains43xx_data.c
|index 95fee54..cfa9cf1 100644
|--- a/arch/arm/mach-omap2/powerdomains43xx_data.c
|+++ b/arch/arm/mach-omap2/powerdomains43xx_data.c
--------------------------
File to patch:


Commands used to build and patch the CentOS 7 kernel:

# as root #
Code: Select all
yum install rpm-build redhat-rpm-config asciidoc hmaccalc perl-ExtUtils-Embed pesign xmlto \
audit-libs-devel binutils-devel elfutils-devel elfutils-libelf-devel \
newt-devel numactl-devel pciutils-devel python-devel zlib-devel net-tools bc bison
useradd user
su user

# now running as user #
Code: Select all
mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
echo '%_topdir %(echo $HOME)/rpmbuild' > ~/.rpmmacros
rpm -i http://vault.centos.org/7.0.1406/updates/Source/SPackages/kernel-3.10.0-123.20.1.el7.src.rpm 2>&1 | grep -v exist
cd ~/rpmbuild/SPECS
rpmbuild -bp --target=$(uname -m) kernel.spec
cd ~/rpmbuild/BUILD/kernel-3.10.0-123.20.1.el7
wget https://grsecurity.net/stable/grsecurity-3.0-3.14.32-201502062101.patch
cd ~/rpmbuild/BUILD/kernel-3.10.0-123.20.1.el7/linux-3.10.0-123.20.1.el7.x86_64
patch -p1 < ../grsecurity-3.0-3.14.32-201502062101.patch
Daytona
 
Posts: 1
Joined: Thu Feb 12, 2015 2:25 pm

Re: Patching CentOS' Kernel

Postby coredumb » Thu Feb 19, 2015 11:52 am

This just can't work. This patch version is to be used with 3.14.32 vanilla kernel sources from kernel.org not older 3.10 kernel modified by RedHat .
coredumb
 
Posts: 14
Joined: Mon Aug 25, 2014 10:11 am


Return to grsecurity support