author: Linus Torvalds <torvalds@linux-foundation.org> 2020-12-25 10:54:29 -0800
committer: Linus Torvalds <torvalds@linux-foundation.org> 2020-12-25 10:54:29 -0800
commit: 7bb5226c8a4bbf26a9ededc90532b0ad539d2017
parent: 71c5f03154ac1cb27423b984743ccc2f5d11d14d
Commit Summary:
Diffstat:
1 file changed, 3 insertions, 1 deletion
diff --git a/fs/namei.c b/fs/namei.c
index 03d0e11e4f36..78443a85480a 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2114,8 +2114,10 @@ static int link_path_walk(const char *name, struct nameidata *nd)
return PTR_ERR(name);
while (*name=='/')
name++;
- if (!*name)
+ if (!*name) {
+ nd->dir_mode = 0; // short-circuit the 'hardening' idiocy
return 0;
+ }
/* At this point we know we have a real path component. */
for(;;) {