SELinux-Refpolicy Archive on lore.kernel.org
 help / color / Atom feed
* /run/systemd/inaccessible
@ 2020-02-27 10:39 Russell Coker
  2020-02-27 12:20 ` /run/systemd/inaccessible Dominick Grift
  0 siblings, 1 reply; 3+ messages in thread
From: Russell Coker @ 2020-02-27 10:39 UTC (permalink / raw)
  To: selinux-refpolicy

allow systemd_logind_t init_var_run_t:chr_file write;

audit2allow shows me that the above is attempted on Debian/Unstable.  What's 
this inaccessible directory about anyway?

# ls -lZ /run/systemd/inaccessible
total 0
b---------. 1 root root system_u:object_r:init_var_run_t:s0 0, 0 Feb 27 13:36 
blk
c---------. 1 root root system_u:object_r:init_var_run_t:s0 0, 0 Feb 27 13:36 
chr
d---------. 2 root root system_u:object_r:init_var_run_t:s0   40 Feb 27 13:36 
dir
p---------. 1 root root system_u:object_r:init_var_run_t:s0    0 Feb 27 13:36 
fifo
----------. 1 root root system_u:object_r:init_var_run_t:s0    0 Feb 27 13:36 
reg
s---------. 1 root root system_u:object_r:init_var_run_t:s0    0 Feb 27 13:36 
sock

-- 
My Main Blog         http://etbe.coker.com.au/
My Documents Blog    http://doc.coker.com.au/


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: /run/systemd/inaccessible
  2020-02-27 10:39 /run/systemd/inaccessible Russell Coker
@ 2020-02-27 12:20 ` Dominick Grift
  2020-02-27 18:13   ` /run/systemd/inaccessible Topi Miettinen
  0 siblings, 1 reply; 3+ messages in thread
From: Dominick Grift @ 2020-02-27 12:20 UTC (permalink / raw)
  To: Russell Coker; +Cc: selinux-refpolicy

Russell Coker <russell@coker.com.au> writes:

> allow systemd_logind_t init_var_run_t:chr_file write;
>
> audit2allow shows me that the above is attempted on Debian/Unstable.  What's 
> this inaccessible directory about anyway?

systemd-userruntimedir (245) now also creates it in /run/user/%{USERID}

probably used for InaccessiblePath= directive but I am not sure.

>
> # ls -lZ /run/systemd/inaccessible
> total 0
> b---------. 1 root root system_u:object_r:init_var_run_t:s0 0, 0 Feb 27 13:36 
> blk
> c---------. 1 root root system_u:object_r:init_var_run_t:s0 0, 0 Feb 27 13:36 
> chr
> d---------. 2 root root system_u:object_r:init_var_run_t:s0   40 Feb 27 13:36 
> dir
> p---------. 1 root root system_u:object_r:init_var_run_t:s0    0 Feb 27 13:36 
> fifo
> ----------. 1 root root system_u:object_r:init_var_run_t:s0    0 Feb 27 13:36 
> reg
> s---------. 1 root root system_u:object_r:init_var_run_t:s0    0 Feb 27 13:36 
> sock

-- 
Key fingerprint = FCD2 3660 5D6B 9D27 7FC6  E0FF DA7E 521F 10F6 4098
https://sks-keyservers.net/pks/lookup?op=get&search=0xDA7E521F10F64098
Dominick Grift

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: /run/systemd/inaccessible
  2020-02-27 12:20 ` /run/systemd/inaccessible Dominick Grift
@ 2020-02-27 18:13   ` Topi Miettinen
  0 siblings, 0 replies; 3+ messages in thread
From: Topi Miettinen @ 2020-02-27 18:13 UTC (permalink / raw)
  To: Dominick Grift, Russell Coker; +Cc: selinux-refpolicy

On 27.2.2020 14.20, Dominick Grift wrote:
> Russell Coker <russell@coker.com.au> writes:
> 
>> allow systemd_logind_t init_var_run_t:chr_file write;
>>
>> audit2allow shows me that the above is attempted on Debian/Unstable.  What's
>> this inaccessible directory about anyway?
> 
> systemd-userruntimedir (245) now also creates it in /run/user/%{USERID}

The relevant code has this comment:

/* Set up inaccessible nodes now so they're available if we decide to 
use them with user namespaces. */

> probably used for InaccessiblePath= directive but I am not sure.

Yes, these are bind mounted over the path which is wanted inaccessible. 
Perhaps this could be improved by giving them a dedicated label and then 
some new TE rules could prevent anything other than PID1 from managing 
them. Now if a service has CAP_SYS_ADMIN and is not blocked by seccomp 
filters from using mount and umount system calls, it could dismantle the 
bind mount.

-Topi

>>
>> # ls -lZ /run/systemd/inaccessible
>> total 0
>> b---------. 1 root root system_u:object_r:init_var_run_t:s0 0, 0 Feb 27 13:36
>> blk
>> c---------. 1 root root system_u:object_r:init_var_run_t:s0 0, 0 Feb 27 13:36
>> chr
>> d---------. 2 root root system_u:object_r:init_var_run_t:s0   40 Feb 27 13:36
>> dir
>> p---------. 1 root root system_u:object_r:init_var_run_t:s0    0 Feb 27 13:36
>> fifo
>> ----------. 1 root root system_u:object_r:init_var_run_t:s0    0 Feb 27 13:36
>> reg
>> s---------. 1 root root system_u:object_r:init_var_run_t:s0    0 Feb 27 13:36
>> sock
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-27 10:39 /run/systemd/inaccessible Russell Coker
2020-02-27 12:20 ` /run/systemd/inaccessible Dominick Grift
2020-02-27 18:13   ` /run/systemd/inaccessible Topi Miettinen

SELinux-Refpolicy Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/selinux-refpolicy/0 selinux-refpolicy/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 selinux-refpolicy selinux-refpolicy/ https://lore.kernel.org/selinux-refpolicy \
		selinux-refpolicy@vger.kernel.org
	public-inbox-index selinux-refpolicy

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.selinux-refpolicy


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git