Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Ubuntu This forum is for the discussion of Ubuntu Linux.


  Search this Thread
Old 11-01-2012, 12:28 PM   #1
LQ Newbie
Registered: Jun 2012
Posts: 12

Rep: Reputation: Disabled
How do I patch my kernel 3.2 with apparmor kernel patches?


I have Ubuntu 12.04 with kernel 3.2 (64 bits)

I downloaded armor-2.8.0.tar.gz at

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


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
Old 11-01-2012, 12:49 PM   #2
Senior Member
Registered: Jul 2007
Distribution: Ubuntu 10.10, Slackware 64-current
Posts: 2,124

Rep: Reputation: 779Reputation: 779Reputation: 779Reputation: 779Reputation: 779Reputation: 779Reputation: 779
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.

Last edited by Noway2; 11-01-2012 at 12:51 PM.
Old 11-01-2012, 01:33 PM   #3
LQ Newbie
Registered: Jun 2012
Posts: 12

Original Poster
Rep: Reputation: Disabled
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 <>
|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 <>
| 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.
Old 11-03-2012, 02:12 PM   #4
Registered: May 2001
Posts: 29,370
Blog Entries: 55

Rep: Reputation: 3555Reputation: 3555Reputation: 3555Reputation: 3555Reputation: 3555Reputation: 3555Reputation: 3555Reputation: 3555Reputation: 3555Reputation: 3555Reputation: 3555
Originally Posted by alex123456 View Post
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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux realtime kernel "patch" or "patches". Linux.tar.gz Linux - Kernel 2 01-09-2012 10:54 AM
LXer: OLS: Kernel documentation, and submitting kernel patches LXer Syndicated Linux News 0 07-26-2008 12:40 AM
base Kernel compile - how to patch for apparmor/firewall petersk SUSE / openSUSE 7 03-05-2008 02:06 AM
usefulness of mandriva-patches in kernel, or just new 2.614. kernel from source? Emmanuel_uk Mandriva 6 12-20-2005 08:56 PM
upgraded kernel, won't let me compile kernel once Suspend2 patches are applied microsoft/linux Linux - Laptop and Netbook 3 10-02-2005 02:37 PM > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 12:47 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration