Commit b466066f authored by Eric Paris's avatar Eric Paris

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: default avatarEric Paris <eparis@redhat.com>
parent 0972c74e
...@@ -53,7 +53,6 @@ struct common_audit_data { ...@@ -53,7 +53,6 @@ struct common_audit_data {
#define LSM_AUDIT_DATA_KMOD 8 #define LSM_AUDIT_DATA_KMOD 8
#define LSM_AUDIT_DATA_INODE 9 #define LSM_AUDIT_DATA_INODE 9
#define LSM_AUDIT_DATA_DENTRY 10 #define LSM_AUDIT_DATA_DENTRY 10
struct task_struct *tsk;
union { union {
struct path path; struct path path;
struct dentry *dentry; struct dentry *dentry;
......
...@@ -213,12 +213,8 @@ static void dump_common_audit_data(struct audit_buffer *ab, ...@@ -213,12 +213,8 @@ static void dump_common_audit_data(struct audit_buffer *ab,
{ {
struct task_struct *tsk = current; struct task_struct *tsk = current;
if (a->tsk) audit_log_format(ab, " pid=%d comm=", tsk->pid);
tsk = a->tsk; audit_log_untrustedstring(ab, tsk->comm);
if (tsk && tsk->pid) {
audit_log_format(ab, " pid=%d comm=", tsk->pid);
audit_log_untrustedstring(ab, tsk->comm);
}
switch (a->type) { switch (a->type) {
case LSM_AUDIT_DATA_NONE: case LSM_AUDIT_DATA_NONE:
......
...@@ -1429,7 +1429,6 @@ static int cred_has_capability(const struct cred *cred, ...@@ -1429,7 +1429,6 @@ static int cred_has_capability(const struct cred *cred,
COMMON_AUDIT_DATA_INIT(&ad, LSM_AUDIT_DATA_CAP); COMMON_AUDIT_DATA_INIT(&ad, LSM_AUDIT_DATA_CAP);
ad.selinux_audit_data = &sad; ad.selinux_audit_data = &sad;
ad.tsk = current;
ad.u.cap = cap; ad.u.cap = cap;
switch (CAP_TO_INDEX(cap)) { switch (CAP_TO_INDEX(cap)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment