make sure nd->dir_mode is always initialized after success exit from link_path_walk(); in case of empty path it did not happen.
Unified · Split
| @@ -2114,8 +2114,10 @@ static int link_path_walk(const char *name, struct nameidata *nd) · 2113 unmodified lines | |||
| 2114 | return PTR_ERR(name); | 2114 | return PTR_ERR(name); |
| 2115 | while (*name=='/') | 2115 | while (*name=='/') |
| 2116 | name++; | 2116 | name++; |
| 2117 | if (!*name) | 2117 | if (!*name) { |
| 2118 | nd->dir_mode = 0; // short-circuit the 'hardening' idiocy | ||
| 2118 | return 0; | 2119 | return 0; |
| 2120 | } | ||
| 2119 | 2121 | ||
| 2120 | /* At this point we know we have a real path component. */ | 2122 | /* At this point we know we have a real path component. */ |
| 2121 | for(;;) { | 2123 | for(;;) { |