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 4304E1395E1 for ; Sun, 2 Aug 2015 19:06:46 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F31AB1403D; Sun, 2 Aug 2015 19:06:38 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id F1D231403A for ; Sun, 2 Aug 2015 19:06:37 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 062C1340754 for ; Sun, 2 Aug 2015 19:06:37 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id AFE3A127 for ; Sun, 2 Aug 2015 19:06:33 +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: <1438330143.0e8ef804e3c6409094334dda3b320bcfd5bf29b8.perfinion@gentoo> Subject: [gentoo-commits] proj/hardened-refpolicy:next commit in: policy/modules/contrib/ X-VCS-Repository: proj/hardened-refpolicy X-VCS-Files: policy/modules/contrib/android.fc policy/modules/contrib/android.if policy/modules/contrib/android.te X-VCS-Directories: policy/modules/contrib/ X-VCS-Committer: perfinion X-VCS-Committer-Name: Jason Zaman X-VCS-Revision: 0e8ef804e3c6409094334dda3b320bcfd5bf29b8 X-VCS-Branch: next Date: Sun, 2 Aug 2015 19:06:33 +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: eb58b011-b666-4b7f-b130-91ff0b53d5e1 X-Archives-Hash: 04a5fad9fda2db549db6734df8b724ca commit: 0e8ef804e3c6409094334dda3b320bcfd5bf29b8 Author: Jason Zaman perfinion com> AuthorDate: Tue Jul 28 14:46:43 2015 +0000 Commit: Jason Zaman gentoo org> CommitDate: Fri Jul 31 08:09:03 2015 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=0e8ef804 android: add sdk in /opt and sysfs adb needs to be able to read sysfs to find the USB device policy/modules/contrib/android.fc | 4 ++++ policy/modules/contrib/android.if | 5 +++++ policy/modules/contrib/android.te | 11 +++++++++-- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/policy/modules/contrib/android.fc b/policy/modules/contrib/android.fc index a16fc47..af98311 100644 --- a/policy/modules/contrib/android.fc +++ b/policy/modules/contrib/android.fc @@ -4,3 +4,7 @@ HOME_DIR/\.gradle(/.*)? gen_context(system_u:object_r:android_home_t,s0) /opt/android-studio/bin/studio.sh gen_context(system_u:object_r:android_java_exec_t,s0) +/opt/android-sdk-update-manager/platform-tools/adb -- gen_context(system_u:object_r:android_tools_exec_t,s0) +/opt/android-sdk-update-manager/platform-tools/fastboot -- gen_context(system_u:object_r:android_tools_exec_t,s0) +/opt/android-sdk-update-manager/tools/android -- gen_context(system_u:object_r:android_java_exec_t,s0) +/opt/android-sdk-update-manager(/.*)? gen_context(system_u:object_r:android_sdk_t,s0) diff --git a/policy/modules/contrib/android.if b/policy/modules/contrib/android.if index f0173d5..a50093a 100644 --- a/policy/modules/contrib/android.if +++ b/policy/modules/contrib/android.if @@ -23,6 +23,7 @@ interface(`android_role',` type android_tmp_t; type android_java_t; type android_java_exec_t; + type android_sdk_t; ') role $1 types android_tools_t; @@ -38,6 +39,10 @@ interface(`android_role',` manage_files_pattern($2, android_home_t, android_home_t) manage_lnk_files_pattern($2, android_home_t, android_home_t) + list_dirs_pattern($2, android_sdk_t, android_sdk_t) + read_files_pattern($2, android_sdk_t, android_sdk_t) + read_lnk_files_pattern($2, android_sdk_t, android_sdk_t) + userdom_user_home_dir_filetrans($2, android_home_t, dir, ".android") userdom_user_home_dir_filetrans($2, android_home_t, dir, ".AndroidStudioBeta") userdom_user_home_dir_filetrans($2, android_home_t, dir, ".AndroidStudio") diff --git a/policy/modules/contrib/android.te b/policy/modules/contrib/android.te index a76061f..930c6b3 100644 --- a/policy/modules/contrib/android.te +++ b/policy/modules/contrib/android.te @@ -28,6 +28,8 @@ type android_home_t; # customizable userdom_user_home_content(android_home_t) userdom_user_home_dir_filetrans(android_tools_t, android_home_t, { dir file }) +type android_sdk_t; +files_type(android_sdk_t) ############################ # @@ -55,6 +57,7 @@ corenet_tcp_bind_adb_port(android_tools_t) corenet_tcp_bind_generic_node(android_tools_t) corenet_tcp_connect_adb_port(android_tools_t) +dev_read_sysfs(android_tools_t) dev_rw_generic_usb_dev(android_tools_t) userdom_manage_user_home_content_dirs(android_tools_t) @@ -75,10 +78,14 @@ allow android_java_t self:tcp_socket { accept listen }; can_exec(android_java_t, android_home_t) can_exec(android_java_t, android_java_exec_t) +can_exec(android_java_t, android_sdk_t) manage_dirs_pattern(android_java_t, android_home_t, android_home_t) manage_files_pattern(android_java_t, android_home_t, android_home_t) +manage_dirs_pattern(android_java_t, android_sdk_t, android_sdk_t) +manage_files_pattern(android_java_t, android_sdk_t, android_sdk_t) + manage_dirs_pattern(android_java_t, android_tmp_t, android_tmp_t) manage_files_pattern(android_java_t, android_tmp_t, android_tmp_t) @@ -87,8 +94,8 @@ corecmd_exec_shell(android_java_t) corenet_tcp_bind_all_unreserved_ports(android_java_t) corenet_tcp_bind_generic_node(android_java_t) -corenet_tcp_connect_adb_port(android_tools_t) -corenet_tcp_connect_http_port(android_tools_t) +corenet_tcp_connect_adb_port(android_java_t) +corenet_tcp_connect_http_port(android_java_t) corenet_udp_bind_generic_node(android_java_t) domain_dontaudit_getattr_all_domains(android_java_t) 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 EBD331395D6 for ; Fri, 31 Jul 2015 14:18:25 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 300C114023; Fri, 31 Jul 2015 14:18:24 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 830A21401E for ; Fri, 31 Jul 2015 14:18:23 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 83C7A340A42 for ; Fri, 31 Jul 2015 14:18:22 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id E784E112 for ; Fri, 31 Jul 2015 14:18:20 +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: <1438330143.0e8ef804e3c6409094334dda3b320bcfd5bf29b8.perfinion@gentoo> Subject: [gentoo-commits] proj/hardened-refpolicy:master commit in: policy/modules/contrib/ X-VCS-Repository: proj/hardened-refpolicy X-VCS-Files: policy/modules/contrib/android.fc policy/modules/contrib/android.if policy/modules/contrib/android.te X-VCS-Directories: policy/modules/contrib/ X-VCS-Committer: perfinion X-VCS-Committer-Name: Jason Zaman X-VCS-Revision: 0e8ef804e3c6409094334dda3b320bcfd5bf29b8 X-VCS-Branch: master Date: Fri, 31 Jul 2015 14:18:20 +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: 3b72b365-ca6b-41b7-a932-61eb789e56f4 X-Archives-Hash: cd6db740af4c59ffaee31b00d4d84f68 Message-ID: <20150731141820.0gQFNlB4d2sxpVjJVJWKqNSCKvf8uRMuujF1g3XvUpI@z> commit: 0e8ef804e3c6409094334dda3b320bcfd5bf29b8 Author: Jason Zaman perfinion com> AuthorDate: Tue Jul 28 14:46:43 2015 +0000 Commit: Jason Zaman gentoo org> CommitDate: Fri Jul 31 08:09:03 2015 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=0e8ef804 android: add sdk in /opt and sysfs adb needs to be able to read sysfs to find the USB device policy/modules/contrib/android.fc | 4 ++++ policy/modules/contrib/android.if | 5 +++++ policy/modules/contrib/android.te | 11 +++++++++-- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/policy/modules/contrib/android.fc b/policy/modules/contrib/android.fc index a16fc47..af98311 100644 --- a/policy/modules/contrib/android.fc +++ b/policy/modules/contrib/android.fc @@ -4,3 +4,7 @@ HOME_DIR/\.gradle(/.*)? gen_context(system_u:object_r:android_home_t,s0) /opt/android-studio/bin/studio.sh gen_context(system_u:object_r:android_java_exec_t,s0) +/opt/android-sdk-update-manager/platform-tools/adb -- gen_context(system_u:object_r:android_tools_exec_t,s0) +/opt/android-sdk-update-manager/platform-tools/fastboot -- gen_context(system_u:object_r:android_tools_exec_t,s0) +/opt/android-sdk-update-manager/tools/android -- gen_context(system_u:object_r:android_java_exec_t,s0) +/opt/android-sdk-update-manager(/.*)? gen_context(system_u:object_r:android_sdk_t,s0) diff --git a/policy/modules/contrib/android.if b/policy/modules/contrib/android.if index f0173d5..a50093a 100644 --- a/policy/modules/contrib/android.if +++ b/policy/modules/contrib/android.if @@ -23,6 +23,7 @@ interface(`android_role',` type android_tmp_t; type android_java_t; type android_java_exec_t; + type android_sdk_t; ') role $1 types android_tools_t; @@ -38,6 +39,10 @@ interface(`android_role',` manage_files_pattern($2, android_home_t, android_home_t) manage_lnk_files_pattern($2, android_home_t, android_home_t) + list_dirs_pattern($2, android_sdk_t, android_sdk_t) + read_files_pattern($2, android_sdk_t, android_sdk_t) + read_lnk_files_pattern($2, android_sdk_t, android_sdk_t) + userdom_user_home_dir_filetrans($2, android_home_t, dir, ".android") userdom_user_home_dir_filetrans($2, android_home_t, dir, ".AndroidStudioBeta") userdom_user_home_dir_filetrans($2, android_home_t, dir, ".AndroidStudio") diff --git a/policy/modules/contrib/android.te b/policy/modules/contrib/android.te index a76061f..930c6b3 100644 --- a/policy/modules/contrib/android.te +++ b/policy/modules/contrib/android.te @@ -28,6 +28,8 @@ type android_home_t; # customizable userdom_user_home_content(android_home_t) userdom_user_home_dir_filetrans(android_tools_t, android_home_t, { dir file }) +type android_sdk_t; +files_type(android_sdk_t) ############################ # @@ -55,6 +57,7 @@ corenet_tcp_bind_adb_port(android_tools_t) corenet_tcp_bind_generic_node(android_tools_t) corenet_tcp_connect_adb_port(android_tools_t) +dev_read_sysfs(android_tools_t) dev_rw_generic_usb_dev(android_tools_t) userdom_manage_user_home_content_dirs(android_tools_t) @@ -75,10 +78,14 @@ allow android_java_t self:tcp_socket { accept listen }; can_exec(android_java_t, android_home_t) can_exec(android_java_t, android_java_exec_t) +can_exec(android_java_t, android_sdk_t) manage_dirs_pattern(android_java_t, android_home_t, android_home_t) manage_files_pattern(android_java_t, android_home_t, android_home_t) +manage_dirs_pattern(android_java_t, android_sdk_t, android_sdk_t) +manage_files_pattern(android_java_t, android_sdk_t, android_sdk_t) + manage_dirs_pattern(android_java_t, android_tmp_t, android_tmp_t) manage_files_pattern(android_java_t, android_tmp_t, android_tmp_t) @@ -87,8 +94,8 @@ corecmd_exec_shell(android_java_t) corenet_tcp_bind_all_unreserved_ports(android_java_t) corenet_tcp_bind_generic_node(android_java_t) -corenet_tcp_connect_adb_port(android_tools_t) -corenet_tcp_connect_http_port(android_tools_t) +corenet_tcp_connect_adb_port(android_java_t) +corenet_tcp_connect_http_port(android_java_t) corenet_udp_bind_generic_node(android_java_t) domain_dontaudit_getattr_all_domains(android_java_t)