~ubuntu-branches/ubuntu/feisty/apparmor/feisty

« back to all changes in this revision

Viewing changes to kernel-patches/for-mainline/apparmor-audit.diff

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook
  • Date: 2007-03-23 16:42:01 UTC
  • Revision ID: james.westby@ubuntu.com-20070323164201-jkax6f0oku087b7l
Tags: upstream-2.0.1+510.dfsg
ImportĀ upstreamĀ versionĀ 2.0.1+510.dfsg

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
Index: b/include/linux/audit.h
 
16
===================================================================
 
17
--- a/include/linux/audit.h
 
18
+++ b/include/linux/audit.h
 
19
@@ -110,6 +110,8 @@
 
20
 #define AUDIT_LAST_KERN_ANOM_MSG    1799
 
21
 #define AUDIT_ANOM_PROMISCUOUS      1700 /* Device changed promiscuous mode */
 
22
 
 
23
+#define AUDIT_APPARMOR         1500    /* AppArmor audit */
 
24
+
 
25
 #define AUDIT_KERNEL           2000    /* Asynchronous audit record. NOT A REQUEST. */
 
26
 
 
27
 /* Rule flags */
 
28
@@ -478,6 +480,9 @@ extern void             audit_log(struct audit_
 
29
                                      __attribute__((format(printf,4,5)));
 
30
 
 
31
 extern struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask, int type);
 
32
+extern void                audit_log_vformat(struct audit_buffer *ab,
 
33
+                                             const char *fmt, va_list args)
 
34
+                           __attribute__((format(printf,2,0)));
 
35
 extern void                audit_log_format(struct audit_buffer *ab,
 
36
                                             const char *fmt, ...)
 
37
                            __attribute__((format(printf,2,3)));
 
38
Index: b/kernel/audit.c
 
39
===================================================================
 
40
--- a/kernel/audit.c
 
41
+++ b/kernel/audit.c
 
42
@@ -956,8 +956,7 @@ static inline int audit_expand(struct au
 
43
  * will be called a second time.  Currently, we assume that a printk
 
44
  * can't format message larger than 1024 bytes, so we don't either.
 
45
  */
 
46
-static void audit_log_vformat(struct audit_buffer *ab, const char *fmt,
 
47
-                             va_list args)
 
48
+void audit_log_vformat(struct audit_buffer *ab, const char *fmt, va_list args)
 
49
 {
 
50
        int len, avail;
 
51
        struct sk_buff *skb;
 
52
@@ -1213,3 +1212,6 @@ EXPORT_SYMBOL(audit_log_start);
 
53
 EXPORT_SYMBOL(audit_log_end);
 
54
 EXPORT_SYMBOL(audit_log_format);
 
55
 EXPORT_SYMBOL(audit_log);
 
56
+EXPORT_SYMBOL_GPL(audit_log_vformat);
 
57
+EXPORT_SYMBOL_GPL(audit_log_untrustedstring);
 
58
+EXPORT_SYMBOL_GPL(audit_log_d_path);