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 EFEE91381F3 for ; Fri, 23 Aug 2013 08:09:47 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8533FE0C1E; Fri, 23 Aug 2013 08:09:47 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id ED92CE0C1E for ; Fri, 23 Aug 2013 08:09:46 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D1C5433EBCA for ; Fri, 23 Aug 2013 08:09:45 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 75BB8E468F for ; Fri, 23 Aug 2013 08:09:44 +0000 (UTC) From: "Sven Vermeulen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sven Vermeulen" Message-ID: <1377245180.f73af58302e0a58ce615f51a71b9676bd26633cc.SwifT@gentoo> Subject: [gentoo-commits] proj/hardened-refpolicy:master commit in: policy/modules/system/, policy/modules/kernel/ X-VCS-Repository: proj/hardened-refpolicy X-VCS-Files: policy/modules/kernel/files.if policy/modules/system/libraries.if policy/modules/system/modutils.te X-VCS-Directories: policy/modules/system/ policy/modules/kernel/ X-VCS-Committer: SwifT X-VCS-Committer-Name: Sven Vermeulen X-VCS-Revision: f73af58302e0a58ce615f51a71b9676bd26633cc X-VCS-Branch: master Date: Fri, 23 Aug 2013 08:09:44 +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: e238e165-d993-4e92-a057-7be2e2dd2e27 X-Archives-Hash: f0c21662317fafe814e6a568d022b3bd commit: f73af58302e0a58ce615f51a71b9676bd26633cc Author: Sven Vermeulen siphos be> AuthorDate: Fri Aug 23 08:06:20 2013 +0000 Commit: Sven Vermeulen siphos be> CommitDate: Fri Aug 23 08:06:20 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-refpolicy.git;a=commit;h=f73af583 Automatic filetrans to modules_object_t for /lib/modules As per bug #428322, if /lib/modules does not exist, then "make modules_install" will fail as it creates a directory (/lib/modules) with the wrong type (lib_t instead of modules_object_t). Add in a file transition when a directory named "modules" is created in a lib_t location, transitioning to modules_object_t. Had to add in the libs_lib_filetrans (from lib_t) Had to add in the files_lib_filetrans_kernel_modules (to modules_object_t) --- policy/modules/kernel/files.if | 30 ++++++++++++++++++++++++++++++ policy/modules/system/libraries.if | 36 ++++++++++++++++++++++++++++++++++++ policy/modules/system/modutils.te | 1 + 3 files changed, 67 insertions(+) diff --git a/policy/modules/kernel/files.if b/policy/modules/kernel/files.if index a544f27..56c83f6 100644 --- a/policy/modules/kernel/files.if +++ b/policy/modules/kernel/files.if @@ -6661,3 +6661,33 @@ interface(`files_read_src_files',` read_files_pattern($1, src_t, src_t) ') + +########################################## +## +## Create a resource in the generic lib location +## with an automatic type transition towards the kernel modules +## type +## +## +## +## Domain allowed access +## +## +## +## +## Class of the created resource for which a type transition should occur +## +## +## +## +## Optional name of the resource +## +## +# +interface(`files_lib_filetrans_kernel_modules',` + gen_require(` + type modules_object_t; + ') + + libs_lib_filetrans($1, modules_object_t, $2, $3) +') diff --git a/policy/modules/system/libraries.if b/policy/modules/system/libraries.if index 41a44f3..a83933f 100644 --- a/policy/modules/system/libraries.if +++ b/policy/modules/system/libraries.if @@ -567,3 +567,39 @@ interface(`libs_generic_etc_filetrans_ld_so_cache',` files_etc_filetrans($1, ld_so_cache_t, $2, $3) ') + +########################################## +## +## Create an object in the generic lib location with a type transition +## to the provided type +## +## +## +## Domain allowed access +## +## +## +## +## Target domain towards which a type transition should occur +## +## +## +## +## Class of the resource for which a type transition occurs. +## +## +## +## +## Name of the resource created for which a type transition should occur +## +## +# +interface(`libs_lib_filetrans',` + gen_require(` + type lib_t; + ') + + filetrans_pattern($1, lib_t, $2, $3, $4) + + libs_search_lib($1) +') diff --git a/policy/modules/system/modutils.te b/policy/modules/system/modutils.te index b7d820c..4c0f286 100644 --- a/policy/modules/system/modutils.te +++ b/policy/modules/system/modutils.te @@ -338,4 +338,5 @@ ifdef(`distro_gentoo',` files_read_src_files(insmod_t) files_manage_kernel_modules(insmod_t) + files_lib_filetrans_kernel_modules(insmod_t, dir, "modules") ')