LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (http://www.linuxquestions.org/questions/ubuntu-63/)
-   -   How do I patch my kernel 3.2 with apparmor kernel patches? (http://www.linuxquestions.org/questions/ubuntu-63/how-do-i-patch-my-kernel-3-2-with-apparmor-kernel-patches-4175435101/)

alex123456 11-01-2012 12:28 PM

How do I patch my kernel 3.2 with apparmor kernel patches?
 
Hello,

I have Ubuntu 12.04 with kernel 3.2 (64 bits)

I downloaded armor-2.8.0.tar.gz at https://launchpad.net/apparmor/2.8/2...r-2.8.0.tar.gz

After I untar, I go into apparmor-2.8.0/kernel-patches/3.2/ and there are 3 files:

0001-AppArmor-compatibility-patch-for-v5-network-controll.patch
0002-AppArmor-compatibility-patch-for-v5-interface.patch
0003-AppArmor-Allow-dfa-backward-compatibility-with-broke.patch


I tried:
patch -p1 < 0001-AppArmor-compatibility-patch-for-v5-network-controll.patch

But it then asks me "File to patch: ".

How do I go about this?
Thanks a lot

Noway2 11-01-2012 12:49 PM

I am not sure if this would be best as a continuation of your other thread, or a new one.
First, did you follow the instructions in the README file which discuss using make and build? I am not sure if these are completely applicable to your need, but it would be prudent to give this section a read.

Second, the patch file shows which source file is being patched. For example, the first patch file says that security/apparmor/apparmorfs.c is being modified. Of course you will need the appropriate kernel sources, etc, as well as the instructions on how to build an Ubuntu kernel. The important part will be to sure to get the proper kernel configuration before compiling.

edit: for the networking one, there are multiple files being patched. You will probably need to point it to the parent directory, security/apparmor.

alex123456 11-01-2012 01:33 PM

Hi, Thanks for your response.

I follow all the instructions in the README file but it showed an error message when I tried to build it.

And when I tried to patch the kernel, this is what is displayed:

can't find file to patch at input line 26
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|From 125fccb600288968aa3395883c0a394c47176fcd Mon Sep 17 00:00:00 2001
|From: John Johansen <john.johansen@canonical.com>
|Date: Wed, 10 Aug 2011 22:02:39 -0700
|Subject: [PATCH 1/3] AppArmor: compatibility patch for v5 network controll
|
|Add compatibility for v5 network rules.
|
|Signed-off-by: John Johansen <john.johansen@canonical.com>
|---
| include/linux/lsm_audit.h | 4 +
| security/apparmor/Makefile | 19 +++-
| security/apparmor/include/net.h | 40 +++++++++
| security/apparmor/include/policy.h | 3 +
| security/apparmor/lsm.c | 112 ++++++++++++++++++++++++
| security/apparmor/net.c | 170 ++++++++++++++++++++++++++++++++++++
| security/apparmor/policy.c | 1 +
| security/apparmor/policy_unpack.c | 48 +++++++++-
| 8 files changed, 394 insertions(+), 3 deletions(-)
| create mode 100644 security/apparmor/include/net.h
| create mode 100644 security/apparmor/net.c
|
|diff --git a/include/linux/lsm_audit.h b/include/linux/lsm_audit.h
|index 88e78de..c63979a 100644
|--- a/include/linux/lsm_audit.h
|+++ b/include/linux/lsm_audit.h
--------------------------
File to patch:



I don't know what to do after this the prompt.
If anyone has any suggestion, I'd be happy to hear from you.

unSpawn 11-03-2012 02:12 PM

Quote:

Originally Posted by alex123456 (Post 4819848)
I have Ubuntu 12.04 with kernel 3.2 (64 bits)
I downloaded armor-2.8.0.tar.gz (..) How do I go about this?

Ubuntu 12.10 includes AppArmor 2.8.0. Upgrading your distribution may be the easiest way.


All times are GMT -5. The time now is 12:57 AM.