linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] symlink.7: expound upon fs.protected_symlinks
@ 2023-03-25 21:00 наб
  2023-03-27  6:31 ` Jakub Wilk
  0 siblings, 1 reply; 12+ messages in thread
From: наб @ 2023-03-25 21:00 UTC (permalink / raw)
  To: Alejandro Colomar (man-pages); +Cc: linux-man

[-- Attachment #1: Type: text/plain, Size: 1466 bytes --]

This is on by default in Debian, maybe the next reader won't spend an
hour tracing the kernel.

Closes: https://bugs.debian.org/1033477
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
---
 man7/symlink.7 | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/man7/symlink.7 b/man7/symlink.7
index 77fefb743..550b60486 100644
--- a/man7/symlink.7
+++ b/man7/symlink.7
@@ -84,10 +84,23 @@ magic links have been used as attack vectors in various exploits.
 The owner and group of an existing symbolic link can be changed
 using
 .BR lchown (2).
-The only time that the ownership of a symbolic link matters is
-when the link is being removed or renamed in a directory that
-has the sticky bit set (see
-.BR stat (2)).
+Only when a symbolic link is in a sticky directory (see
+.BR stat (2))
+does its ownership matter\[em]deletions and renames are subject
+to standard semantics.
+.\" Documentation/admin-guide/sysctl/fs.rst:
+.\" fs/namei.c#may_follow_link()
+Additionally, if the
+.I fs.protected_symlinks
+sysctl is set, a symbolic link may only be followed if:
+.br
+\[bu] not in a sticky, world-writable
+.RB ( o+wt )
+directory,
+.br
+\[bu] owned by the user which follows it, or
+.br
+\[bu] owned by the same user which owns the directory it resides in.
 .PP
 The last access and last modification timestamps
 of a symbolic link can be changed using
-- 
2.30.2

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-04-01 23:28 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-25 21:00 [PATCH] symlink.7: expound upon fs.protected_symlinks наб
2023-03-27  6:31 ` Jakub Wilk
2023-03-27 12:29   ` [PATCH v2] symlink.7: cross-link to proc.5 for fs.protected_symlinks наб
2023-03-31 21:44     ` Alejandro Colomar
2023-03-31 22:04       ` [PATCH 1/2] proc.5: add "system information, and sysctl" to .SH наб
2023-03-31 22:11         ` Alejandro Colomar
2023-04-01 22:58         ` Alejandro Colomar
2023-03-31 22:04       ` [PATCH 2/2] sysctl.7: create as .so man5/proc.5 наб
2023-03-31 22:14         ` Alejandro Colomar
2023-04-01 23:04         ` Alejandro Colomar
2023-04-01 23:26           ` наб
2023-04-01 23:28             ` Alejandro Colomar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).