All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dominick Grift <dominick.grift@defensec.nl>
To: Russell Coker <russell@coker.com.au>
Cc: selinux-refpolicy@vger.kernel.org
Subject: Re: /dev/full
Date: Mon, 28 Sep 2026 15:34:42 +0200	[thread overview]
Message-ID: <8733ut4hzh.fsf@defensec.nl> (raw)
In-Reply-To: <boy70xcMSuOXxCPC9lDhNw@coker.com.au> (Russell Coker's message of "Mon, 28 Sep 2026 23:18:32 +1000")

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

> On Monday, 28 September 2026 22:21:32 AEST Dominick Grift wrote:
>> >> Thanks for that, it was a default trans rule.  I'll add a named
>> >> transition
>> >> for /dev/full
>> > 
>> > That doesn't seem to work.
>> > 
>> > root@ami:~# sesearch -T -c chr_file|grep null
>> > type_transition kernel_t device_t:chr_file null_device_t full;
>> > root@ami:~# dmesg|grep event_device_t
>> > [    3.269252] audit: type=1400 audit(1790597162.343:4): avc:  denied  {
>> > write } for  pid=330 comm="modprobe" name="full" dev="devtmpfs" ino=7
>> > scontext=system_u:system_r:kmod_t:s0
>> > tcontext=system_u:object_r:event_device_t:s0 tclass=chr_file permissive=0
>> > [    3.272938] audit: type=1400 audit(1790597162.343:5): avc:  denied  {
>> > write } for  pid=332 comm="modprobe" name="full" dev="devtmpfs" ino=7
>> > scontext=system_u:system_r:kmod_t:s0
>> > tcontext=system_u:object_r:event_device_t:s0 tclass=chr_file permissive=0
>> 
>> What is the context associated with the init sid? Maybe that is actually
>> creating it then?
>
> That's an interesting question, I get the following message in dmesy.
>
> [   10.940969] systemd[1]: Failed to transition into init label 
> 'system_u:system_r:init_t:s0', ignoring: Permission denied

Interesting but I dont think that is related. Maybe a
setcurrent/dyntransition is missing there.

>
> The following is the policy line you are probably interested in:
>
> policy/modules/kernel/kernel.te:sid init 
> gen_context(system_u:system_r:init_t,mls_systemhigh)

You could try: type_transition kernel_t device_t:chr_file null_device_t
full;

My reasoning:

1. whatever creates that /dev/full with event_device_t is very early
because otherwise udev and pid1 would have relabeled it by the time the
event happened.

2. That leaves either kernel_t or init_t. Some stuff that now runs in
init_t used to run in kernel_t previously. If its not kernel_t then that
leaves us with init_t.

-- 
gpg --auto-key-locate clear,nodefault,wkd --locate-external-keys dominick.grift@defensec.nl
Key fingerprint = FCD2 3660 5D6B 9D27 7FC6  E0FF DA7E 521F 10F6 4098
Dominick Grift
Mastodon: @kcinimod@defensec.nl

      reply	other threads:[~2026-09-28 13:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-28  1:28 /dev/full Russell Coker
2026-09-28  4:28 ` /dev/full Dominick Grift
2026-09-28 10:09   ` /dev/full Russell Coker
2026-09-28 10:20     ` /dev/full Dominick Grift
2026-09-28 10:34       ` /dev/full Dominick Grift
2026-09-28 11:58         ` /dev/full Russell Coker
2026-09-28 12:10           ` /dev/full Russell Coker
2026-09-28 12:21             ` /dev/full Dominick Grift
2026-09-28 13:18               ` /dev/full Russell Coker
2026-09-28 13:34                 ` Dominick Grift [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=8733ut4hzh.fsf@defensec.nl \
    --to=dominick.grift@defensec.nl \
    --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
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.