~ubuntu-branches/ubuntu/wily/apparmor/wily

« back to all changes in this revision

Viewing changes to kernel-patches/for-mainline/link-subset-check-2.diff

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook
  • Date: 2011-04-27 10:38:07 UTC
  • mfrom: (5.1.118 natty)
  • Revision ID: james.westby@ubuntu.com-20110427103807-ym3rhwys6o84ith0
Tags: 2.6.1-2
debian/copyright: clarify for some full organization names.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Index: b/security/apparmor/main.c
2
 
===================================================================
3
 
--- a/security/apparmor/main.c
4
 
+++ b/security/apparmor/main.c
5
 
@@ -120,11 +120,12 @@ static int aa_link_denied(struct aa_prof
6
 
         * Allow to link
7
 
         * - if we have permission to rename, or
8
 
         * - if we are only allowed to link and to read the target,
9
 
-        *   but not to write to the link.
10
 
+        *   but not to write to the link, and also only if the link
11
 
+        *   won't add any form of execute access.
12
 
         */
13
 
        if (((l_mode & MAY_WRITE) &&
14
 
             (t_mode & (MAY_READ | MAY_WRITE) == (MAY_READ | MAY_WRITE))) ||
15
 
-           ((l_mode & (MAY_WRITE | AA_MAY_LINK) == AA_MAY_LINK) &&
16
 
+           ((l_mode & (MAY_WRITE | MAY_EXEC | AA_MAY_LINK) == AA_MAY_LINK) &&
17
 
             (t_mode & MAY_READ)))
18
 
                return 0;
19