History

Make sure that make_create_in_sticky() never sees uninitialized value of dir_mode

make sure nd->dir_mode is always initialized after success exit from link_path_walk(); in case of empty path it did not happen.

Al Viro committed 6 years ago

Commit 1a97d891 parent 77573fa1 file · +3 −1Browse files

Unified · Split

fs/namei.c+3−1
@@ -2114,8 +2114,10 @@ static int link_path_walk(const char *name, struct nameidata *nd) · 2113 unmodified lines
21142114 return PTR_ERR(name);
21152115 while (*name=='/')
21162116 name++;
2117− if (!*name)
2117+ if (!*name) {
2118+ nd->dir_mode = 0; // short-circuit the 'hardening' idiocy
21182119 return 0;
2120+ }
21192121
21202122 /* At this point we know we have a real path component. */
21212123 for(;;) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t