SELinux Security Module development
 help / color / mirror / Atom feed
From: Topi Miettinen <toiwoton@gmail.com>
To: Paul Moore <paul@paul-moore.com>
Cc: SElinux list <selinux@vger.kernel.org>
Subject: Re: Strange AVC denials without effect
Date: Fri, 3 Jul 2020 21:16:41 +0300	[thread overview]
Message-ID: <550612f8-c1d0-bd1b-d5a1-cae24e7c31c0@gmail.com> (raw)
In-Reply-To: <CAHC9VhSjso7KxFjUYPDZWKzo8ukLjSSg4WZ2nkCyOSA8hdBGNA@mail.gmail.com>

On 3.7.2020 16.49, Paul Moore wrote:
> On Fri, Jul 3, 2020 at 6:28 AM Topi Miettinen <toiwoton@gmail.com> wrote:
>>
>> Hello,
>>
>> I renamed SELinux packet types and also without using type attributes
>> (like packet_type etc), so that refpolicy TE rules for packets should
>> not apply. Then I added new rules for the new types one by one as they
>> were needed. But there are lots of audit entries which would seem to
>> indicate that kernel_t is prevented from sending packets:
>>
>> type=AVC msg=audit(1593770235.180:3222): avc:  denied  { send } for
>> pid=408 comm="irq/30-iwlwifi" saddr=10.0.0.3 daddr=1.1.1.1 netif=wlan0
>> scontext=system_u:system_r:kernel_t:s0
>> tcontext=system_u:object_r:my_dns_client_packet_t:s0 tclass=packet
>> permissive=0
>>
>> In reality, the packets are sent. But kernel_t is not permissive and
>> there should not be any rules which would allow the action, so shouldn't
>> this prevent packet transmission?
> 
> Hmm, that is interesting.  Are you 100% certain that the packets which
> are the source of this AVC denial are the ones being sent over the
> wire(less)?
I don't know. The application sending the packets is very likely 
systemd-resolved. What could be the reason for packets originating from 
kernel_t instead of systemd_resolved_t?

 > Based on the permission, this is coming from the SELinux
> postroute hooks which simply return a DROP to the netfilter code, so
> if the packet is really getting sent it might be a case where the
> kernel is ignoring the netfilter hooks ... and that seems fairly
> unlikely to me.

Perhaps the check is fine but packet is incorrectly considered to be 
sent by the kernel (sk == NULL in security/selinux/hooks.c:5728)? Or 
perhaps it is, since the process is "irq/30-iwlwifi"?

> What kernel are you using?

Debian 5.7.0-1-amd64.

-Topi

  reply	other threads:[~2020-07-03 18:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-03 10:28 Strange AVC denials without effect Topi Miettinen
2020-07-03 13:49 ` Paul Moore
2020-07-03 18:16   ` Topi Miettinen [this message]
2020-07-04 13:15   ` Topi Miettinen

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=550612f8-c1d0-bd1b-d5a1-cae24e7c31c0@gmail.com \
    --to=toiwoton@gmail.com \
    --cc=paul@paul-moore.com \
    --cc=selinux@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox