dbus/bus
Eamon Walsh b38c433bf7 libselinux behavior in permissive mode wrt invalid domains
Stephen Smalley wrote:
> On Tue, 2009-04-21 at 16:32 -0400, Joshua Brindle wrote:
>
>> Stephen Smalley wrote:
>>
>>> On Thu, 2009-04-16 at 20:47 -0400, Eamon Walsh wrote:
>>>
>>>> Stephen Smalley wrote:
>>>>
>> <snip>
>>
>>
>>> No, I don't want to change the behavior upon context_to_sid calls in
>>> general, as we otherwise lose all context validity checking in
>>> permissive mode.
>>>
>>> I think I'd rather change compute_sid behavior to preclude the situation
>>> from arising in the first place, possibly altering the behavior in
>>> permissive mode upon an invalid context to fall back on the ssid
>>> (process) or the tsid (object).  But I'm not entirely convinced any
>>> change is required here.
>>>
>>>
>> I just want to follow up to make sure we are all on the same page here. Was the
>> suggestion to change avc_has_perm in libselinux or context_to_sid in the kernel
>> or leave the code as is and fix the callers of avc_has_perm to correctly handle
>> error codes?
>>
>> I prefer the last approach because of Eamon's explanation, EINVAL is already
>> passed in errno to specify the context was invalid (and if object managers
>> aren't handling that correctly now there is a good chance they aren't handling
>> the ENOMEM case either).
>>
>
> I'd be inclined to change compute_sid (not context_to_sid) in the kernel
> to prevent invalid contexts from being formed even in permissive mode
> (scenario is a type transition where role is not authorized for the new
> type).  That was originally to allow the system to boot in permissive
> mode.  But an alternative would be to just stay in the caller's context
> (ssid) in that situation.
>
> Changing the callers of avc_has_perm() to handle EINVAL and/or ENOMEM
> may make sense, but that logic should not depend on enforcing vs.
> permissive mode.
>
>

FWIW, the following patch to D-Bus should help:

