diff options
author | James Morris <jmorris@namei.org> | 2009-02-05 19:01:45 -0500 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2009-02-05 19:01:45 -0500 |
commit | cb5629b10d64a8006622ce3a52bc887d91057d69 (patch) | |
tree | 7c06d8f30783115e3384721046258ce615b129c5 /ipc/ipc_sysctl.c | |
parent | 8920d5ad6ba74ae8ab020e90cc4d976980e68701 (diff) | |
parent | f01d1d546abb2f4028b5299092f529eefb01253a (diff) |
Merge branch 'master' into next
Conflicts:
fs/namei.c
Manually merged per:
diff --cc fs/namei.c
index 734f2b5,bbc15c2..0000000
--- a/fs/namei.c
+++ b/fs/namei.c
@@@ -860,9 -848,8 +849,10 @@@ static int __link_path_walk(const char
nd->flags |= LOOKUP_CONTINUE;
err = exec_permission_lite(inode);
if (err == -EAGAIN)
- err = vfs_permission(nd, MAY_EXEC);
+ err = inode_permission(nd->path.dentry->d_inode,
+ MAY_EXEC);
+ if (!err)
+ err = ima_path_check(&nd->path, MAY_EXEC);
if (err)
break;
@@@ -1525,14 -1506,9 +1509,14 @@@ int may_open(struct path *path, int acc
flag &= ~O_TRUNC;
}
- error = vfs_permission(nd, acc_mode);
+ error = inode_permission(inode, acc_mode);
if (error)
return error;
+
- error = ima_path_check(&nd->path,
++ error = ima_path_check(path,
+ acc_mode & (MAY_READ | MAY_WRITE | MAY_EXEC));
+ if (error)
+ return error;
/*
* An append-only file must be opened in append mode for writing.
*/
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'ipc/ipc_sysctl.c')
-rw-r--r-- | ipc/ipc_sysctl.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/ipc/ipc_sysctl.c b/ipc/ipc_sysctl.c index 0dfebc509426..4a7a12c95abe 100644 --- a/ipc/ipc_sysctl.c +++ b/ipc/ipc_sysctl.c | |||
@@ -26,29 +26,6 @@ static void *get_ipc(ctl_table *table) | |||
26 | return which; | 26 | return which; |
27 | } | 27 | } |
28 | 28 | ||
29 | /* | ||
30 | * Routine that is called when the file "auto_msgmni" has successfully been | ||
31 | * written. | ||
32 | * Two values are allowed: | ||
33 | * 0: unregister msgmni's callback routine from the ipc namespace notifier | ||
34 | * chain. This means that msgmni won't be recomputed anymore upon memory | ||
35 | * add/remove or ipc namespace creation/removal. | ||
36 | * 1: register back the callback routine. | ||
37 | */ | ||
38 | static void ipc_auto_callback(int val) | ||
39 | { | ||
40 | if (!val) | ||
41 | unregister_ipcns_notifier(current->nsproxy->ipc_ns); | ||
42 | else { | ||
43 | /* | ||
44 | * Re-enable automatic recomputing only if not already | ||
45 | * enabled. | ||
46 | */ | ||
47 | recompute_msgmni(current->nsproxy->ipc_ns); | ||
48 | cond_register_ipcns_notifier(current->nsproxy->ipc_ns); | ||
49 | } | ||
50 | } | ||
51 | |||
52 | #ifdef CONFIG_PROC_FS | 29 | #ifdef CONFIG_PROC_FS |
53 | static int proc_ipc_dointvec(ctl_table *table, int write, struct file *filp, | 30 | static int proc_ipc_dointvec(ctl_table *table, int write, struct file *filp, |
54 | void __user *buffer, size_t *lenp, loff_t *ppos) | 31 | void __user *buffer, size_t *lenp, loff_t *ppos) |
@@ -94,6 +71,29 @@ static int proc_ipc_doulongvec_minmax(ctl_table *table, int write, | |||
94 | lenp, ppos); | 71 | lenp, ppos); |
95 | } | 72 | } |
96 | 73 | ||
74 | /* | ||
75 | * Routine that is called when the file "auto_msgmni" has successfully been | ||
76 | * written. | ||
77 | * Two values are allowed: | ||
78 | * 0: unregister msgmni's callback routine from the ipc namespace notifier | ||
79 | * chain. This means that msgmni won't be recomputed anymore upon memory | ||
80 | * add/remove or ipc namespace creation/removal. | ||
81 | * 1: register back the callback routine. | ||
82 | */ | ||
83 | static void ipc_auto_callback(int val) | ||
84 | { | ||
85 | if (!val) | ||
86 | unregister_ipcns_notifier(current->nsproxy->ipc_ns); | ||
87 | else { | ||
88 | /* | ||
89 | * Re-enable automatic recomputing only if not already | ||
90 | * enabled. | ||
91 | */ | ||
92 | recompute_msgmni(current->nsproxy->ipc_ns); | ||
93 | cond_register_ipcns_notifier(current->nsproxy->ipc_ns); | ||
94 | } | ||
95 | } | ||
96 | |||
97 | static int proc_ipcauto_dointvec_minmax(ctl_table *table, int write, | 97 | static int proc_ipcauto_dointvec_minmax(ctl_table *table, int write, |
98 | struct file *filp, void __user *buffer, size_t *lenp, loff_t *ppos) | 98 | struct file *filp, void __user *buffer, size_t *lenp, loff_t *ppos) |
99 | { | 99 | { |