public inbox for linux-audit@redhat.com
 help / color / mirror / Atom feed
From: Eric Paris <eparis@redhat.com>
To: Jiri Pirko <jpirko@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-audit@redhat.com, linux-kernel@vger.kernel.org,
	viro@zeniv.linux.org.uk
Subject: Re: audit: EXECVE record - removed bogus newline
Date: Fri, 09 Jan 2009 10:21:25 -0500	[thread overview]
Message-ID: <1231514485.25714.11.camel@localhost.localdomain> (raw)
In-Reply-To: <20090109132130.0bc87c02@psychotron.englab.brq.redhat.com>

On Fri, 2009-01-09 at 13:21 +0100, Jiri Pirko wrote:
> On Thu, 08 Jan 2009 10:33:18 -0500
> Eric Paris <eparis@redhat.com> wrote:
> 
> > On Thu, 2009-01-08 at 15:38 +0100, Jiri Pirko wrote:
> > > EXECVE records contain a newline after every argument. auditd converts
> > > "\n" to " " so you cannot see newlines even in raw logs, but they're
> > > there nevertheless. If you're not using auditd, you need to work round
> > > them. These '\n' chars are can be easily replaced by spaces when
> > > creating record in kernel. Note there is no need for trailing '\n' in
> > > an audit record. 
> > 
> > While I completely agree the \n was my mistake and should be
> > dropped/fixed can you fix one more thing and look at another?  First
> > arg_num_len is being miscalculated since I included the \n in that
> > calculation (might be the only place....)
> I think that calculation is correct only the comment needs to be changed like this:
> -       /* how many digits are in arg_num? 3 is the length of a=\n */
> +       /* how many digits are in arg_num? 3 is the length of " a=" */
> 
> the count is still 3 - with '\n' or with ' '.

You're right.  Sorry, I'd like to see the comment fixed.  That 3 does
matter and I don't want to see someone not realize how important getting
that len right is....

> > and I remember not wanting to
> > follow convention and put the space at the beginning of the aX= for some
> > reason.  If you add thousands of arguments so this is larger than
> > MAX_EXECVE_AUDIT_LEN do you end up with an extra space somewhere in the
> > second EXECVE record? 
> Is this a problem? We can do some workaround but is it necessary?

I'll go ahead and vote I don't care, even though I brought it up.  My
code left an extra space at the end of the record.  Yours puts it at the
beginning.  From the point of view of auditd the spaces don't mean
anything, so I'm ok with your method.  I guess it saves a call to
audit_log_format, and saving a call is benefit enough

Don't care if it's this window or the next, it's been like this for 3
weeks short of a year now  :)

Acked-by: Eric Paris <eparis@redhat.com>

  reply	other threads:[~2009-01-09 15:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-08 14:38 audit: EXECVE record - removed bogus newline Jiri Pirko
2009-01-08 15:33 ` Eric Paris
2009-01-09 12:21   ` Jiri Pirko
2009-01-09 15:21     ` Eric Paris [this message]
2009-01-09 15:44       ` Jiri Pirko

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=1231514485.25714.11.camel@localhost.localdomain \
    --to=eparis@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=jpirko@redhat.com \
    --cc=linux-audit@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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