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
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(;;) {

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