The audit subsystem currently has 5 files in kernel/ and soon to be 6.
Simply move them into an easily organized subdir for cleanup and move the
audit Kconfig from init/Kconfig into kernel/audit/Kconfig to make it easier to
maintain.
Signed-off-by: Eric Paris <eparis(a)redhat.com>
---
MAINTAINERS | 2
init/Kconfig | 24
kernel/Makefile | 4
kernel/audit.c | 1521 ---------------------------
kernel/audit.h | 158 ---
kernel/audit/Kconfig | 23
kernel/audit/Makefile | 7
kernel/audit/audit.c | 1521 +++++++++++++++++++++++++++
kernel/audit/audit.h | 158 +++
kernel/audit/audit_tree.c | 942 ++++++++++++++++
kernel/audit/audit_watch.c | 574 ++++++++++
kernel/audit/auditfilter.c | 1366 ++++++++++++++++++++++++
kernel/audit/auditsc.c | 2522 ++++++++++++++++++++++++++++++++++++++++++++
kernel/audit_tree.c | 942 ----------------
kernel/audit_watch.c | 574 ----------
kernel/auditfilter.c | 1366 ------------------------
kernel/auditsc.c | 2522 --------------------------------------------
kernel/signal.c | 2
18 files changed, 7117 insertions(+), 7111 deletions(-)
delete mode 100644 kernel/audit.c
delete mode 100644 kernel/audit.h
create mode 100644 kernel/audit/Kconfig
create mode 100644 kernel/audit/Makefile
create mode 100644 kernel/audit/audit.c
create mode 100644 kernel/audit/audit.h
create mode 100644 kernel/audit/audit_tree.c
create mode 100644 kernel/audit/audit_watch.c
create mode 100644 kernel/audit/auditfilter.c
create mode 100644 kernel/audit/auditsc.c
delete mode 100644 kernel/audit_tree.c
delete mode 100644 kernel/audit_watch.c
delete mode 100644 kernel/auditfilter.c
delete mode 100644 kernel/auditsc.c
diff --git a/MAINTAINERS b/MAINTAINERS
index e8b08f2..5184232 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1058,7 +1058,7 @@ W:
http://people.redhat.com/sgrubb/audit/
T: git
git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit-current.git
S: Maintained
F: include/linux/audit.h
-F: kernel/audit*
+F: kernel/audit/
AUXILIARY DISPLAY DRIVERS
P: Miguel Ojeda Sandonis
diff --git a/init/Kconfig b/init/Kconfig
index 371619b..eae9df5 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -281,29 +281,7 @@ config TASK_IO_ACCOUNTING
Say N if unsure.
-config AUDIT
- bool "Auditing support"
- depends on NET
- help
- Enable auditing infrastructure that can be used with another
- kernel subsystem, such as SELinux (which requires this for
- logging of avc messages output). Does not do system-call
- auditing without CONFIG_AUDITSYSCALL.
-
-config AUDITSYSCALL
- bool "Enable system-call auditing support"
- depends on AUDIT && (X86 || PPC || PPC64 || S390 || IA64 || UML || SPARC64||
SUPERH)
- default y if SECURITY_SELINUX
- help
- Enable low-overhead system-call auditing infrastructure that
- can be used independently or with another kernel subsystem,
- such as SELinux. To use audit's filesystem watch feature, please
- ensure that INOTIFY is configured.
-
-config AUDIT_TREE
- def_bool y
- depends on AUDITSYSCALL
- select FSNOTIFY
+source "kernel/audit/Kconfig"
menu "RCU Subsystem"
diff --git a/kernel/Makefile b/kernel/Makefile
index e5122f5..3ef28c0 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -68,9 +68,7 @@ obj-$(CONFIG_IKCONFIG) += configs.o
obj-$(CONFIG_RESOURCE_COUNTERS) += res_counter.o
obj-$(CONFIG_STOP_MACHINE) += stop_machine.o
obj-$(CONFIG_KPROBES_SANITY_TEST) += test_kprobes.o
-obj-$(CONFIG_AUDIT) += audit.o auditfilter.o
-obj-$(CONFIG_AUDITSYSCALL) += auditsc.o audit_watch.o
-obj-$(CONFIG_AUDIT_TREE) += audit_tree.o
+obj-y += audit/
obj-$(CONFIG_KPROBES) += kprobes.o
obj-$(CONFIG_KGDB) += kgdb.o
obj-$(CONFIG_DETECT_SOFTLOCKUP) += softlockup.o
diff --git a/kernel/audit/Kconfig b/kernel/audit/Kconfig
new file mode 100644
index 0000000..4f2d357
--- /dev/null
+++ b/kernel/audit/Kconfig
@@ -0,0 +1,23 @@
+config AUDIT
+ bool "Auditing support"
+ depends on NET
+ help
+ Enable auditing infrastructure that can be used with another
+ kernel subsystem, such as SELinux (which requires this for
+ logging of avc messages output). Does not do system-call
+ auditing without CONFIG_AUDITSYSCALL.
+
+config AUDITSYSCALL
+ bool "Enable system-call auditing support"
+ depends on AUDIT && (X86 || PPC || PPC64 || S390 || IA64 || UML || SPARC64||
SUPERH)
+ default y if SECURITY_SELINUX
+ help
+ Enable low-overhead system-call auditing infrastructure that
+ can be used independently or with another kernel subsystem,
+ such as SELinux. To use audit's filesystem watch feature, please
+ ensure that FSNOTIFY is configured.
+
+config AUDIT_TREE
+ def_bool y
+ depends on AUDITSYSCALL
+ select FSNOTIFY
diff --git a/kernel/audit/Makefile b/kernel/audit/Makefile
new file mode 100644
index 0000000..7752c2c
--- /dev/null
+++ b/kernel/audit/Makefile
@@ -0,0 +1,7 @@
+#
+# Makefile for audit
+#
+
+obj-$(CONFIG_AUDIT) += audit.o auditfilter.o
+obj-$(CONFIG_AUDITSYSCALL) += auditsc.o audit_watch.o
+obj-$(CONFIG_AUDIT_TREE) += audit_tree.o
diff --git a/kernel/audit.c b/kernel/audit/audit.c
similarity index 100%
rename from kernel/audit.c
rename to kernel/audit/audit.c
diff --git a/kernel/audit.h b/kernel/audit/audit.h
similarity index 100%
rename from kernel/audit.h
rename to kernel/audit/audit.h
diff --git a/kernel/audit_tree.c b/kernel/audit/audit_tree.c
similarity index 100%
rename from kernel/audit_tree.c
rename to kernel/audit/audit_tree.c
diff --git a/kernel/audit_watch.c b/kernel/audit/audit_watch.c
similarity index 100%
rename from kernel/audit_watch.c
rename to kernel/audit/audit_watch.c
diff --git a/kernel/auditfilter.c b/kernel/audit/auditfilter.c
similarity index 100%
rename from kernel/auditfilter.c
rename to kernel/audit/auditfilter.c
diff --git a/kernel/auditsc.c b/kernel/audit/auditsc.c
similarity index 100%
rename from kernel/auditsc.c
rename to kernel/audit/auditsc.c
diff --git a/kernel/signal.c b/kernel/signal.c
index d81f495..dd4c3e7 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -33,7 +33,7 @@
#include <asm/uaccess.h>
#include <asm/unistd.h>
#include <asm/siginfo.h>
-#include "audit.h" /* audit_signal_info() */
+#include "audit/audit.h" /* audit_signal_info() */
/*
* SLAB caches for signal bits.