From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 59A8513829C for ; Thu, 2 Jun 2016 06:32:22 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5FA8A1427F; Thu, 2 Jun 2016 06:32:17 +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 3885C14241 for ; Thu, 2 Jun 2016 06:32:16 +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 3EC3B34099A for ; Thu, 2 Jun 2016 06:32:15 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id B0DF9208E for ; Thu, 2 Jun 2016 06:32:11 +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: <1464805207.0d320152aa69e147c6da94d13ab929db3f070e78.perfinion@gentoo> Subject: [gentoo-commits] proj/hardened-refpolicy:master commit in: policy/modules/system/ X-VCS-Repository: proj/hardened-refpolicy X-VCS-Files: policy/modules/system/userdomain.if X-VCS-Directories: policy/modules/system/ X-VCS-Committer: perfinion X-VCS-Committer-Name: Jason Zaman X-VCS-Revision: 0d320152aa69e147c6da94d13ab929db3f070e78 X-VCS-Branch: master Date: Thu, 2 Jun 2016 06:32:11 +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: 54d140b4-fbe6-4a8c-a055-7a3d72cdcf04 X-Archives-Hash: fa6f10636ab3c04b30d3149b1ea2e2eb commit: 0d320152aa69e147c6da94d13ab929db3f070e78 Author: Jason Zaman perfinion com> AuthorDate: Wed Jun 1 16:08:56 2016 +0000 Commit: Jason Zaman gentoo org> CommitDate: Wed Jun 1 18:20:07 2016 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=0d320152 userdomain: introduce interfaces for user runtime policy/modules/system/userdomain.if | 206 ++++++++++++++++++++++++++++++++++++ 1 file changed, 206 insertions(+) diff --git a/policy/modules/system/userdomain.if b/policy/modules/system/userdomain.if index 14dae15..beed625 100644 --- a/policy/modules/system/userdomain.if +++ b/policy/modules/system/userdomain.if @@ -324,6 +324,7 @@ interface(`userdom_manage_tmp_role',` manage_sock_files_pattern($2, user_tmp_t, user_tmp_t) manage_fifo_files_pattern($2, user_tmp_t, user_tmp_t) files_tmp_filetrans($2, user_tmp_t, { dir file lnk_file sock_file fifo_file }) + userdom_user_runtime_filetrans_user_tmp($2, { dir file lnk_file sock_file fifo_file }) ') ####################################### @@ -2768,6 +2769,211 @@ interface(`userdom_search_user_runtime_root',` ######################################## ## +## Create, read, write, and delete user +## runtime root dirs. +## +## +## +## Domain allowed access. +## +## +# +interface(`userdom_manage_user_runtime_root_dirs',` + gen_require(` + type user_runtime_root_t; + ') + + allow $1 user_runtime_root_t:dir manage_dir_perms; + files_search_pids($1) +') + +######################################## +## +## Create, read, write, and delete user +## runtime dirs. +## +## +## +## Domain allowed access. +## +## +# +interface(`userdom_manage_user_runtime_dirs',` + gen_require(` + type user_runtime_t; + ') + + allow $1 user_runtime_t:dir manage_dir_perms; + userdom_search_user_runtime_root($1) +') + +######################################## +## +## Mount a filesystem on user runtime dir +## directories. +## +## +## +## Domain allowed access. +## +## +# +interface(`userdom_mounton_user_runtime_dirs',` + gen_require(` + type user_runtime_t; + ') + + allow $1 user_runtime_t:dir mounton; +') + +######################################## +## +## Relabel to user runtime directories. +## +## +## +## Domain allowed access. +## +## +# +interface(`userdom_relabelto_user_runtime_dirs',` + gen_require(` + type user_runtime_t; + ') + + allow $1 user_runtime_t:dir relabelto; +') + +######################################## +## +## Create objects in the pid directory +## with an automatic type transition to +## the user runtime root type. +## +## +## +## Domain allowed access. +## +## +## +## +## The class of the object to be created. +## +## +## +## +## The name of the object being created. +## +## +# +interface(`userdom_pid_filetrans_user_runtime_root',` + gen_require(` + type user_runtime_root_t; + ') + + files_pid_filetrans($1, user_runtime_root_t, $2, $3) +') + +######################################## +## +## Create objects in a user runtime +## directory with an automatic type +## transition to a specified private +## type. +## +## +## +## Domain allowed access. +## +## +## +## +## The type of the object to create. +## +## +## +## +## The class of the object to be created. +## +## +## +## +## The name of the object being created. +## +## +# +interface(`userdom_user_runtime_filetrans',` + gen_require(` + type user_runtime_root_t, user_runtime_t; + ') + + filetrans_pattern($1, user_runtime_t, $2, $3, $4) + userdom_search_user_runtime_root($1) +') + +######################################## +## +## Create objects in the user runtime directory +## with an automatic type transition to +## the user temporary type. +## +## +## +## Domain allowed access. +## +## +## +## +## The class of the object to be created. +## +## +## +## +## The name of the object being created. +## +## +# +interface(`userdom_user_runtime_filetrans_user_tmp',` + gen_require(` + type user_tmp_t; + ') + + userdom_user_runtime_filetrans($1, user_tmp_t, $2, $3) +') + +######################################## +## +## Create objects in the user runtime root +## directory with an automatic type transition +## to the user runtime dir type. +## +## +## +## Domain allowed access. +## +## +## +## +## The class of the object to be created. +## +## +## +## +## The name of the object being created. +## +## +# +interface(`userdom_user_runtime_root_filetrans_user_runtime',` + gen_require(` + type user_runtime_root_t, user_runtime_t; + ') + + filetrans_pattern($1, user_runtime_root_t, user_runtime_t, $2, $3) + files_search_pids($1) +') + +######################################## +## ## Read and write user tmpfs files. ## ##