Gentoo Archives: gentoo-commits

From: Jason Zaman <perfinion@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/hardened-refpolicy:next commit in: policy/modules/kernel/
Date: Sun, 01 Jan 2017 16:37:59
Message-Id: 1483287988.2d3434d450e59823792bf8071e07cacf5c9e9fd4.perfinion@gentoo
1 commit: 2d3434d450e59823792bf8071e07cacf5c9e9fd4
2 Author: Nicolas Iooss <nicolas.iooss <AT> m4x <DOT> org>
3 AuthorDate: Tue Dec 27 13:56:26 2016 +0000
4 Commit: Jason Zaman <perfinion <AT> gentoo <DOT> org>
5 CommitDate: Sun Jan 1 16:26:28 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=2d3434d4
7
8 Allow searching /proc/sys/fs when using /proc/sys/fs/binfmt_misc
9
10 Interface fs_register_binary_executable_type allow registering
11 interpreters using a filesystem monted on /proc/sys/fs/binfmt_misc. In
12 order to access this filesystem, the process needs to search every
13 parent directory of the mountpoint.
14
15 Signed-off-by: Nicolas Iooss <nicolas.iooss <AT> m4x.org>
16
17 policy/modules/kernel/filesystem.if | 2 ++
18 policy/modules/kernel/kernel.if | 19 +++++++++++++++++++
19 2 files changed, 21 insertions(+)
20
21 diff --git a/policy/modules/kernel/filesystem.if b/policy/modules/kernel/filesystem.if
22 index 9471dbe..c85d805 100644
23 --- a/policy/modules/kernel/filesystem.if
24 +++ b/policy/modules/kernel/filesystem.if
25 @@ -612,6 +612,8 @@ interface(`fs_register_binary_executable_type',`
26 type binfmt_misc_fs_t;
27 ')
28
29 + # binfmt_misc filesystem is usually mounted on /proc/sys/fs/binfmt_misc
30 + kernel_search_fs_sysctls($1)
31 rw_files_pattern($1, binfmt_misc_fs_t, binfmt_misc_fs_t)
32 ')
33
34
35 diff --git a/policy/modules/kernel/kernel.if b/policy/modules/kernel/kernel.if
36 index 29709df..2c7ad0c 100644
37 --- a/policy/modules/kernel/kernel.if
38 +++ b/policy/modules/kernel/kernel.if
39 @@ -2005,6 +2005,25 @@ interface(`kernel_rw_kernel_sysctl',`
40
41 ########################################
42 ## <summary>
43 +## Search filesystem sysctl directories.
44 +## </summary>
45 +## <param name="domain">
46 +## <summary>
47 +## Domain allowed access.
48 +## </summary>
49 +## </param>
50 +## <rolecap/>
51 +#
52 +interface(`kernel_search_fs_sysctls',`
53 + gen_require(`
54 + type proc_t, sysctl_t, sysctl_fs_t;
55 + ')
56 +
57 + search_dirs_pattern($1, { proc_t sysctl_t sysctl_fs_t }, sysctl_fs_t)
58 +')
59 +
60 +########################################
61 +## <summary>
62 ## Read filesystem sysctls.
63 ## </summary>
64 ## <param name="domain">