From 386a0f09dd747ab81cfa2b31191bdc1394bb32f3 Mon Sep 17 00:00:00 2001
From: Johan Redestig <johan.redestig@sonymobile.com>
Date: Thu, 2 Apr 2015 11:16:42 +0200
Subject: [PATCH] nfc: allow sending bugreports via nfc

Same change as 9819a6 but for nfc.

Nfc can receive bugreport data for beaming to another device.
This comes across as an open file descriptor. Allow nfc access
to bugreports.

Addresses the following denial:

  avc: denied { read } for path="/data/data/com.android.shell/files/bugreports/bugreport-2015-03-30-04-49-57.txt" dev="mmcblk0p27" ino=82334 scontext=u:r:nfc:s0 tcontext=u:object_r:shell_data_file:s0 tclass=file op_res=-13 ppid=435 pcomm="main" tgid=23475 tgcomm="m.android.shell"

Change-Id: I3efefcdb46444a1a6520803cb5e68bbdf29d3ad6
---
 nfc.te | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/nfc.te b/nfc.te
index 3545e2335..de482f442 100644
--- a/nfc.te
+++ b/nfc.te
@@ -44,4 +44,9 @@ auditallow nfc {
     -trust_service
     -user_service
     -vibrator_service
-}:service_manager find;
\ No newline at end of file
+}:service_manager find;
+
+# already open bugreport file descriptors may be shared with
+# the nfc process, from a file in
+# /data/data/com.android.shell/files/bugreports/bugreport-*.
+allow nfc shell_data_file:file read;
-- 
GitLab