Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
81abe27b
Commit
81abe27b
authored
Aug 03, 2012
by
Eric W. Biederman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
userns: Fix link restrictions to use uid_eq
Signed-off-by:
"Eric W. Biederman"
<
ebiederm@xmission.com
>
parent
d7555860
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
fs/namei.c
fs/namei.c
+3
-3
No files found.
fs/namei.c
View file @
81abe27b
...
...
@@ -678,7 +678,7 @@ static inline int may_follow_link(struct path *link, struct nameidata *nd)
/* Allowed if owner and follower match. */
inode
=
link
->
dentry
->
d_inode
;
if
(
current_cred
()
->
fsuid
==
inode
->
i_uid
)
if
(
uid_eq
(
current_cred
()
->
fsuid
,
inode
->
i_uid
)
)
return
0
;
/* Allowed if parent directory not sticky and world-writable. */
...
...
@@ -687,7 +687,7 @@ static inline int may_follow_link(struct path *link, struct nameidata *nd)
return
0
;
/* Allowed if parent directory and link owner match. */
if
(
parent
->
i_uid
==
inode
->
i_uid
)
if
(
uid_eq
(
parent
->
i_uid
,
inode
->
i_uid
)
)
return
0
;
path_put_conditional
(
link
,
nd
);
...
...
@@ -757,7 +757,7 @@ static int may_linkat(struct path *link)
/* Source inode owner (or CAP_FOWNER) can hardlink all they like,
* otherwise, it must be a safe source.
*/
if
(
cred
->
fsuid
==
inode
->
i_uid
||
safe_hardlink_source
(
inode
)
||
if
(
uid_eq
(
cred
->
fsuid
,
inode
->
i_uid
)
||
safe_hardlink_source
(
inode
)
||
capable
(
CAP_FOWNER
))
return
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment