From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id DE34B139085 for ; Sun, 1 Jan 2017 16:37:59 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 26E62E0EB4; Sun, 1 Jan 2017 16:37:48 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 04EECE0EB3 for ; Sun, 1 Jan 2017 16:37:43 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 361DC340F27 for ; Sun, 1 Jan 2017 16:37:42 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 6299125C8 for ; Sun, 1 Jan 2017 16:37:39 +0000 (UTC) From: "Jason Zaman" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Jason Zaman" Message-ID: <1483287988.2d3434d450e59823792bf8071e07cacf5c9e9fd4.perfinion@gentoo> Subject: [gentoo-commits] proj/hardened-refpolicy:next commit in: policy/modules/kernel/ X-VCS-Repository: proj/hardened-refpolicy X-VCS-Files: policy/modules/kernel/filesystem.if policy/modules/kernel/kernel.if X-VCS-Directories: policy/modules/kernel/ X-VCS-Committer: perfinion X-VCS-Committer-Name: Jason Zaman X-VCS-Revision: 2d3434d450e59823792bf8071e07cacf5c9e9fd4 X-VCS-Branch: next Date: Sun, 1 Jan 2017 16:37:39 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 8712f811-9651-4efa-992a-f96c1bbc6b16 X-Archives-Hash: b5b9266087ead556f1cd16fdaddcd62d Message-ID: <20170101163739.mDKAYRRN-HEGHEvHG_BuZWrxATrXtvByTcWcFqYIklQ@z> commit: 2d3434d450e59823792bf8071e07cacf5c9e9fd4 Author: Nicolas Iooss m4x org> AuthorDate: Tue Dec 27 13:56:26 2016 +0000 Commit: Jason Zaman gentoo org> CommitDate: Sun Jan 1 16:26:28 2017 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=2d3434d4 Allow searching /proc/sys/fs when using /proc/sys/fs/binfmt_misc Interface fs_register_binary_executable_type allow registering interpreters using a filesystem monted on /proc/sys/fs/binfmt_misc. In order to access this filesystem, the process needs to search every parent directory of the mountpoint. Signed-off-by: Nicolas Iooss m4x.org> policy/modules/kernel/filesystem.if | 2 ++ policy/modules/kernel/kernel.if | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/policy/modules/kernel/filesystem.if b/policy/modules/kernel/filesystem.if index 9471dbe..c85d805 100644 --- a/policy/modules/kernel/filesystem.if +++ b/policy/modules/kernel/filesystem.if @@ -612,6 +612,8 @@ interface(`fs_register_binary_executable_type',` type binfmt_misc_fs_t; ') + # binfmt_misc filesystem is usually mounted on /proc/sys/fs/binfmt_misc + kernel_search_fs_sysctls($1) rw_files_pattern($1, binfmt_misc_fs_t, binfmt_misc_fs_t) ') diff --git a/policy/modules/kernel/kernel.if b/policy/modules/kernel/kernel.if index 29709df..2c7ad0c 100644 --- a/policy/modules/kernel/kernel.if +++ b/policy/modules/kernel/kernel.if @@ -2005,6 +2005,25 @@ interface(`kernel_rw_kernel_sysctl',` ######################################## ## +## Search filesystem sysctl directories. +## +## +## +## Domain allowed access. +## +## +## +# +interface(`kernel_search_fs_sysctls',` + gen_require(` + type proc_t, sysctl_t, sysctl_fs_t; + ') + + search_dirs_pattern($1, { proc_t sysctl_t sysctl_fs_t }, sysctl_fs_t) +') + +######################################## +## ## Read filesystem sysctls. ## ##