From: Stephen Smalley <sds@tycho.nsa.gov>
To: "Roberts, William C" <william.c.roberts@intel.com>,
"seandroid-list@tycho.nsa.gov" <seandroid-list@tycho.nsa.gov>,
"selinux@tycho.nsa.gov" <selinux@tycho.nsa.gov>
Subject: Re: av_decision on audit callback
Date: Fri, 2 Oct 2015 16:13:16 -0400 [thread overview]
Message-ID: <560EE55C.9090206@tycho.nsa.gov> (raw)
In-Reply-To: <476DC76E7D1DF2438D32BFADF679FC560107F107@ORSMSX103.amr.corp.intel.com>
On 10/02/2015 04:07 PM, Roberts, William C wrote:
>
>
>> -----Original Message-----
>> From: Stephen Smalley [mailto:sds@tycho.nsa.gov]
>> Sent: Friday, October 2, 2015 12:12 PM
>> To: Roberts, William C; seandroid-list@tycho.nsa.gov; selinux@tycho.nsa.gov
>> Subject: Re: av_decision on audit callback
>>
>> On 10/02/2015 02:54 PM, Stephen Smalley wrote:
>>> On 10/02/2015 02:48 PM, Roberts, William C wrote:
>>>> I would like to be able to gather the result of permissive mode per
>>>> domain from a check_access() call for the userspace object managers
>>>> on Android.
>>>>
>>>> From what I can tell check_access() calls avc_has_perm with a NULL
>>>> 5th argument. That argument is for the struct avc_entry_ref.
>>>>
>>>> That structure has a pointer to an opaque type, avc_entry. Which
>>>> contains struct av_decision.
>>>>
>>>> Which contains flags that have a permissive flag:
>>>>
>>>> struct av_decision {
>>>>
>>>> access_vector_t allowed;
>>>>
>>>> access_vector_t decided;
>>>>
>>>> access_vector_t auditallow;
>>>>
>>>> access_vector_t auditdeny;
>>>>
>>>> unsigned int seqno;
>>>>
>>>> unsigned int flags;
>>>>
>>>> };
>>>>
>>>> /* Definitions of av_decision.flags */
>>>>
>>>> #define SELINUX_AVD_FLAGS_PERMISSIVE 0x0001
>>>>
>>>> It looks like if check_access just passes this structure and then
>>>> avc_has_perm() when it calls avc_audit, it could supply the
>>>> av_decision structure to the avc_suppl_audit() call. We could then
>>>> have an audit2 callback that takes this parameter.
>>>>
>>>> Is this mostly right, seem sane? Better way to do this?
>>>
>>> It doesn't need to be exposed at that level; the libselinux
>>> avc_audit() routine can log it, similar to what is done in the kernel.
>>> It already has the av_decision structure available to it.
>>
>> To clarify, anything directly known to the AVC, like the permissive flag, can be
>> directly logged by it. The audit callback is for logging auxiliary audit information
>> not known to the AVC (the pid of the client process being a good example).
>
> I was wondering if we could just dump permissive=0|1 from the AVC logging routine, but that
> would affect everyone. I guess then you would be ok with that? Does order matter with
> the fields wrt parsing? I don't want to break any desktop tooling I am aware of, would we upstream
> this change as well?
Just put it at the end (i.e. log_append() after the avc_dump_query()
call), like we do in the kernel. Shouldn't be a problem. Technically
order shouldn't matter but safer to just append it to the current fields.
Yes, we'd upstream it.
next prev parent reply other threads:[~2015-10-02 20:13 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-02 18:48 av_decision on audit callback Roberts, William C
2015-10-02 18:54 ` Stephen Smalley
2015-10-02 19:12 ` Stephen Smalley
2015-10-02 20:07 ` Roberts, William C
2015-10-02 20:13 ` Stephen Smalley [this message]
2015-10-02 20:22 ` Roberts, William C
2015-10-02 20:26 ` Stephen Smalley
2015-10-02 20:29 ` Roberts, William C
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=560EE55C.9090206@tycho.nsa.gov \
--to=sds@tycho.nsa.gov \
--cc=seandroid-list@tycho.nsa.gov \
--cc=selinux@tycho.nsa.gov \
--cc=william.c.roberts@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.