Skip to contentSkip to conversation

Discussion on setting the /proc/self/oom_score_adj file label.

DISCUSSION Daniel J Walsh 4 participants 6 messages Nov 1, 2016 SELinux security module

lore
Share & tools
lore
#0 lore raw

I wrote a blog http://danwalsh.livejournal.com/75282.html which talks about chrome sandbox and its attempt to change its parents oom_score_adj value. Which is labeled unconfined_t, the question has come up on Twitter to be able to change the label on just this object.

I think we discussed this before, but how difficult would it be to change individual file labels under /proc/self/?

#1 lore raw
Quoted 8 lines · Daniel J Walsh

I wrote a blog http://danwalsh.livejournal.com/75282.html which talks about chrome sandbox and its attempt to change its parents oom_score_adj value. Which is labeled unconfined_t, the question has come up on Twitter to be able to change the label on just this object.

I think we discussed this before, but how difficult would it be to change individual file labels under /proc/self/?

In this case the solution would probably be to just associate a private type with the parent chrome process, but I know you think that is "impossible".

Regardless I agree that it would be a nice feature. If it was available then i would probably use it to restrict access to /proc/self/mounts for my confined user shells if possible.

Quoted 8 lines

_______________________________________________
Selinux mailing list
[email protected]
To unsubscribe, send email to [email protected].
To get help, send an email containing "help" to [email protected].

Signature · 3 lines
Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8  02D5 3B6C 5F1D 2C7B 6B02
https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02
Dominick Grift
#2 lore raw
In reply to Daniel J Walsh
Quoted 7 lines · Daniel J Walsh

I wrote a blog http://danwalsh.livejournal.com/75282.html which talks about chrome sandbox and its attempt to change its parents oom_score_adj value. Which is labeled unconfined_t, the question has come up on Twitter to be able to change the label on just this object.

I think we discussed this before, but how difficult would it be to change individual file labels under /proc/self/?

Technically feasible, already on the kernel todo list,
https://github.com/SELinuxProject/selinux/wiki/Kernel-Todo

However, I agree with Dominick here - the parent shouldn't run in unconfined_t in the first place.

#3 lore raw
Quoted 11 lines · Stephen Smalley
Quoted 7 lines · Daniel J Walsh

I wrote a blog http://danwalsh.livejournal.com/75282.html which talks about chrome sandbox and its attempt to change its parents oom_score_adj value. Which is labeled unconfined_t, the question has come up on Twitter to be able to change the label on just this object.

I think we discussed this before, but how difficult would it be to change individual file labels under /proc/self/?

Technically feasible, already on the kernel todo list,
https://github.com/SELinuxProject/selinux/wiki/Kernel-Todo

Quoted 10 lines

However, I agree with Dominick here - the parent shouldn't run in unconfined_t in the first place.

_______________________________________________
Selinux mailing list
[email protected]
To unsubscribe, send email to [email protected].
To get help, send an email containing "help" to [email protected].

Sure, We could label chrome to run as some other label,but then you end up in multiple unconfined domains
running, or end up attempting to confine chrome, which is a loosing battle, in the general use case.

#4 lore raw
Quoted 24 lines · Daniel J Walsh
Quoted 11 lines · Stephen Smalley
Quoted 7 lines · Daniel J Walsh

I wrote a blog http://danwalsh.livejournal.com/75282.html which talks about chrome sandbox and its attempt to change its parents oom_score_adj value. Which is labeled unconfined_t, the question has come up on Twitter to be able to change the label on just this object.

I think we discussed this before, but how difficult would it be to change individual file labels under /proc/self/?

Technically feasible, already on the kernel todo list,
https://github.com/SELinuxProject/selinux/wiki/Kernel-Todo

Quoted 10 lines

However, I agree with Dominick here - the parent shouldn't run in unconfined_t in the first place.

_______________________________________________
Selinux mailing list
[email protected]
To unsubscribe, send email to [email protected].
To get help, send an email containing "help" to [email protected].

Quoted 4 lines

Sure, We could label chrome to run as some other label,but then you end up in multiple unconfined domains
running, or end up attempting to confine chrome, which is a loosing battle, in the general use case.

We have chrome and firefox confined in gentoo and have no problems. There are a set of booleans to allow it to read/write the entire homedir vs just ~/Downloads/ if you want that on. if you skipped the booleans and just give chromium_t userdom_manage_* then its pretty unconfined and would work out of the box.

