Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 257314
b: refs/heads/master
c: 1fc0f78
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro committed Jul 20, 2011
1 parent 5f0a9cb commit c16e7c9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 178ea73521d64ba41d7aa5488fb9f549c6d4507d
refs/heads/master: 1fc0f78ca9f311c6277e2f1b7655bb4d43ceb311
7 changes: 5 additions & 2 deletions trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,13 +318,16 @@ static inline int exec_permission(struct inode *inode, unsigned int flags)
{
int ret;
struct user_namespace *ns = inode_userns(inode);
int mask = MAY_EXEC;
if (flags & IPERM_FLAG_RCU)
mask |= MAY_NOT_BLOCK;

if (inode->i_op->permission) {
ret = inode->i_op->permission(inode, MAY_EXEC, flags);
ret = inode->i_op->permission(inode, mask, flags);
if (likely(!ret))
goto ok;
} else {
ret = acl_permission_check(inode, MAY_EXEC, flags);
ret = acl_permission_check(inode, mask, flags);
if (likely(!ret))
goto ok;
if (ret != -EACCES)
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/proc/proc_sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ static int proc_sys_permission(struct inode *inode, int mask,unsigned int flags)
if (!table) /* global root - r-xr-xr-x */
error = mask & MAY_WRITE ? -EACCES : 0;
else /* Use the permissions on the sysctl table entry */
error = sysctl_perm(head->root, table, mask);
error = sysctl_perm(head->root, table, mask & ~MAY_NOT_BLOCK);

sysctl_head_finish(head);
return error;
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ struct inodes_stat_t {
#define MAY_ACCESS 16
#define MAY_OPEN 32
#define MAY_CHDIR 64
#define MAY_NOT_BLOCK 128 /* called from RCU mode, don't block */

/*
* flags in file.f_mode. Note that FMODE_READ and FMODE_WRITE must correspond
Expand Down

0 comments on commit c16e7c9

Please sign in to comment.