Linux Container Development
 help / color / mirror / Atom feed
From: Jann Horn <jann-XZ1E9jl8jIdeoWH0uzbU5w@public.gmane.org>
To: Gandalf Corvotempesta
	<gandalf.corvotempesta-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	Eric Biederman <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
Subject: Re: Escape from a bind mount
Date: Thu, 22 Sep 2016 15:48:33 +0200	[thread overview]
Message-ID: <20160922134833.GC20504@pc.thejh.net> (raw)
In-Reply-To: <CAJH6TXje-Zb54scg8-UTchZEa2RCOGVdaB0DQ_ipbJtNEAPPGA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>


[-- Attachment #1.1: Type: text/plain, Size: 1348 bytes --]

On Thu, Sep 22, 2016 at 03:31:45PM +0200, Gandalf Corvotempesta wrote:
> 2016-09-22 15:02 GMT+02:00 Jann Horn <jann-XZ1E9jl8jIdeoWH0uzbU5w@public.gmane.org>:
> > This was fixed by Eric Biederman in the "Bind mount escape fixes" patch series
> > in August 2015.
> > Relevant commits are 397d425d and cde93be4 (maybe more? I'm not sure).
> 
> So, now is not possible to escape from bind ? There was a reference to
> this in official Docker docs.

It shouldn't be possible to escape from bind mounts anymore. That was a
bug, and it was fixed.
Where do the docs mention this? We should probably ask them to fix that.


> Just for my info: to escape from the container, an attacker would have
> to move the bound directory directly from the host? Having access only
> to the container would't make this issue happen ?
> In example, if I have bound as follow:
>    /mnt/dir1 => /home/myuser/path_inside_container
> 
> moving (from the host) /mnt/dir1 to somewhere else like /tmp/dir1 will
> make the container able to escape ?

No. If you had namespaced root privileges in a container, it was also
possible to trigger the bug from inside the container.
But really, that shouldn't be an issue for you anymore, considering
that this was fixed a year ago and was apparently also backported to
stable kernels. Why are you asking?

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 205 bytes --]

_______________________________________________
Containers mailing list
Containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
https://lists.linuxfoundation.org/mailman/listinfo/containers

  parent reply	other threads:[~2016-09-22 13:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-22 12:49 Escape from a bind mount Gandalf Corvotempesta
     [not found] ` <CAJH6TXhzy4XAQKaKjrK5Yqzg0sxtPjU9D=X3AHZZ76N3Cpwkwg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-09-22 13:02   ` Jann Horn
     [not found]     ` <20160922130253.GB20504-J1fxOzX/cBvk1uMJSBkQmQ@public.gmane.org>
2016-09-22 13:31       ` Gandalf Corvotempesta
     [not found]         ` <CAJH6TXje-Zb54scg8-UTchZEa2RCOGVdaB0DQ_ipbJtNEAPPGA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-09-22 13:48           ` Jann Horn [this message]
     [not found]             ` <20160922134833.GC20504-J1fxOzX/cBvk1uMJSBkQmQ@public.gmane.org>
2016-09-22 13:57               ` Gandalf Corvotempesta
2016-09-22 14:23               ` Gandalf Corvotempesta
     [not found]                 ` <CAJH6TXi=G90x24ThdZAfZMhVRN86B0LS5R-WuCn+OtGsFNjm8Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-09-22 14:34                   ` Jann Horn

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=20160922134833.GC20504@pc.thejh.net \
    --to=jann-xz1e9jl8jideowh0uzbu5w@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org \
    --cc=gandalf.corvotempesta-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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