diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2008-07-15 08:54:06 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2008-07-26 20:53:12 -0400 |
commit | 9043476f726802f4b00c96d0c4f418dde48d1304 (patch) | |
tree | 9ead0294bc75e219c12b44fc7eb8996248400f2a /include/linux | |
parent | ae7edecc9b8810770a8e5cb9a466ea4bdcfa8401 (diff) |
[PATCH] sanitize proc_sysctl
* keep references to ctl_table_head and ctl_table in /proc/sys inodes
* grab the former during operations, use the latter for access to
entry if that succeeds
* have ->d_compare() check if table should be seen for one who does lookup;
that allows us to avoid flipping inodes - if we have the same name resolve
to different things, we'll just keep several dentries and ->d_compare()
will reject the wrong ones.
* have ->lookup() and ->readdir() scan the table of our inode first, then
walk all ctl_table_header and scan ->attached_by for those that are
attached to our directory.
* implement ->getattr().
* get rid of insane amounts of tree-walking
* get rid of the need to know dentry in ->permission() and of the contortions
induced by that.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/proc_fs.h | 5 | ||||
-rw-r--r-- | include/linux/sysctl.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index f560d1705afe..fb61850d1cfc 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h | |||
@@ -282,11 +282,16 @@ union proc_op { | |||
282 | struct task_struct *task); | 282 | struct task_struct *task); |
283 | }; | 283 | }; |
284 | 284 | ||
285 | struct ctl_table_header; | ||
286 | struct ctl_table; | ||
287 | |||
285 | struct proc_inode { | 288 | struct proc_inode { |
286 | struct pid *pid; | 289 | struct pid *pid; |
287 | int fd; | 290 | int fd; |
288 | union proc_op op; | 291 | union proc_op op; |
289 | struct proc_dir_entry *pde; | 292 | struct proc_dir_entry *pde; |
293 | struct ctl_table_header *sysctl; | ||
294 | struct ctl_table *sysctl_entry; | ||
290 | struct inode vfs_inode; | 295 | struct inode vfs_inode; |
291 | }; | 296 | }; |
292 | 297 | ||
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 3f6599aeb0db..d0437f36921f 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
@@ -961,6 +961,7 @@ struct ctl_table_header; | |||
961 | 961 | ||
962 | extern void sysctl_head_get(struct ctl_table_header *); | 962 | extern void sysctl_head_get(struct ctl_table_header *); |
963 | extern void sysctl_head_put(struct ctl_table_header *); | 963 | extern void sysctl_head_put(struct ctl_table_header *); |
964 | extern int sysctl_is_seen(struct ctl_table_header *); | ||
964 | extern struct ctl_table_header *sysctl_head_grab(struct ctl_table_header *); | 965 | extern struct ctl_table_header *sysctl_head_grab(struct ctl_table_header *); |
965 | extern struct ctl_table_header *sysctl_head_next(struct ctl_table_header *prev); | 966 | extern struct ctl_table_header *sysctl_head_next(struct ctl_table_header *prev); |
966 | extern struct ctl_table_header *__sysctl_head_next(struct nsproxy *namespaces, | 967 | extern struct ctl_table_header *__sysctl_head_next(struct nsproxy *namespaces, |