Even if we had a way to set the label on just that one file, it'd still be unconfined_oom_score_t and then the sandbox would still be able to set it on every single process running in unconfined so theres no benefit anyway.

https://gitweb.gentoo.org/proj/hardened-refpolicy.git/tree/policy/modules/contrib/chromium.te#n331

meriadoc ~ # semanage boolean -l | grep chrom
chromium_bind_tcp_unreserved_ports (on , on) Allow chromium to bind to tcp ports
chromium_manage_all_user_content (off , off) Allow chromium to manage all user content (including content that is specific to an application, such as the configuration files of other applications in the users home directory). chromium_manage_generic_user_content (off , off) Allow chromium to manage generic user content (i.e. content that is not specific to an application).
chromium_read_all_user_content (off , off) Allow chromium to read all user content (including content that is specific to an application, such as the configuration files of other applications in the users home directory).

chromium_read_generic_user_content (on   ,   on)  Allow chromium to read generic user content (i.e. content that is not specific to an application).
chromium_read_system_info      (on   ,   on)  Allow chromium to read system information
chromium_rw_usb_dev            (on   ,   on)  Allow chromium to read/write USB devices

chromium_use_java (off , off) Allow the use of java plugins

-- Jason

#5 lore raw
Quoted 34 lines · Jason Zaman
Quoted 23 lines · Daniel J Walsh
Quoted 11 lines · Stephen Smalley
Quoted 7 lines · Daniel J Walsh

I wrote a blog http://danwalsh.livejournal.com/75282.html which talks about chrome sandbox and its attempt to change its parents oom_score_adj value. Which is labeled unconfined_t, the question has come up on Twitter to be able to change the label on just this object.

I think we discussed this before, but how difficult would it be to change individual file labels under /proc/self/?

Technically feasible, already on the kernel todo list,
https://github.com/SELinuxProject/selinux/wiki/Kernel-Todo

Quoted 10 lines

However, I agree with Dominick here - the parent shouldn't run in unconfined_t in the first place.

_______________________________________________
Selinux mailing list
[email protected]
To unsubscribe, send email to [email protected].
To get help, send an email containing "help" to [email protected].

Quoted 4 lines

Sure, We could label chrome to run as some other label,but then you end up in multiple unconfined domains
running, or end up attempting to confine chrome, which is a loosing battle, in the general use case.

We have chrome and firefox confined in gentoo and have no problems. There are a set of booleans to allow it to read/write the entire homedir vs just ~/Downloads/ if you want that on. if you skipped the booleans and just give chromium_t userdom_manage_* then its pretty unconfined and would work out of the box.

Quoted 4 lines

Even if we had a way to set the label on just that one file, it'd still be unconfined_oom_score_t and then the sandbox would still be able to set it on every single process running in unconfined so theres no benefit anyway.

I don't agree, while yes it would be able to set it on all processes in the users domain, it would bot be able to write
to the rest of /proc for all processes in the user space. Yes it could still cause the kernel to pick any user process
to be killed when under memory pressure.

I want people to OPT out of security not OPT In. While confining web browsers seems like a nice solution, I still believe
it breaks too many things which will cause more bugs. If I can incrementally increase the security of the desktop, without causing most of the users to turn off the security, I think this is better.

Quoted 13 lines

https://gitweb.gentoo.org/proj/hardened-refpolicy.git/tree/policy/modules/contrib/chromium.te#n331

meriadoc ~ # semanage boolean -l | grep chrom
chromium_bind_tcp_unreserved_ports (on , on) Allow chromium to bind to tcp ports
chromium_manage_all_user_content (off , off) Allow chromium to manage all user content (including content that is specific to an application, such as the configuration files of other applications in the users home directory). chromium_manage_generic_user_content (off , off) Allow chromium to manage generic user content (i.e. content that is not specific to an application).
chromium_read_all_user_content (off , off) Allow chromium to read all user content (including content that is specific to an application, such as the configuration files of other applications in the users home directory).

chromium_read_generic_user_content (on   ,   on)  Allow chromium to read generic user content (i.e. content that is not specific to an application).
chromium_read_system_info      (on   ,   on)  Allow chromium to read system information
chromium_rw_usb_dev            (on   ,   on)  Allow chromium to read/write USB devices

chromium_use_java (off , off) Allow the use of java plugins

-- Jason