All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Smalley <sds@tycho.nsa.gov>
To: Steve Lawrence <slawrence@tresys.com>,
	Dominick Grift <dominick.grift@gmail.com>
Cc: SELinux List <selinux@tycho.nsa.gov>
Subject: Re: [RFC] Source Policy, CIL, and High Level Languages
Date: Wed, 16 Jul 2014 10:33:36 -0400	[thread overview]
Message-ID: <53C68D40.8020700@tycho.nsa.gov> (raw)
In-Reply-To: <53C68BAE.4000303@tycho.nsa.gov>

On 07/16/2014 10:26 AM, Stephen Smalley wrote:
> On 07/16/2014 10:21 AM, Stephen Smalley wrote:
>> On 07/16/2014 10:16 AM, Stephen Smalley wrote:
>>> On 07/15/2014 03:56 PM, Steve Lawrence wrote:
>>>> On 07/14/2014 01:49 PM, Stephen Smalley wrote:
>>>>> On 07/14/2014 01:12 PM, Steve Lawrence wrote:
>>>>>> Ah, interesting. We saw that problem a long time ago, but couldn't
>>>>>> reproduce it and it disappeared. Though I'm still unable to reproduce it
>>>>>> following your steps. I can still login and seusers is labeled
>>>>>> selinux_config_t. I'll keep looking into this.
>>>>>>
>>>>>> I've also rebased/pushed #integration onto #next.
>>>>>
>>>>> # Revert to stock F20 SELinux userspace and policy.
>>>>> yum reinstall checkpolicy* libsepol* libsemanage* libselinux*
>>>>> policycoreutils* selinux-policy-targeted
>>>>>
>>>>> # Clear prior source/CIL policy store.
>>>>> rm -rf /var/lib/selinux
>>>>>
>>>>> # Reboot to ensure systemd and friends are using the new policy.
>>>>> reboot
>>>>>
>>>>> # Reset selinux and cil to latest sources
>>>>> cd selinux
>>>>> git clean -fdx
>>>>> git fetch origin
>>>>> git reset --hard origin/integration
>>>>> cd ../cil
>>>>> git clean -fdx
>>>>> git fetch origin
>>>>> git reset --hard origin/master
>>>>>
>>>>> # Build and install new userspace
>>>>> cd ..
>>>>> ln -sf ../../cil selinux/libsepol/cil
>>>>> make -C selinux LIBDIR=/usr/lib64 SHLIBDIR=/lib64 install install-pywrap
>>>>> relabel
>>>>>
>>>>> # Convert
>>>>>  ./selinux/libsemanage/utils/semanage_migrate_etc_to_var.py
>>>>>
>>>>> Try to login on console or via ssh:  Unable to get valid context for sds.
>>>>>
>>>>> dmesg | grep systemd
>>>>> [  343.739985] systemd[1]: SELinux policy denies access.
>>>>> [  348.256030] systemd[1]: SELinux policy denies access.
>>>>> [  376.335248] systemd[1]: SELinux policy denies access.
>>>>> [  376.515343] systemd[1]: SELinux policy denies access.
>>>>>
>>>>> restorecon -R /etc/selinux/targeted
>>>>>
>>>>> Try to login again, hangs for a long time before finally succeeding.
>>>>>
>>>>> reboot
>>>>>
>>>>> Everything is happy.
>>>>>
>>>>> 100% reproducible, every time.
>>>>>
>>>>>
>>>>
>>>> Thanks for the steps. I think I found what causes the labeling problem,
>>>> but I'm not yet sure why. It looks like it has something to do with how
>>>> the migration script rebuilds policy. If you run the migration script
>>>> with the --norebuild flag, and then run semodule -B, everything is
>>>> rebuilt and the files in /etc/selinux are labeled correctly.
>>>>
>>>> I'm not yet convinced this is the same problem as the systemd issue (I
>>>> do get "unable to get valid context", but I still don't get "SELinux
>>>> policy denies access"). Let me know if you still see that after using
>>>> --norebuild/semodule -B.
>>>
>>> Ok, if I do:
>>> ./libsemanage/utils/semanage_migrate_etc_to_var.py -n
>>> semodule -B
>>>
>>> then /etc/selinux is labeled correctly and I can still login.
>>> However, running su hangs and I get the systemd error message again.
>>
>> Also get this:
>> ERROR:dbus.proxies:Introspect error on :1.4:/org/freedesktop/login1:
>> dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did
>> not receive a reply. Possible causes include: the remote application did
>> not send a reply, the message bus security policy blocked the reply, the
>> reply timeout expired, or the network connection was broken.
>>
>> when trying to re-install the original selinux userspace packages.
>> With more errors from systemd in dmesg,
>> [14421.297045] systemd[1]: SELinux policy denies access.
>> [14451.711732] systemd[1]: SELinux policy denies access.
>> [14451.743787] systemd[1]: SELinux policy denies access.
>> [14512.551210] systemd[1]: SELinux policy denies access.
>> [14512.584126] systemd[1]: SELinux policy denies access.
>> [14543.063872] systemd[1]: SELinux policy denies access.
>> [14634.451680] systemd[1]: SELinux policy denies access.
>> [14634.469813] systemd[1]: SELinux policy denies access.
>> [14659.346867] systemd[1]: SELinux policy denies access.
>> [14659.665108] systemd[1]: SELinux policy denies access.
>> [14695.602174] systemd[1]: SELinux policy denies access.
> 
> journalctl -r shows an additional error message for each of these denials:
> systemd-logind[913]: Failed to query ActiveState: Access denied

