Skip to content
Snippets Groups Projects
  • Nick Kralevich's avatar
    cb182aba
    Allow adbd / shell /data/anr access · cb182aba
    Nick Kralevich authored
    The shell user needs to be able to run commands like
    "cat /data/anr/traces.txt". Allow it.
    
    We also need to be able to pull the file via adb.
    "adb pull /data/anr/traces.txt". Allow it.
    
    Addresses the following denials:
    
    <4>[   20.212398] type=1400 audit(1402000262.433:11): avc: denied { getattr } for pid=1479 comm="adbd" path="/data/anr/traces.txt" dev="mmcblk0p28" ino=325763 scontext=u:r:adbd:s0 tcontext=u:object_r:anr_data_file:s0 tclass=file
    <4>[   20.252182] type=1400 audit(1402000262.473:12): avc: denied { read } for pid=1479 comm="adbd" name="traces.txt" dev="mmcblk0p28" ino=325763 scontext=u:r:adbd:s0 tcontext=u:object_r:anr_data_file:s0 tclass=file
    <4>[   20.252579] type=1400 audit(1402000262.473:13): avc: denied { open } for pid=1479 comm="adbd" name="traces.txt" dev="mmcblk0p28" ino=325763 scontext=u:r:adbd:s0 tcontext=u:object_r:anr_data_file:s0 tclass=file
    <4>[   27.104068] type=1400 audit(1402000268.479:14): avc: denied { read } for pid=2377 comm="sh" name="traces.txt" dev="mmcblk0p28" ino=325763 scontext=u:r:shell:s0 tcontext=u:object_r:anr_data_file:s0 tclass=file
    
    Bug: 15450720
    
    (cherry picked from commit 4fd4a205)
    
    Change-Id: Ide6f62183a1c6e2af4cbe84bb0ebb928cd8e63b7
    cb182aba
    History
    Allow adbd / shell /data/anr access
    Nick Kralevich authored
    The shell user needs to be able to run commands like
    "cat /data/anr/traces.txt". Allow it.
    
    We also need to be able to pull the file via adb.
    "adb pull /data/anr/traces.txt". Allow it.
    
    Addresses the following denials:
    
    <4>[   20.212398] type=1400 audit(1402000262.433:11): avc: denied { getattr } for pid=1479 comm="adbd" path="/data/anr/traces.txt" dev="mmcblk0p28" ino=325763 scontext=u:r:adbd:s0 tcontext=u:object_r:anr_data_file:s0 tclass=file
    <4>[   20.252182] type=1400 audit(1402000262.473:12): avc: denied { read } for pid=1479 comm="adbd" name="traces.txt" dev="mmcblk0p28" ino=325763 scontext=u:r:adbd:s0 tcontext=u:object_r:anr_data_file:s0 tclass=file
    <4>[   20.252579] type=1400 audit(1402000262.473:13): avc: denied { open } for pid=1479 comm="adbd" name="traces.txt" dev="mmcblk0p28" ino=325763 scontext=u:r:adbd:s0 tcontext=u:object_r:anr_data_file:s0 tclass=file
    <4>[   27.104068] type=1400 audit(1402000268.479:14): avc: denied { read } for pid=2377 comm="sh" name="traces.txt" dev="mmcblk0p28" ino=325763 scontext=u:r:shell:s0 tcontext=u:object_r:anr_data_file:s0 tclass=file
    
    Bug: 15450720
    
    (cherry picked from commit 4fd4a205)
    
    Change-Id: Ide6f62183a1c6e2af4cbe84bb0ebb928cd8e63b7
shell.te 483 B
# Domain for shell processes spawned by ADB or console service.
type shell, domain, shelldomain, mlstrustedsubject;
type shell_exec, exec_type, file_type;

# Create and use network sockets.
net_domain(shell)

# Run app_process.
# XXX Transition into its own domain?
app_domain(shell)

# logd access
read_logd(shell)
control_logd(shell)

# read files in /data/anr
allow shell anr_data_file:dir r_dir_perms;
allow shell anr_data_file:file r_file_perms;

# inherits from shelldomain.te