# Re: \[PATCH RFC 0/1\] mount: universally disallow mounting over symlinks

- From: Aleksa Sarai \<hidden\>
- Date: 2020-01-02 09:09:55 
- List: linux-api
- Page: https://ratatoskr.run/linux-api/2020/01/169828
- Thread: https://ratatoskr.run/stable/2019/12/169751/t.md

```text
On 2020-01-02, David Laight [ref] wrote:
> From: Aleksa Sarai
> > Sent: 30 December 2019 08:32
> ...
> > I'm not sure I agree -- as I mentioned in my other mail, re-opening
> > through /proc/self/fd/$n works *very* well and has for a long time (in
> > fact, both LXC and runc depend on this working).
> 
> I thought it was marginally broken because it is followed as a symlink?
> On, for example, NetBSD /proc/<n>/fd/<n> is a real reference to the
> filesystem inode and can be used to link the file back into the filesystem
> if all the directory entries have been removed.

That is also the case on Linux. It (strictly speaking) isn't a symlink
in the normal sense of the word, it's a magic-link (nd_jump_link
switches the nd->path to the actual 'struct file' in the case of
/proc/self/fd/$n).

-- 
Aleksa Sarai
Senior Software Engineer (Containers)
SUSE Linux GmbH
<https://www.cyphar.com/>
```

## Attachments

- [signature.asc](https://ratatoskr.run/linux-api/2020/01/169828/attachment/0) (application/pgp-signature, 228 bytes)