bfo21072 - Log SELinux denials better by checking errno for the cause

    Note that this does not fully address the bug report since
    EINVAL can still be returned in permissive mode.  However the log
    messages will now reflect the proper cause of the denial.

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
Signed-off-by: Colin Walters <walters@verbum.org>
2009-05-06 12:51:19 -04:00
..
.gitignore Bring .gitignore files up to date; add *.o, *~ etc. to top-level .gitignore 2007-10-10 17:38:00 +01:00
activation-exit-codes.h 2007-07-26 Havoc Pennington <hp@redhat.com> 2007-07-26 23:01:14 +00:00
activation-helper-bin.c 2007-07-26 Havoc Pennington <hp@redhat.com> 2007-07-26 23:01:14 +00:00
activation-helper.c 2007-07-30 Havoc Pennington <hp@redhat.com> 2007-07-30 16:16:47 +00:00
activation-helper.h 2007-07-24 Richard Hughes <richard@hughsie.com> 2007-07-24 12:01:32 +00:00
activation.c Avoid possible use of uninitialized variable 2009-01-06 17:43:32 -05:00
activation.h Store what environment to activate with on activation object 2008-07-12 13:21:23 -04:00
bus.c Initialize AVC earlier so we can look up service security contexts 2009-01-06 18:22:39 -05:00
bus.h Add syslog of security denials and configuration file reloads 2008-12-12 15:18:12 -05:00
config-loader-expat.c 2007-07-13 Havoc Pennington <hp@redhat.com> 2007-07-14 02:44:01 +00:00
config-loader-libxml.c 2007-07-13 Havoc Pennington <hp@redhat.com> 2007-07-14 02:44:01 +00:00
config-parser-common.c Bug 18446: Keep umask for session bus 2009-01-06 18:20:13 -05:00
config-parser-common.h Bug 18446: Keep umask for session bus 2009-01-06 18:20:13 -05:00
config-parser-trivial.c 2007-07-26 Havoc Pennington <hp@redhat.com> 2007-07-26 23:01:14 +00:00
config-parser-trivial.h 2007-07-24 Richard Hughes <richard@hughsie.com> 2007-07-24 11:50:59 +00:00
config-parser.c Bug 18446: Keep umask for session bus 2009-01-06 18:20:13 -05:00
config-parser.h Bug 18446: Keep umask for session bus 2009-01-06 18:20:13 -05:00
connection.c Always append closing quote in log command 2009-05-06 12:51:17 -04:00
connection.h Add uid, pid, and command to security logs 2008-12-18 15:39:04 -05:00
dbus-daemon.1.in Bug 18446: Keep umask for session bus 2009-01-06 18:20:13 -05:00
desktop-file.c Bug 19502 - Sparse warning cleanups 2009-05-06 12:51:18 -04:00
desktop-file.h 2007-07-24 Richard Hughes <richard@hughsie.com> 2007-07-24 12:14:51 +00:00
dir-watch-default.c 2007-07-13 Havoc Pennington <hp@redhat.com> 2007-07-14 02:44:01 +00:00
dir-watch-dnotify.c watch for file creates in dnotify 2008-01-14 18:17:53 -05:00
dir-watch-inotify.c Bug 16294: Don't lose inotify watch when config fails to parse 2008-07-28 12:02:56 -04:00
dir-watch-kqueue.c 2007-07-13 Havoc Pennington <hp@redhat.com> 2007-07-14 02:44:01 +00:00
dir-watch.h 2007-07-13 Havoc Pennington <hp@redhat.com> 2007-07-14 02:44:01 +00:00
dispatch.c 2007-07-26 Havoc Pennington <hp@redhat.com> 2007-07-26 23:01:14 +00:00
dispatch.h 2007-07-13 Havoc Pennington <hp@redhat.com> 2007-07-14 02:44:01 +00:00
driver.c Bug 19502 - Sparse warning cleanups 2009-05-06 12:51:18 -04:00
driver.h 2007-07-13 Havoc Pennington <hp@redhat.com> 2007-07-14 02:44:01 +00:00
expirelist.c fix expiration of pending replies 2008-04-03 11:12:27 -04:00
expirelist.h Make BusExpireList an opaque data type 2008-03-04 14:21:42 -05:00
main.c [win32] Protect usage of SIGHUP with #ifdef 2009-01-06 18:21:25 -05:00
Makefile.am add inotify support (FDO Bz#13268) 2008-01-14 19:00:36 -05:00
messagebus.in add lsb headers to init script (FDO Bug #11491) 2008-01-15 16:58:36 -05:00
policy.c Add optional logging on allow rules 2008-12-16 12:20:43 -05:00
policy.h Add optional logging on allow rules 2008-12-16 12:20:43 -05:00
rc.messagebus.in * bus/messagebus.in, bus/rc.messagebus.in: run dbus-uuidgen --ensure 2006-10-19 15:34:47 +00:00
selinux.c libselinux behavior in permissive mode wrt invalid domains 2009-05-06 12:51:19 -04:00
selinux.h audit_init() was not declared in header, causing warnings; fix this and namespace it 2007-10-23 14:48:52 -04:00
services.c 2007-07-13 Havoc Pennington <hp@redhat.com> 2007-07-14 02:44:01 +00:00
services.h 2007-07-13 Havoc Pennington <hp@redhat.com> 2007-07-14 02:44:01 +00:00
session.conf.in Bug 18446: Keep umask for session bus 2009-01-06 18:20:13 -05:00
signals.c Add argument path matching support. Bug #11066. 2007-09-20 13:04:38 -04:00
signals.h Add argument path matching support. Bug #11066. 2007-09-20 13:04:38 -04:00
system.conf.in Merge commit '3d6abf64d0abb2718e082e120f14f8f923a4af59' into dbus-1.2 2008-12-16 12:29:04 -05:00
test-launch-helper.c 2007-07-24 Richard Hughes <richard@hughsie.com> 2007-07-24 12:03:04 +00:00
test-main.c 2007-07-13 Havoc Pennington <hp@redhat.com> 2007-07-14 02:44:01 +00:00
test-system.c 2007-07-24 Richard Hughes <richard@hughsie.com> 2007-07-24 13:03:31 +00:00
test.c 2007-07-13 Havoc Pennington <hp@redhat.com> 2007-07-14 02:44:01 +00:00
test.h 2007-07-24 Richard Hughes <richard@hughsie.com> 2007-07-24 12:10:58 +00:00
utils.c 2007-07-13 Havoc Pennington <hp@redhat.com> 2007-07-14 02:44:01 +00:00
utils.h 2007-07-13 Havoc Pennington <hp@redhat.com> 2007-07-14 02:44:01 +00:00