lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 29 Nov 2018 17:22:47 -0500
From:   Daniel Walsh <dwalsh@...hat.com>
To:     Miklos Szeredi <miklos@...redi.hu>,
        Stephen Smalley <sds@...ho.nsa.gov>
Cc:     Vivek Goyal <vgoyal@...hat.com>,
        Ondrej Mosnacek <omosnace@...hat.com>,
        "J. Bruce Fields" <bfields@...ldses.org>,
        Mark Salyzyn <salyzyn@...roid.com>,
        Paul Moore <paul@...l-moore.com>, linux-kernel@...r.kernel.org,
        overlayfs <linux-unionfs@...r.kernel.org>,
        linux-fsdevel@...r.kernel.org, selinux@...r.kernel.org
Subject: Re: overlayfs access checks on underlying layers

On 11/29/18 2:47 PM, Miklos Szeredi wrote:
> On Thu, Nov 29, 2018 at 5:14 PM Stephen Smalley <sds@...ho.nsa.gov> wrote:
>
>> Possibly I misunderstood you, but I don't think we want to copy-up on
>> permission denial, as that would still allow the mounter to read/write
>> special files or execute regular files to which it would normally be
>> denied access, because the copy would inherit the context specified by
>> the mounter in the context mount case.  It still represents an
>> escalation of privilege for the mounter.  In contrast, the copy-up on
>> write behavior does not allow the mounter to do anything it could not do
>> already (i.e. read from the lower, write to the upper).
> Let's get this straight:  when file is copied up, it inherits label
> from context=, not from label of lower file?

Yes, in the case of context mount, it will get the context mount directory.

In the case of not context mount, it should maintain the label of  the
lower.

>
> Next question: permission to change metadata is tied to permission to
> open?  Is it possible that open is denied, but metadata can be
> changed?
Yes, SElinux handles open differently then setattr.  Although I am not
sure if any tools handle this.
> DAC model allows this: metadata change is tied to ownership, not mode
> bits.   And different capability flag.
>
> If the same is true for MAC, then the pre-v4.20-rc1 is already
> susceptible to the privilege escalation you describe, right?
>
> Thanks,
> Miklos

After talking to Vivek, I am not sure their is a privilege escallation.


For device nodes, the mounter has to have the ability to create the
devicenode with the context mount, if he can do this, then he can do it
with or without Overlay.  This might lead to users making mistakes on
security, but the model is sound. And I think this stands even in the
case of the lower is mounted NODEV and the upper is not.  If the mounter
can create a device on the upper with a particular label, then he does
not need the lower.


For sockets, I see the case where a process is listening on the lower
level socket, the mounter mounts the overlay over the directory with the
socket.  Then the mounter changes the attributes of the socket,
performing a copy up.  If the mounter can not talk to the socket and the
other end is still listening, then this could be an issue.  If the
socket is no longer connected to the listener on the lower, then this is
not an issue.


Similar for a FIFO.


With SELinux we are also always checking not only the file access to the
socker, but also checking whether the label of the client is able to
talk to the label of the server daemon.  So we are protected by a
secondary check.





Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