public inbox for linux-audit@redhat.com
 help / color / mirror / Atom feed
From: Eric Paris <eparis@redhat.com>
To: linux-audit@redhat.com
Subject: max size of execve records
Date: Fri, 12 Oct 2007 15:52:30 -0400	[thread overview]
Message-ID: <1192218750.3196.33.camel@localhost.localdomain> (raw)

So I was banging on my new execve audit changes today and realized I
missed something.  If the argument is binary/has control characters it
gets logged in hex, which means each char in the execve argument lists
gets turned into 2 characters in the audit message.  Thus my current
execve message size of 7500 could be doubled to 15000 in audit_log_hex.
15000 will overflow userspace and that argument be silently dropped and
never written to disk   :(

Do we see a problem dropping the execve record size down to 3500?  The
downside to this is more overhead since we might be sending more
messages.  I wonder though how many programs get exec'd with > 3500
bytes of args.  I don't think we'll be flooding the audit system here,
its going to still be rare that we hit arguments of this size but not
unheard of.  (it turns out that just building a kernel can generate some
darn large arguments if you build lots and lots of modules)

I really don't want to have to rewrite all of the
audit_log_untrustedstring logic inside the execve audit info just so I
can tell the final size of the audit message.  I'd rather just be safe
and send a couple extra records on occasion....

As a side note I have no intention in the future of ever changing this
to be more than 8k just because order 2 allocations in the kernel are
reasonable even on a heavily loaded system, but asking for more than 2
pages can fail.  Needless to say, I think when possible userspace needs
to be able to handle these larger netlink messages.

-Eric

             reply	other threads:[~2007-10-12 19:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-12 19:52 Eric Paris [this message]
2007-10-15 13:53 ` max size of execve records Steve Grubb

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=1192218750.3196.33.camel@localhost.localdomain \
    --to=eparis@redhat.com \
    --cc=linux-audit@redhat.com \
    /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