SELinux-Refpolicy Archive on lore.kernel.org
 help / color / Atom feed
From: Topi Miettinen <toiwoton@gmail.com>
To: Dominick Grift <dac.override@gmail.com>,
	Russell Coker <russell@coker.com.au>
Cc: selinux-refpolicy@vger.kernel.org
Subject: Re: /run/systemd/inaccessible
Date: Thu, 27 Feb 2020 20:13:29 +0200
Message-ID: <a908d824-8503-73ab-0d8f-d2465c06d1de@gmail.com> (raw)
In-Reply-To: <87zhd4b4ri.fsf@gmail.com>

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
> 


      reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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   ` Topi Miettinen [this message]

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=a908d824-8503-73ab-0d8f-d2465c06d1de@gmail.com \
    --to=toiwoton@gmail.com \
    --cc=dac.override@gmail.com \
    --cc=russell@coker.com.au \
    --cc=selinux-refpolicy@vger.kernel.org \
    /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

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