Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 327252
b: refs/heads/master
c: 8aa14b6
h: refs/heads/master
v: v3
  • Loading branch information
Eric W. Biederman committed Sep 18, 2012
1 parent 46c35a8 commit eb2c85b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 26 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f95732e2e0a649c148be0242b72e3c7473092687
refs/heads/master: 8aa14b64981ee4b95959e1ed331b672d053aab62
38 changes: 13 additions & 25 deletions trunk/kernel/audit.c
Original file line number Diff line number Diff line change
Expand Up @@ -866,41 +866,29 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
break;
case AUDIT_TTY_GET: {
struct audit_tty_status s;
struct task_struct *tsk;
unsigned long flags;

rcu_read_lock();
tsk = find_task_by_vpid(pid);
if (tsk && lock_task_sighand(tsk, &flags)) {
s.enabled = tsk->signal->audit_tty != 0;
unlock_task_sighand(tsk, &flags);
} else
err = -ESRCH;
rcu_read_unlock();

if (!err)
audit_send_reply(NETLINK_CB(skb).pid, seq,
AUDIT_TTY_GET, 0, 0, &s, sizeof(s));
struct task_struct *tsk = current;

spin_lock_irq(&tsk->sighand->siglock);
s.enabled = tsk->signal->audit_tty != 0;
spin_unlock_irq(&tsk->sighand->siglock);

audit_send_reply(NETLINK_CB(skb).pid, seq,
AUDIT_TTY_GET, 0, 0, &s, sizeof(s));
break;
}
case AUDIT_TTY_SET: {
struct audit_tty_status *s;
struct task_struct *tsk;
unsigned long flags;
struct task_struct *tsk = current;

if (nlh->nlmsg_len < sizeof(struct audit_tty_status))
return -EINVAL;
s = data;
if (s->enabled != 0 && s->enabled != 1)
return -EINVAL;
rcu_read_lock();
tsk = find_task_by_vpid(pid);
if (tsk && lock_task_sighand(tsk, &flags)) {
tsk->signal->audit_tty = s->enabled != 0;
unlock_task_sighand(tsk, &flags);
} else
err = -ESRCH;
rcu_read_unlock();

spin_lock_irq(&tsk->sighand->siglock);
tsk->signal->audit_tty = s->enabled != 0;
spin_unlock_irq(&tsk->sighand->siglock);
break;
}
default:
Expand Down

0 comments on commit eb2c85b

Please sign in to comment.