diff options
author | Eric Paris <eparis@redhat.com> | 2012-04-04 15:01:43 -0400 |
---|---|---|
committer | Eric Paris <eparis@redhat.com> | 2012-04-09 12:23:03 -0400 |
commit | b466066f9b648ccb6aa1e174f0389b7433e460fd (patch) | |
tree | beaec41a751db3ceeb55e4c428bb7e1fe995d880 | |
parent | 0972c74ecba4878baa5f97bb78b242c0eefacfb6 (diff) |
LSM: remove the task field from common_audit_data
There are no legitimate users. Always use current and get back some stack
space for the common_audit_data.
Signed-off-by: Eric Paris <eparis@redhat.com>
-rw-r--r-- | include/linux/lsm_audit.h | 1 | ||||
-rw-r--r-- | security/lsm_audit.c | 8 | ||||
-rw-r--r-- | security/selinux/hooks.c | 1 |
3 files changed, 2 insertions, 8 deletions
diff --git a/include/linux/lsm_audit.h b/include/linux/lsm_audit.h index 9e1ebf5851b8..75368c1aac78 100644 --- a/include/linux/lsm_audit.h +++ b/include/linux/lsm_audit.h | |||
@@ -53,7 +53,6 @@ struct common_audit_data { | |||
53 | #define LSM_AUDIT_DATA_KMOD 8 | 53 | #define LSM_AUDIT_DATA_KMOD 8 |
54 | #define LSM_AUDIT_DATA_INODE 9 | 54 | #define LSM_AUDIT_DATA_INODE 9 |
55 | #define LSM_AUDIT_DATA_DENTRY 10 | 55 | #define LSM_AUDIT_DATA_DENTRY 10 |
56 | struct task_struct *tsk; | ||
57 | union { | 56 | union { |
58 | struct path path; | 57 | struct path path; |
59 | struct dentry *dentry; | 58 | struct dentry *dentry; |
diff --git a/security/lsm_audit.c b/security/lsm_audit.c index 90c129b0102f..e796d2517653 100644 --- a/security/lsm_audit.c +++ b/security/lsm_audit.c | |||
@@ -213,12 +213,8 @@ static void dump_common_audit_data(struct audit_buffer *ab, | |||
213 | { | 213 | { |
214 | struct task_struct *tsk = current; | 214 | struct task_struct *tsk = current; |
215 | 215 | ||
216 | if (a->tsk) | 216 | audit_log_format(ab, " pid=%d comm=", tsk->pid); |
217 | tsk = a->tsk; | 217 | audit_log_untrustedstring(ab, tsk->comm); |
218 | if (tsk && tsk->pid) { | ||
219 | audit_log_format(ab, " pid=%d comm=", tsk->pid); | ||
220 | audit_log_untrustedstring(ab, tsk->comm); | ||
221 | } | ||
222 | 218 | ||
223 | switch (a->type) { | 219 | switch (a->type) { |
224 | case LSM_AUDIT_DATA_NONE: | 220 | case LSM_AUDIT_DATA_NONE: |
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 9f0384493009..d79762946c6e 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c | |||
@@ -1429,7 +1429,6 @@ static int cred_has_capability(const struct cred *cred, | |||
1429 | 1429 | ||
1430 | COMMON_AUDIT_DATA_INIT(&ad, LSM_AUDIT_DATA_CAP); | 1430 | COMMON_AUDIT_DATA_INIT(&ad, LSM_AUDIT_DATA_CAP); |
1431 | ad.selinux_audit_data = &sad; | 1431 | ad.selinux_audit_data = &sad; |
1432 | ad.tsk = current; | ||
1433 | ad.u.cap = cap; | 1432 | ad.u.cap = cap; |
1434 | 1433 | ||
1435 | switch (CAP_TO_INDEX(cap)) { | 1434 | switch (CAP_TO_INDEX(cap)) { |