public inbox for linux-audit@redhat.com
 help / color / mirror / Atom feed
From: Steve Grubb <sgrubb@redhat.com>
To: William Roberts <bill.c.roberts@gmail.com>
Cc: Richard Guy Briggs <rgb@redhat.com>,
	William Roberts <wroberts@tresys.com>,
	linux-audit@redhat.com
Subject: Re: [PATCH] audit: Add cmdline to taskinfo output
Date: Tue, 29 Oct 2013 15:55:42 -0400	[thread overview]
Message-ID: <7816274.oLhsNknQdb@x2> (raw)
In-Reply-To: <CAFftDdrWRP8XG8o532HcZ826VH2ukkQ6QSG14M5v86Rn=rzopA@mail.gmail.com>

On Tuesday, October 29, 2013 12:12:29 PM William Roberts wrote:
> > > to small for most package names, and
> > > already contains the VM command. I really have no information of what
> > > Android App has created the issue.
> > 
> > This is true for all arches. Usually you can have it pretty narrowly
> > defined to
> > where you have a pretty good guess between 2 or 3 apps with the same root
> > name. But in your case its totally named wrong.
> 
> I could set the title via prctl and PR_SET_NAME, but again I would be
> limited at 16 bytes, at least with cmdline I am limited at a page. 

A page would be a problem for audit records. What I see is a NULL terminated 
list of arguments which the program name is argv[0]. So, you'd want to grab 
that one. Butyou could have something in there with PATH_MAX and whitespaces 
which would be excessively long.

> As a simple example, a basic example from samsung gets truncated.
> 
> com.samsung.myapp
> 
> > > Solution:
> > > Get the proc cmdline info (not trust worthy, but can help debugging
> > 
> > Android)
> > 
> > > type=1300 msg=audit(1383068585.326:205): arch=40000028 syscall=5
> > 
> > per=840000
> > 
> > > success=yes exit=38 a0=74d86d34 a1=20241 a2=180 a3=74d86d0c items=1
> > > ppid=296 pid=1378 auid=4294967295 uid=1027 gid=1027 euid=1027 suid=1027
> > > fsuid=1027 egid=1027 sgid=1027 fsgid=1027 tty=(none) ses=4294967295
> > > comm=4173796E635461736B202331 exe="/system/bin/app_process"
> > > cmdline="com.android.nfc" subj=u:r:nfc:s0 key=(null)
> > > 
> > > Now I know it was the NFC app
> > 
> > What do you get on x86_64 auditing a shell or python script with your same
> > patch? Also, does cmdline potentially include arguments?
> 
> I would have to get back to you on this, but whatever is set in
> /proc/<pid>/cmdline shows up here, which means
> it could have arguments etc.

The reason I'm asking is that it might be better for all arches to switch. All 
have the 16 character limit. But we would only want argv[0] and not the 
arguments.

-Steve

  reply	other threads:[~2013-10-29 19:55 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-28 23:50 [PATCH] audit: Add cmdline to taskinfo output William Roberts
2013-10-29 15:14 ` Steve Grubb
2013-10-29 17:44   ` William Roberts
2013-10-29 17:55     ` William Roberts
2013-10-29 19:01     ` Steve Grubb
2013-10-29 19:12       ` William Roberts
2013-10-29 19:55         ` Steve Grubb [this message]
2013-10-29 20:25           ` William Roberts
2013-10-29 23:24             ` William Roberts
2013-10-30  0:43               ` William Roberts
2013-10-30 19:42                 ` Steve Grubb
2013-10-30 20:18                   ` William Roberts
2013-10-30 21:20                     ` Eric Paris
2013-10-30 21:52                       ` William Roberts
2013-10-31 14:36                     ` Steve Grubb
2013-10-31 15:24                       ` William Roberts
2013-10-31 15:28                         ` Richard Guy Briggs
2013-10-31 15:33                           ` William Roberts
2013-10-31 15:46                             ` Richard Guy Briggs
2013-10-31 15:51                               ` William Roberts
2013-10-31 15:52                                 ` William Roberts
  -- strict thread matches above, loose matches on Subject: below --
2013-10-28 23:47 William Roberts
2013-10-23 20:40 William Roberts
2013-10-24 19:10 ` Richard Guy Briggs
2013-10-28 13:48 ` William Roberts
2013-10-28 15:10   ` Richard Guy Briggs
2013-10-28 16:30     ` William Roberts
2013-10-28 19:02       ` William Roberts
2013-10-28 21:52         ` Richard Guy Briggs

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=7816274.oLhsNknQdb@x2 \
    --to=sgrubb@redhat.com \
    --cc=bill.c.roberts@gmail.com \
    --cc=linux-audit@redhat.com \
    --cc=rgb@redhat.com \
    --cc=wroberts@tresys.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