* [PATCH] namei: use current_fsuid() in may_follow_link()
@ 2020-08-24 12:56 Denis Efremov
0 siblings, 0 replies; only message in thread
From: Denis Efremov @ 2020-08-24 12:56 UTC (permalink / raw)
Cc: Denis Efremov, Alexander Viro, linux-fsdevel, linux-kernel
Modify may_follow_link() to use current_fsuid()
Signed-off-by: Denis Efremov <efremov@linux.com>
---
fs/namei.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/namei.c b/fs/namei.c
index e99e2a9da0f7..1a47c9d8ce13 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -958,7 +958,7 @@ static inline int may_follow_link(struct nameidata *nd, const struct inode *inod
return 0;
/* Allowed if owner and follower match. */
- if (uid_eq(current_cred()->fsuid, inode->i_uid))
+ if (uid_eq(current_fsuid(), inode->i_uid))
return 0;
/* Allowed if parent directory not sticky and world-writable. */
--
2.26.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2020-08-24 12:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-24 12:56 [PATCH] namei: use current_fsuid() in may_follow_link() Denis Efremov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox