Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1625798 > unrolled thread

Potential bug in path handling

Started by"iceboy" <iceboy@iceboy.org>
First post2017-04-19 05:10 +0200
Last post2017-04-19 05:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  Potential bug in path handling "iceboy" <iceboy@iceboy.org> - 2017-04-19 05:10 +0200

#1625798 — Potential bug in path handling

From"iceboy" <iceboy@iceboy.org>
Date2017-04-19 05:10 +0200
SubjectPotential bug in path handling
Message-ID<txOae-6sx-9@gated-at.bofh.it>
I found this while writing a simple sandbox. Script to reproduce: https://gist.github.com/iceb0y/93e77e6945019d8a863b452e18a18079

In the `bugbox`:

bugbox-4.3$ ls bin
(you get the files in /bin)

however

bugbox-4.3$ ls ../bin
(nothing)

Tried with latest 4.11 kernel. The problem occurs when you bind mount `/` to itself, and then remount it. Looks like one of the mount namespace, bind mount or pivot_root is mishandling root barrier, causing `../bin` referencing to the `bin` directory instead of the bind mount. This could be a security problem.

Any idea on what's the problem, or how to debug this?

* Dependencies of `bugbox`:
python 2 or 3
the `butter` package for syscall (sorry)
/bin /lib and /lib64 on your system are real, not symlinks

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web