New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 754831 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Dec 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug



Sign in to add a comment

ARC++ fails to start with 4.12 and later kernels due to selinux permission problems

Project Member Reported by groeck@chromium.org, Aug 11 2017

Issue description

Attempts to start ARC++ on a 4.12 kernel fails with the following messages seen in the kernel log (dmesg).

[   58.950400] audit: type=1400 audit(1502477548.043:4): avc:  denied  { sys_admin } for  pid=3255 comm="init" capability=21  scontext=u:r:init:s0 tcontext=u:r:init:s0 tclass=cap_userns permissive=0
[   58.972559] audit: type=1400 audit(1502477548.065:5): avc:  denied  { sys_admin } for  pid=3255 comm="init" capability=21  scontext=u:r:init:s0 tcontext=u:r:init:s0 tclass=cap_userns permissive=0
[   58.993893] audit: type=1400 audit(1502477548.086:6): avc:  denied  { chown } for  pid=3255 comm="init" capability=0  scontext=u:r:init:s0 tcontext=u:r:init:s0 tclass=cap_userns permissive=0
[   59.015425] audit: type=1400 audit(1502477548.107:7): avc:  denied  { chown } for  pid=3255 comm="init" capability=0  scontext=u:r:init:s0 tcontext=u:r:init:s0 tclass=cap_userns permissive=0
[   59.035438] audit: type=1400 audit(1502477548.107:8): avc:  denied  { chown } for  pid=3255 comm="init" capability=0  scontext=u:r:init:s0 tcontext=u:r:init:s0 tclass=cap_userns permissive=0
[   59.056411] audit: type=1400 audit(1502477548.107:9): avc:  denied  { chown } for  pid=3255 comm="init" capability=0  scontext=u:r:init:s0 tcontext=u:r:init:s0 tclass=cap_userns permissive=0
[   59.076411] audit: type=1400 audit(1502477548.168:10): avc:  denied  { sys_admin } for  pid=3255 comm="init" capability=21  scontext=u:r:init:s0 tcontext=u:r:init:s0 tclass=cap_userns permissive=0
[   59.097420] audit: type=1400 audit(1502477548.189:11): avc:  denied  { sys_admin } for  pid=3255 comm="init" capability=21  scontext=u:r:init:s0 tcontext=u:r:init:s0 tclass=cap_userns permissive=0
[   59.132156] audit: type=1400 audit(1502477548.224:12): avc:  denied  { chown } for  pid=3255 comm="init" capability=0  scontext=u:r:init:s0 tcontext=u:r:init:s0 tclass=cap_userns permissive=0
[   59.152407] audit: type=1400 audit(1502477548.244:13): avc:  denied  { sys_admin } for  pid=3255 comm="init" capability=21  scontext=u:r:init:s0 tcontext=u:r:init:s0 tclass=cap_userns permissive=0
[  355.644888] init: arc-network main process (3257) killed by ABRT signal

Workaround is to set "SELINUX=permissive" in /etc/selinux/config.

 

Comment 1 by groeck@chromium.org, Aug 15 2017

Cc: dtor@chromium.org diand...@chromium.org
Cc: lhchavez@chromium.org briannorris@chromium.org jorgelo@chromium.org
What's your kernel config?  In Chrome OS we use permissive mode:

chromeos/config/base.config:CONFIG_SECURITY_SELINUX_PERMISSIVE_DONTAUDIT=y

That appears to be a Chrome OS specific config.  See <https://chromium-review.googlesource.com/425786>.  I don't know how it was done before then...

+folks who I know were involved in SE Linux Permissive Stuff and hopefully they can comment.  


Comment 3 by groeck@chromium.org, Aug 16 2017

#2: Yes, that is correct, and it is so configured. From chromeos-4.12:

chromeos/config/base.config:CONFIG_SECURITY_SELINUX_PERMISSIVE_DONTAUDIT=y

Nevertheless, I have to apply the workaround to get it working. If I understand the code correctly, this is as expected. The flag doesn't really do much and appears to depend on 'permissive'. See its use and associated comments in security/selinux/avc.c.

