提交 5a3cb3b6 编写于 作者: R Richard Guy Briggs 提交者: Eric Paris

audit: allow user processes to log from another PID namespace

Still only permit the audit logging daemon and control to operate from the
initial PID namespace, but allow processes to log from another PID namespace.

Cc: "Eric W. Biederman" <ebiederm@xmission.com>
(informed by ebiederman's c776b5d2)
Signed-off-by: NRichard Guy Briggs <rgb@redhat.com>
上级 f1dc4867
...@@ -607,9 +607,8 @@ static int audit_netlink_ok(struct sk_buff *skb, u16 msg_type) ...@@ -607,9 +607,8 @@ static int audit_netlink_ok(struct sk_buff *skb, u16 msg_type)
{ {
int err = 0; int err = 0;
/* Only support the initial namespaces for now. */ /* Only support initial user namespace for now. */
if ((current_user_ns() != &init_user_ns) || if ((current_user_ns() != &init_user_ns))
(task_active_pid_ns(current) != &init_pid_ns))
return -EPERM; return -EPERM;
switch (msg_type) { switch (msg_type) {
...@@ -629,6 +628,11 @@ static int audit_netlink_ok(struct sk_buff *skb, u16 msg_type) ...@@ -629,6 +628,11 @@ static int audit_netlink_ok(struct sk_buff *skb, u16 msg_type)
case AUDIT_TTY_SET: case AUDIT_TTY_SET:
case AUDIT_TRIM: case AUDIT_TRIM:
case AUDIT_MAKE_EQUIV: case AUDIT_MAKE_EQUIV:
/* Only support auditd and auditctl in initial pid namespace
* for now. */
if ((task_active_pid_ns(current) != &init_pid_ns))
return -EPERM;
if (!capable(CAP_AUDIT_CONTROL)) if (!capable(CAP_AUDIT_CONTROL))
err = -EPERM; err = -EPERM;
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册