mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Eric Paris" <eparis@parisplace.org>
To: "Pavel Emelyanov" <xemul@openvz.org>
Cc: linux-audit@redhat.com, "Thomas Graf" <tgraf@suug.ch>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	aviro@redhat.com, sgrubb@redhat.com, akpm@osdl.org
Subject: Re: [PATCH] Audit: netlink socket can be auto-bound to pid other than current->pid
Date: Wed, 19 Mar 2008 08:04:33 -0400	[thread overview]
Message-ID: <7e0fb38c0803190504x3b725790n812c76e6e0b760f7@mail.gmail.com> (raw)
In-Reply-To: <47E0D8AF.1060907@openvz.org>

On 3/19/08, Pavel Emelyanov <xemul@openvz.org> wrote:
> Eric Paris wrote:
>  > On 3/18/08, Pavel Emelyanov <xemul@openvz.org> wrote:
>  >
>  > Can we please just leave audit_pid as the one flag to tell us if
>  > auditd is supposedly up there in userspace?  Use audit_nlk_pid to send
>  > messages to the right place, but leave everything else to do with
>  > audit_pid alone.
>
>
> OK, point taken ;) Is that patch looks OK? If yes, I'll comment
>  it properly and re-send to Andrew.
>
>  The audit_nlk_pid reset to 0 is not required, since all the
>  decisions are taken based on audit_pid value only.

I looks good to me.  Feel free to add Acked-by: Eric Paris
<eparis@redhat.com> on your submission.

-Eric

>
>  Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
>
>
>  diff --git a/kernel/audit.c b/kernel/audit.c
>
> index ccc7d0e..12a0278 100644
>
> --- a/kernel/audit.c
>  +++ b/kernel/audit.c
>
> @@ -77,9 +77,13 @@ static int   audit_default;
>
>  /* If auditing cannot proceed, audit_failure selects what happens. */
>   static int     audit_failure = AUDIT_FAIL_PRINTK;
>
>  -/* If audit records are to be written to the netlink socket, audit_pid
>
> - * contains the (non-zero) pid. */
>  +/*
>  + * If audit records are to be written to the netlink socket, audit_pid
>  + * contains the pid of the auditd process and audit_nlk_pid contains
>  + * the pid to use to send netlink messages to that process.
>  + */
>   int            audit_pid;
>
> +static int     audit_nlk_pid;
>
>
>  /* If audit_rate_limit is non-zero, limit the rate of sending audit records
>
>   * to that number per second.  This prevents DoS attacks, but results in
>  @@ -349,7 +353,7 @@ static int kauditd_thread(void *dummy)
>
>                 wake_up(&audit_backlog_wait);
>                 if (skb) {
>                         if (audit_pid) {
>  -                               int err = netlink_unicast(audit_sock, skb, audit_pid, 0);
>
> +                               int err = netlink_unicast(audit_sock, skb, audit_nlk_pid, 0);
>
>                                 if (err < 0) {
>                                         BUG_ON(err != -ECONNREFUSED); /* Shoudn't happen */
>                                         printk(KERN_ERR "audit: *NO* daemon at audit_pid=%d\n", audit_pid);
>
> @@ -626,6 +630,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
>
>                                                         sid, 1);
>
>                         audit_pid = new_pid;
>  +                       audit_nlk_pid = NETLINK_CB(skb).pid;
>                 }
>                 if (status_get->mask & AUDIT_STATUS_RATE_LIMIT)
>                         err = audit_set_rate_limit(status_get->rate_limit,
>

      reply	other threads:[~2008-03-19 20:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-18  9:24 Pavel Emelyanov
2008-03-18 23:29 ` Eric Paris
2008-03-18 23:35   ` Eric Paris
2008-03-19  9:11   ` Pavel Emelyanov
2008-03-19 12:04     ` Eric Paris [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7e0fb38c0803190504x3b725790n812c76e6e0b760f7@mail.gmail.com \
    --to=eparis@parisplace.org \
    --cc=akpm@osdl.org \
    --cc=aviro@redhat.com \
    --cc=linux-audit@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sgrubb@redhat.com \
    --cc=tgraf@suug.ch \
    --cc=xemul@openvz.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®