diff options
| author | Eric W. Biederman <ebiederm@xmission.com> | 2015-05-09 23:09:14 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-07-21 13:10:00 -0400 |
| commit | bdbdf7ee9d561da7b4b840435c963344061953d6 (patch) | |
| tree | b28ada9ded70b0e552f65f674e3b08f58a2a453a /kernel | |
| parent | c2f633b99857d27333de18f53d123a180672c52b (diff) | |
sysctl: Allow creating permanently empty directories that serve as mountpoints.
commit f9bd6733d3f11e24f3949becf277507d422ee1eb upstream.
Add a magic sysctl table sysctl_mount_point that when used to
create a directory forces that directory to be permanently empty.
Update the code to use make_empty_dir_inode when accessing permanently
empty directories.
Update the code to not allow adding to permanently empty directories.
Update /proc/sys/fs/binfmt_misc to be a permanently empty directory.
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/sysctl.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 2082b1a88fb9..c3eee4c6d6c1 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
| @@ -1531,12 +1531,6 @@ static struct ctl_table vm_table[] = { | |||
| 1531 | { } | 1531 | { } |
| 1532 | }; | 1532 | }; |
| 1533 | 1533 | ||
| 1534 | #if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE) | ||
| 1535 | static struct ctl_table binfmt_misc_table[] = { | ||
| 1536 | { } | ||
| 1537 | }; | ||
| 1538 | #endif | ||
| 1539 | |||
| 1540 | static struct ctl_table fs_table[] = { | 1534 | static struct ctl_table fs_table[] = { |
| 1541 | { | 1535 | { |
| 1542 | .procname = "inode-nr", | 1536 | .procname = "inode-nr", |
| @@ -1690,7 +1684,7 @@ static struct ctl_table fs_table[] = { | |||
| 1690 | { | 1684 | { |
| 1691 | .procname = "binfmt_misc", | 1685 | .procname = "binfmt_misc", |
| 1692 | .mode = 0555, | 1686 | .mode = 0555, |
| 1693 | .child = binfmt_misc_table, | 1687 | .child = sysctl_mount_point, |
| 1694 | }, | 1688 | }, |
| 1695 | #endif | 1689 | #endif |
| 1696 | { | 1690 | { |
