Skip to content
Snippets Groups Projects
  1. Oct 19, 2018
  2. Oct 18, 2018
    • Nick Kralevich's avatar
      start enforcing ioctl restrictions on blk_file · 4c8eaba7
      Nick Kralevich authored
      Start enforcing the use of ioctl restrictions on all Android block
      devices. Domains which perform ioctls on block devices must be explicit
      about what ioctls they issue. The only ioctls allowed by default are
      BLKGETSIZE64, BLKSSZGET, FIOCLEX, and FIONCLEX.
      
      Test: device boots and no problems.
      Change-Id: I1195756b20cf2b50bede1eb04a48145a97a35867
      4c8eaba7
    • Treehugger Robot's avatar
      2581761e
    • Nick Kralevich's avatar
      Allow TCGETS on pipes (fifo_file) · 67900089
      Nick Kralevich authored
      Allow a process to determine if a fifo_file (aka pipe, created from the
      pipe() or pipe2() syscall) is a tty.
      
      Addresses the following denials:
      
      type=1400 audit(0.0:1307): avc: denied { ioctl } for comm="ls" path="pipe:[213117]" dev="pipefs" ino=213117 ioctlcmd=5401 scontext=u:r:hal_dumpstate_impl:s0 tcontext=u:r:hal_dumpstate_impl:s0 tclass=fifo_file permissive=0
      type=1400 audit(0.0:22): avc: denied { ioctl } for comm="sh" path="pipe:[54971]" dev="pipefs" ino=54971 ioctlcmd=5401 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:r:untrusted_app_27:s0:c512,c768 tclass=fifo_file permissive=0 app=com.zhihu.android
      type=1400 audit(0.0:237): avc: denied { ioctl } for comm="sh" path="pipe:[56997]" dev="pipefs" ino=56997 ioctlcmd=5401 scontext=u:r:untrusted_app_25:s0:c512,c768 tcontext=u:r:untrusted_app_25:s0:c512,c768 tclass=fifo_file permissive=0 app=fm.qingting.qtradio
      
      Test: policy compiles and device builds.
      Change-Id: Ic4c6441d0ec33de8cda3f13ff529e98374897364
      67900089
    • Nick Kralevich's avatar
      Move class bpf definition · f5a1b1bf
      Nick Kralevich authored
      No functional change. This reorg just makes it easier to perform diffs
      against https://github.com/SELinuxProject/refpolicy/blob/master/policy/flask/access_vectors
      
      Test: policy builds.
      Change-Id: I10cf9547d57981c76ee7e76daa382bb504e36d0b
      f5a1b1bf
    • Tri Vo's avatar
      a8131148
    • Jiyong Park's avatar
      Allow apexd to realpath(3) on apex_key_files · ecc09871
      Jiyong Park authored
      apexd uses realpath(3) to ensure that the public key file that will use
      is under /system/etc/security/apex directory. In order to support it,
      allow apexd to getattr on apex_key_files.
      
      The canonicalization is required because the key name from APEX might be
      wrong. For example, if the key name from an APEX is '../../some/path'
      then apexd will use '/system/etc/security/apex/../../some/path' as the
      public key file, which is incorrect.
      
      Bug: 115721587
      Test: m apex.test; m
      /apex/com.android.example.apex@1 exists
      
      Change-Id: I6dc5efa0de369f8497e4f6526e0164e2de589c67
      ecc09871
    • Zheng Zhang's avatar
      Allow mediaserver domain have getatrr perm on vendor_app_file · a26763ec
      Zheng Zhang authored
      When running some apps in vendor partition, it report denials like:
      
      avc: denied { getattr } for comm="Binder:901_2" path="/vendor/operator/app/Wechat/Wechat.apk" dev="sde14" ino=1707 scontext=u:r:mediaserver:s0 tcontext=u:object_r:vendor_app_file:s0 tclass=file permissive=0
      a26763ec
    • Nick Kralevich's avatar
      Merge "FIONCLEX: fix MIPS ioctl number" · 063068f8
      Nick Kralevich authored
      am: afdcd959
      
      Change-Id: Id2fe422a32a818648e7c31f27a5a894396061627
      063068f8
  3. Oct 17, 2018
    • Tri Vo's avatar
      Neverallow vendor code access to files on /system. · c855629e
      Tri Vo authored
      What changed:
      - Tightening neverallow forbidding vendor execution access in /system.
      In it's current form the neverallow is loose because not all executables
      have exec_type attribute, e.g. almost everything in /system/bin/. This
      change tightens up the neverallow by instead targeting system_file_type
      attribute, which must be applied to all files in /system.
      - Adding a general neverallow forbidding all access to files in /system
      (bar exceptions)
      
      TODOs:
      - Remove loopholes once Treble violations are fixed across all internal
      build targets.
      
      Bug: 111243627
      Test: m selinux_policy; build-only change
      Change-Id: Ic8d71c8d139cad687ad7d7c9db7111240475f175
      c855629e
    • Treehugger Robot's avatar
      afdcd959
    • Nick Kralevich's avatar
      Merge "more ioctl work" · da8e03da
      Nick Kralevich authored
      am: 5a7b8206
      
      Change-Id: I753b83b0f59aa5ecec568ffb3cd11d88de99011c
      da8e03da
    • Treehugger Robot's avatar
      Merge "more ioctl work" · 5a7b8206
      Treehugger Robot authored
      5a7b8206
    • Nick Kralevich's avatar
      mediaprovider: add functionfs ioctl · f00935a5
      Nick Kralevich authored
      am: a73f58ae
      
      Change-Id: I573c72eb0795862a498772e74cb7f230876fa914
      f00935a5
    • Nick Kralevich's avatar
      FIONCLEX: fix MIPS ioctl number · 6bb05751
      Nick Kralevich authored
      The ioctl number varies between MIPS devices and other devices.
      
      Test: policy compiles.
      Change-Id: I107ccd2eca626148d2573f51753ec433e20d6b74
      6bb05751
    • Nick Kralevich's avatar
      more ioctl work · 8ee8e263
      Nick Kralevich authored
      Add a neverallow rule requiring fine-grain ioctl filtering for most file
      and socket object classes. Only chr_file and blk_file are excluded. The
      goal is to ensure that any file descriptor which supports ioctl commands
      uses a whitelist.
      
      Further refine the list of file / socket objects which require ioctl
      filtering. The previous ioctl filtering did not cover the following:
      
      1) ioctls on /proc/PID files
      2) ioctls on directories in /dev
      3) PDX unix domain sockets
      
      Add FIONCLEX to the list of globally safe ioctls. FIOCLEX and FIONCLEX
      are alternate, uncommon ways to set the O_CLOEXEC flag on a file
      descriptor, which is a harmless operation.
      
      Test: device boots and no problems.
      Change-Id: I6ba31fbe2f21935243a344d33d67238d72a8e618
      8ee8e263
    • Nick Kralevich's avatar
      mediaprovider: add functionfs ioctl · a73f58ae
      Nick Kralevich authored
      Addresses the following denial:
      
      type=1400 audit(0.0:51894): avc: denied { ioctl } for comm="MtpServer" path="/dev/usb-ffs/mtp/ep1" dev="functionfs" ino=30291 ioctlcmd=0x6782 scontext=u:r:mediaprovider:s0:c512,c768 tcontext=u:object_r:functionfs:s0 tclass=file permissive=0 app=com.android.providers.media
      
      Test: policy compiles.
      Change-Id: I5290abb2848e5824669dae4cea829d4cbea98ab4
      a73f58ae
    • Dario Freni's avatar
      Allow apexd to create symlink in /apex. · 84a010c4
      Dario Freni authored
      am: bab267a8
      
      Change-Id: I2ae046cd9434b983abe6366bd72e595b48ddfdf4
      84a010c4
    • Dario Freni's avatar
      Allow apexd to create symlink in /apex. · bab267a8
      Dario Freni authored
      Bug: 115710947
      Test: on device
      Change-Id: Ie712689d80fb829f16de70e865cac4f0ff4e9b35
      bab267a8
    • Bowgo Tsai's avatar
      Merge "Allow input config to be under /vendor/odm" · 0a2efc16
      Bowgo Tsai authored
      am: 247f061a
      
      Change-Id: Ibec2927b80068cedc0c7ba7391e6fe53d9ae0892
      0a2efc16
    • Treehugger Robot's avatar
  4. Oct 16, 2018
    • Tri Vo's avatar
      Reland "Treat input files as public API." · 708be5e1
      Tri Vo authored
      am: 888b9213
      
      Change-Id: I11b5fcd8a8ff1429b8454c87bab3c4a3b7b39372
      708be5e1
    • Tri Vo's avatar
      Reland "Treat input files as public API." · 888b9213
      Tri Vo authored
      Input files are public API:
      https://source.android.com/devices/input/input-device-configuration-files
      Now that they have labels from core policy (aosp/782082), we can tighten
      up our neverallows.
      
      Bug: 37168747
      Test: m selinux_policy
      Change-Id: Ifaf9547993eb8c701fb63b7ee41971ea4e3f7cf9
      888b9213
    • Nick Kralevich's avatar
      add map permission to rw_socket_perms · 2e7ac24b
      Nick Kralevich authored
      am: 9c22895c
      
      Change-Id: Icf1b28c653ed40e827ad087dec13bcd02b9ba484
      2e7ac24b
    • Bowgo Tsai's avatar
      Allow input config to be under /vendor/odm · 59129311
      Bowgo Tsai authored
      Input config should be under /odm when it's "device-specific",
      instead of /vendor (for "SoC-specific").
      
      However, not all device have /odm partition so having the fallback
      symlink: /odm -> /vendor/odm is important
      
      Bug: 112880217
      Test: build
      Change-Id: I294e2b172d06d58a42c51c128e448c7644f854dc
      59129311
    • Nick Kralevich's avatar
      add map permission to rw_socket_perms · 9c22895c
      Nick Kralevich authored
      Kernel commit 3ba4bf5f1e2c ("selinux: add a map permission check for
      mmap") added a map permission check on mmap so that we can
      distinguish memory mapped access (since it has different implications
      for revocation).  The purpose of a separate map permission check on
      mmap(2) is to permit policy to prohibit memory mapping of specific
      files for which we need to ensure that every access is revalidated,
      particularly useful for scenarios where we expect the file to be
      relabeled at runtime in order to reflect state changes (e.g.
      cross-domain solution, assured pipeline without data copying).
      
      system/sepolicy commit 4397f082 added
      the map permission to common file macros, to ensure that file access
      would continue working even in the presence of a newer kernel. However,
      that change did not affect socket access.
      
      Certain socket classes, such as AF_NETLINK and AF_PACKET, also support
      mmap operations. This change adds the map permission to rw_socket_perms,
      to ensure continued support for newer kernels.
      
      This technically allows mmap even in cases where the socket family
      doesn't support it (such as TCP and UDP sockets), but granting it
      is harmless in those cases.
      
      In particular, this fixes a bug in clatd, where the following error
      would occur:
      
        10-01 13:59:03.182 7129 7129 I clatd : Starting clat version 1.4 on rmnet0 netid=100 mark=0xf0064
        10-01 13:59:03.195 7129 7129 I auditd : type=1400 audit(0.0:18): avc: denied { map } for comm="clatd" path="socket:[52802]" dev="sockfs" ino=52802 scontext=u:r:clatd:s0 tcontext=u:r:clatd:s0 tclass=packet_socket permissive=0
        10-01 13:59:03.195 7129 7129 W clatd : type=1400 audit(0.0:18): avc: denied { map } for path="socket:[52802]" dev="sockfs" ino=52802 scontext=u:r:clatd:s0 tcontext=u:r:clatd:s0 tclass=packet_socket permissive=0
        10-01 13:59:03.199 7129 7129 F clatd : mmap 1048576 failed: Permission denied
      
      Test: policy compiles
      Bug: 117791876
      Change-Id: I39f286d577b4a2160037ef271517ae8a3839b49b
      9c22895c
    • Chong Zhang's avatar
      add media.codec.update service · c601d9e5
      Chong Zhang authored
      am: 52fb3edb
      
      Change-Id: I106c471e9251ec7a4f43b13103c429c3b4fc2476
      c601d9e5
  5. Oct 15, 2018
Loading