mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-05 17:01:00 +01:00
58 lines
2.1 KiB
Diff
58 lines
2.1 KiB
Diff
From: tonyj@suse.de
|
|
Subject: Export audit subsystem for use by modules
|
|
Patch-mainline: no
|
|
|
|
Adds necessary export symbols for audit subsystem routines.
|
|
Changes audit_log_vformat to be externally visible (analagous to vprintf)
|
|
Patch is not in mainline -- pending AppArmor code submission to lkml
|
|
|
|
|
|
---
|
|
include/linux/audit.h | 5 +++++
|
|
kernel/audit.c | 6 ++++--
|
|
2 files changed, 9 insertions(+), 2 deletions(-)
|
|
|
|
Index: b/include/linux/audit.h
|
|
===================================================================
|
|
--- a/include/linux/audit.h
|
|
+++ b/include/linux/audit.h
|
|
@@ -110,6 +110,8 @@
|
|
#define AUDIT_LAST_KERN_ANOM_MSG 1799
|
|
#define AUDIT_ANOM_PROMISCUOUS 1700 /* Device changed promiscuous mode */
|
|
|
|
+#define AUDIT_APPARMOR 1500 /* AppArmor audit */
|
|
+
|
|
#define AUDIT_KERNEL 2000 /* Asynchronous audit record. NOT A REQUEST. */
|
|
|
|
/* Rule flags */
|
|
@@ -478,6 +480,9 @@ extern void audit_log(struct audit_
|
|
__attribute__((format(printf,4,5)));
|
|
|
|
extern struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask, int type);
|
|
+extern void audit_log_vformat(struct audit_buffer *ab,
|
|
+ const char *fmt, va_list args)
|
|
+ __attribute__((format(printf,2,0)));
|
|
extern void audit_log_format(struct audit_buffer *ab,
|
|
const char *fmt, ...)
|
|
__attribute__((format(printf,2,3)));
|
|
Index: b/kernel/audit.c
|
|
===================================================================
|
|
--- a/kernel/audit.c
|
|
+++ b/kernel/audit.c
|
|
@@ -956,8 +956,7 @@ static inline int audit_expand(struct au
|
|
* will be called a second time. Currently, we assume that a printk
|
|
* can't format message larger than 1024 bytes, so we don't either.
|
|
*/
|
|
-static void audit_log_vformat(struct audit_buffer *ab, const char *fmt,
|
|
- va_list args)
|
|
+void audit_log_vformat(struct audit_buffer *ab, const char *fmt, va_list args)
|
|
{
|
|
int len, avail;
|
|
struct sk_buff *skb;
|
|
@@ -1213,3 +1212,6 @@ EXPORT_SYMBOL(audit_log_start);
|
|
EXPORT_SYMBOL(audit_log_end);
|
|
EXPORT_SYMBOL(audit_log_format);
|
|
EXPORT_SYMBOL(audit_log);
|
|
+EXPORT_SYMBOL_GPL(audit_log_vformat);
|
|
+EXPORT_SYMBOL_GPL(audit_log_untrustedstring);
|
|
+EXPORT_SYMBOL_GPL(audit_log_d_path);
|