Skip to contentSkip to conversation

Add NOSYMFOLLOW flags to mount(2) and statfs(2)

PATCH In review Ross Zwisler 3 participants 4 messages Sep 4, 2020 – Oct 27, 2020 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add NOSYMFOLLOW flags to mount(2) and statfs(2)

These flags should first appear in Linux kernel version v5.10.

---
The nosymfollow kernel code has been merged into Al Viro's tree and should be part of the v5.10 merge window.
https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git/commit/?h=work.misc&id=dab741e0e02bd3c4f5e2e97be74b39df2523fc6e

---
 man2/mount.2  | 10 ++++++++++
 man2/statfs.2 |  4 ++++
 2 files changed, 14 insertions(+)
man2/mount.2 +10 -0
index f565ee578..039e4b83b 100644
@@ -280,6 +280,16 @@ the
 flag to
 .BR open (2)
 was specified for all file opens to this filesystem).
+.TP
+.B MS_NOSYMFOLLOW
+Do not follow symlinks when resolving paths.  Symlinks can still be created,
+and
+.BR readlink (1),
+.BR readlink (2),
+.BR realpath (1)
+and
+.BR realpath (3)
+all still work properly.
 .PP
 From Linux 2.4 onward, some of the above flags are
 settable on a per-mount basis,
man2/statfs.2 +4 -0
index 0fc537c14..d5edf2a50 100644
@@ -206,6 +206,10 @@ Writes are synched to the filesystem immediately (see the description of
 .B O_SYNC
 in
 .BR open (2)).
+.TP
+.B ST_NOSYMFOLLOW
+Symlinks are not followed when resolving paths; see
+.BR mount (2).
 .PP
 Nobody knows what
 .I f_fsid
Signature · 1 line
2.28.0.526.ge36021eeef-goog
#1 lore raw

Hello Ross,

Quoted 4 lines · Ross Zwisler

These flags should first appear in Linux kernel version v5.10.

Thanks for the patch. I will try to keep track of this, but if you happened to notice whether this goes in in 5.10, and pinged this mail thread, that would be great.

Cheers,

Michael

Quoted 48 lines

---
The nosymfollow kernel code has been merged into Al Viro's tree and should be part of the v5.10 merge window.
https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git/commit/?h=work.misc&id=dab741e0e02bd3c4f5e2e97be74b39df2523fc6e

---
 man2/mount.2  | 10 ++++++++++
 man2/statfs.2 |  4 ++++
 2 files changed, 14 insertions(+)
man2/mount.2 +10 -0
index f565ee578..039e4b83b 100644
@@ -280,6 +280,16 @@ the
 flag to
 .BR open (2)
 was specified for all file opens to this filesystem).
+.TP
+.B MS_NOSYMFOLLOW
+Do not follow symlinks when resolving paths.  Symlinks can still be created,
+and
+.BR readlink (1),
+.BR readlink (2),
+.BR realpath (1)
+and
+.BR realpath (3)
+all still work properly.
 .PP
 From Linux 2.4 onward, some of the above flags are
 settable on a per-mount basis,
man2/statfs.2 +4 -1
index 0fc537c14..d5edf2a50 100644
@@ -206,6 +206,10 @@ Writes are synched to the filesystem immediately (see the description of
 .B O_SYNC
 in
 .BR open (2)).
+.TP
+.B ST_NOSYMFOLLOW
+Symlinks are not followed when resolving paths; see
+.BR mount (2).
 .PP
 Nobody knows what
 .I f_fsid
--

2.28.0.526.ge36021eeef-goog

Signature · 3 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
#2 lore raw
Quoted 11 lines · Michael Kerrisk (man-pages)

Hello Ross,

Quoted 4 lines · Ross Zwisler

These flags should first appear in Linux kernel version v5.10.

Thanks for the patch. I will try to keep track of this, but if you happened to notice whether this goes in in 5.10, and pinged this mail thread, that would be great.

Hey Michael,

The associated kernel patches were successfully merged in the v5.10 merge window:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=dab741e0e02bd3c4f5e2e97be74b39df2523fc6e

Thanks,
- Ross

#3 lore raw

Hey Ross,

Quoted 14 lines · On Tue, 27 Oct 2020 at 18:02, <[email protected]> wrote:
Quoted 11 lines · Michael Kerrisk (man-pages)

Hello Ross,

Quoted 4 lines · Ross Zwisler

These flags should first appear in Linux kernel version v5.10.

Thanks for the patch. I will try to keep track of this, but if you happened to notice whether this goes in in 5.10, and pinged this mail thread, that would be great.

Quoted 6 lines

Hey Michael,

The associated kernel patches were successfully merged in the v5.10 merge window:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=dab741e0e02bd3c4f5e2e97be74b39df2523fc6e

Thank you very much for the ping! I've now merged that patch into a branch for the next man-pages-5.10 release.

Cheers,

Michael

Signature · 3 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/