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

« back to all changes in this revision

Viewing changes to kernel-patches/2.6.19/patches/apparmor_audit.patch

  • 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
 
From: tonyj@suse.de
2
 
Subject: Export audit subsystem for use by modules
3
 
Patch-mainline: no
4
 
 
5
 
Adds necessary export symbols for audit subsystem routines.
6
 
Changes audit_log_vformat to be externally visible (analagous to vprintf)
7
 
Patch is not in mainline -- pending AppArmor code submission to lkml
8
 
 
9
 
 
10
 
---
11
 
 include/linux/audit.h |    5 +++++
12
 
 kernel/audit.c        |    6 ++++--
13
 
 2 files changed, 9 insertions(+), 2 deletions(-)
14
 
 
15
 
--- linux-2.6.18.orig/include/linux/audit.h
16
 
+++ linux-2.6.18/include/linux/audit.h
17
 
@@ -100,6 +100,8 @@
18
 
 #define AUDIT_LAST_KERN_ANOM_MSG    1799
19
 
 #define AUDIT_ANOM_PROMISCUOUS      1700 /* Device changed promiscuous mode */
20
 
 
21
 
+#define AUDIT_SD               1500    /* AppArmor (SubDomain) audit */
22
 
+
23
 
 #define AUDIT_KERNEL           2000    /* Asynchronous audit record. NOT A REQUEST. */
24
 
 
25
 
 /* Rule flags */
26
 
@@ -466,6 +468,9 @@ extern void             audit_log(struct audit_
27
 
                                      __attribute__((format(printf,4,5)));
28
 
 
29
 
 extern struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask, int type);
30
 
+extern void                audit_log_vformat(struct audit_buffer *ab,
31
 
+                                             const char *fmt, va_list args)
32
 
+                           __attribute__((format(printf,2,0)));
33
 
 extern void                audit_log_format(struct audit_buffer *ab,
34
 
                                             const char *fmt, ...)
35
 
                            __attribute__((format(printf,2,3)));
36
 
--- linux-2.6.18.orig/kernel/audit.c
37
 
+++ linux-2.6.18/kernel/audit.c
38
 
@@ -954,8 +954,7 @@ static inline int audit_expand(struct au
39
 
  * will be called a second time.  Currently, we assume that a printk
40
 
  * can't format message larger than 1024 bytes, so we don't either.
41
 
  */
42
 
-static void audit_log_vformat(struct audit_buffer *ab, const char *fmt,
43
 
-                             va_list args)
44
 
+void audit_log_vformat(struct audit_buffer *ab, const char *fmt, va_list args)
45
 
 {
46
 
        int len, avail;
47
 
        struct sk_buff *skb;
48
 
@@ -1211,3 +1210,6 @@ EXPORT_SYMBOL(audit_log_start);
49
 
 EXPORT_SYMBOL(audit_log_end);
50
 
 EXPORT_SYMBOL(audit_log_format);
51
 
 EXPORT_SYMBOL(audit_log);
52
 
+EXPORT_SYMBOL_GPL(audit_log_vformat);
53
 
+EXPORT_SYMBOL_GPL(audit_log_untrustedstring);
54
 
+EXPORT_SYMBOL_GPL(audit_log_d_path);