What "workaround" are you referring to?
Yes, that flag is meant to quiesce the log from permissive logspam. It does not change behavior.

can you also share /var/log/arc-network.log?

Comment 6 by groeck@chromium.org, Aug 16 2017

#5: See description: "Workaround is to set "SELINUX=permissive" in /etc/selinux/config."

Comment 7 by groeck@chromium.org, Aug 16 2017

arc-network.log:

017-08-15 14:38:33.576150280-07:00: Starting arc-network
+ ip link delete veth_android
Cannot find device "veth_android"
+ true
+ ip link add veth_android type veth peer name slave_android
+ ip link set dev slave_android addr 00:FF:AA:00:00:55
+ ifconfig veth_android up
+ brctl addif br0 veth_android
+ readlink /proc/1/ns/net
+ init_ns=net:[4026531961]
+ seq 1 50
+ [ -d /proc/11788 ]
+ readlink /proc/11788/ns/net
+ ns=net:[4026532572]
+ [ -n net:[4026532572] -a net:[4026532572] != net:[4026531961] ]
+ break
+ ip link set slave_android netns 11788
+ nsenter -t 11788 -n -- ip link set slave_android name arc0
+ initctl emit start-arc-sensor CONTAINER_PATH=/run/containers/android_hsJo5G
+ touch /run/containers/android_hsJo5G/root/dev/.coldboot_done
+ sysctl net.ipv6.conf.all.forwarding=1
net.ipv6.conf.all.forwarding = 1
+ sysctl net.ipv6.conf.all.proxy_ndp=1
net.ipv6.conf.all.proxy_ndp = 1
+ chown 655360:655360 /sys/class/xt_idletimer
+ initctl start -n arc-obb-mounter
arc-obb-mounter start/starting
+ initctl start -n arc-removable-media
arc-removable-media start/starting
+ exec /usr/bin/arc-networkd --con_netns=11788

Cc: teravest@chromium.org
Cc: bmgordon@chromium.org
Owner: bmgordon@chromium.org
Status: Started (was: Untriaged)
It looks like the problem is commit 8e4ff6f228e4722cac74db716e308d1da33d744f that went into 4.7. It splits selinux capability checks based on whether you're in the initial user namespace or not.  Working on a list of sepolicy changes needed for compatibility.

Project Member

Comment 11 by bugdroid1@chromium.org, Nov 3 2017

Project Member

Comment 12 by bugdroid1@chromium.org, Nov 17 2017

Labels: Kernel-4.14
Summary: ARC++ fails to start with 4.12 and later kernels due to selinux permission problems (was: ARC++ fails to start with 4.12 kernels due to selinux permission problems)
The workaround as committed in #11 and #12 results in a test failure:

[Test-Logs]: cheets_SELinuxTest: retry_count: 2, FAIL: Unexpected value: Expected: Enforcing, Actual: Permissive

Labels: -Pri-2 Pri-1
Raising priority. This is a must have for chromeos-4.14 release.

aosp/538523 is out with the changes needed for 4.12 on android-master.  Once that goes in, I'll cherry-pick it back to the arc-nyc branch, and that should cover 4.12.  I have another couple of CLs in progress to cover the additional breakage that 4.14 introduces.
bmgordon@: Excellent - thanks for making this happen!
Project Member

Comment 17 by bugdroid1@chromium.org, Nov 20 2017

Cc: cra...@chromium.org
http://ag/3265696 and http://ag/3265725 are merged.  Once they show up in an ARC++ release, we should be able to boot 4.12 with selinux in enforcing mode.  I'm starting to working on the additional changes needed for 4.14.
http://ag/3313865 should fix 4.14.  Once that gets through the PFQ, I'll remove the workaround from crrev.com/i/494314 and mark this fixed.
Project Member

Comment 21 by bugdroid1@chromium.org, Dec 9 2017

Project Member

Comment 22 by bugdroid1@chromium.org, Dec 15 2017

Status: Fixed (was: Started)

Sign in to add a comment