Skip to content

Commit

Permalink
LSM: remove the task field from common_audit_data
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Paris committed Apr 9, 2012
1 parent 0972c74 commit b466066
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
1 change: 0 additions & 1 deletion include/linux/lsm_audit.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ struct common_audit_data {
#define LSM_AUDIT_DATA_KMOD 8
#define LSM_AUDIT_DATA_INODE 9
#define LSM_AUDIT_DATA_DENTRY 10
struct task_struct *tsk;
union {
struct path path;
struct dentry *dentry;
Expand Down
8 changes: 2 additions & 6 deletions security/lsm_audit.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,8 @@ static void dump_common_audit_data(struct audit_buffer *ab,
{
struct task_struct *tsk = current;

if (a->tsk)
tsk = a->tsk;
if (tsk && tsk->pid) {
audit_log_format(ab, " pid=%d comm=", tsk->pid);
audit_log_untrustedstring(ab, tsk->comm);
}
audit_log_format(ab, " pid=%d comm=", tsk->pid);
audit_log_untrustedstring(ab, tsk->comm);

switch (a->type) {
case LSM_AUDIT_DATA_NONE:
Expand Down
1 change: 0 additions & 1 deletion security/selinux/hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -1429,7 +1429,6 @@ static int cred_has_capability(const struct cred *cred,

COMMON_AUDIT_DATA_INIT(&ad, LSM_AUDIT_DATA_CAP);
ad.selinux_audit_data = &sad;
ad.tsk = current;
ad.u.cap = cap;

switch (CAP_TO_INDEX(cap)) {
Expand Down

0 comments on commit b466066

Please sign in to comment.