ausearch -m USER_AVC reports:
type=USER_AVC msg=audit(1405520109.191:1031): pid=1 uid=0
auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0
msg='avc:  denied  { status } for auid=-1 uid=-1 gid=-1
scontext=system_u:system_r:systemd_logind_t:s0
tcontext=system_u:system_r:init_t:s0 tclass=service
exe="/usr/lib/systemd/systemd" sauid=0 hostname=? addr=? terminal=?'

  reply	other threads:[~2014-07-16 14:33 UTC|newest]

Thread overview: 85+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-09 19:21 [RFC] Source Policy, CIL, and High Level Languages Steve Lawrence
2014-07-10  6:51 ` Dominick Grift
2014-07-10 12:19   ` Steve Lawrence
2014-07-10 12:35   ` Stephen Smalley
2014-07-10 12:52     ` Dominick Grift
2014-07-10 13:09       ` Dominick Grift
2014-07-10 13:12         ` Stephen Smalley
2014-07-10 13:26           ` Dominick Grift
2014-07-10 13:38             ` Stephen Smalley
2014-07-10 13:45               ` Dominick Grift
2014-07-11 15:02                 ` Steve Lawrence
2014-07-15 20:11                   ` Steve Lawrence
2014-07-10 15:02             ` Stephen Smalley
2014-07-11 17:20   ` Steve Lawrence
2014-07-14 16:48     ` Stephen Smalley
2014-07-14 16:53       ` Stephen Smalley
2014-07-14 17:08         ` Stephen Smalley
2014-07-14 17:12           ` Steve Lawrence
2014-07-14 17:49             ` Stephen Smalley
2014-07-15 19:56               ` Steve Lawrence
2014-07-16 14:16                 ` Stephen Smalley
2014-07-16 14:21                   ` Stephen Smalley
2014-07-16 14:26                     ` Stephen Smalley
2014-07-16 14:33                       ` Stephen Smalley [this message]
2014-07-16 15:11                         ` Steve Lawrence
2014-07-16 15:53                           ` Dominick Grift
2014-07-16 15:58                             ` Dominick Grift
2014-07-16 19:00                             ` Stephen Smalley
2014-07-17 13:49                               ` Steve Lawrence
2014-07-17 14:02                                 ` Stephen Smalley
2014-07-17 18:02                                 ` Stephen Smalley
2014-07-17 18:58                                   ` Steve Lawrence
2014-07-17 19:10                                     ` Stephen Smalley
2014-07-17 19:48                                       ` Stephen Smalley
2014-07-17 20:04                                         ` Steve Lawrence
2014-07-17 20:37                                           ` Stephen Smalley
2014-07-17 20:50                                             ` Daniel J Walsh
2014-07-17 20:52                                             ` Daniel J Walsh
2014-07-23 19:24                                               ` Stephen Smalley
2014-07-24 12:48                                                 ` Daniel J Walsh
2014-07-18 12:59                                             ` Steve Lawrence
2014-07-18 14:30                                               ` Stephen Smalley
2014-07-18 15:57                                                 ` Steve Lawrence
2014-07-22 15:05                                               ` James Carter
2014-07-18 14:13                                             ` Christopher J. PeBenito
2014-07-17 19:51                                       ` Steve Lawrence
2014-07-22 14:47                                     ` James Carter
2014-07-16 15:43                 ` Steve Lawrence
2014-07-14 17:33           ` Dominick Grift
2014-07-18 16:00   ` Steve Lawrence
2014-07-18 18:10     ` Stephen Smalley
2014-07-21 14:34       ` Steve Lawrence
2014-07-21 14:51         ` Stephen Smalley
2014-07-21 17:50           ` Steve Lawrence
2014-08-01 14:51             ` Steve Lawrence
2014-08-01 17:46               ` Stephen Smalley
2014-08-04 14:07                 ` Steve Lawrence
2014-08-18 22:37                 ` Steve Lawrence
2014-07-10 13:52 ` Stephen Smalley
2014-07-10 14:06   ` Dominick Grift
2014-07-10 14:09   ` Steve Lawrence
2014-07-10 14:58     ` James Carter
2014-07-10 13:59 ` Stephen Smalley
2014-07-10 14:53   ` Steve Lawrence
2014-07-10 14:11 ` Stephen Smalley
2014-07-10 14:13   ` Stephen Smalley
2014-07-10 14:17   ` Steve Lawrence
2014-07-10 14:20     ` Stephen Smalley
2014-07-10 14:23   ` Dominick Grift
2014-07-10 14:25     ` Stephen Smalley
2014-07-10 14:34       ` Stephen Smalley
2014-07-10 14:50         ` Dominick Grift
2014-07-10 14:43       ` Dominick Grift
2014-07-10 14:30 ` Stephen Smalley
2014-07-10 14:50   ` Stephen Smalley
2014-07-10 15:05     ` Steve Lawrence
2014-07-10 15:08       ` Stephen Smalley
2014-07-10 16:04   ` Steve Lawrence
  -- strict thread matches above, loose matches on Subject: below --
2014-04-29 14:59 Steve Lawrence
2014-05-01 12:38 ` Dominick Grift
2014-05-01 12:57   ` Steve Lawrence
2014-05-01 13:24     ` Dominick Grift
2014-05-01 13:27       ` Dominick Grift
2014-05-01 13:31         ` Dominick Grift
2014-05-01 14:01           ` Steve Lawrence

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=53C68D40.8020700@tycho.nsa.gov \
    --to=sds@tycho.nsa.gov \
    --cc=dominick.grift@gmail.com \
    --cc=selinux@tycho.nsa.gov \
    --cc=slawrence@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 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.