Skip to content
Snippets Groups Projects
  1. Jan 10, 2023
    • Andrei Homescu's avatar
      libbinder: Add binderRpcTestService for Trusty · 9d8adb12
      Andrei Homescu authored
      Add Trusty code and build files for binderRpcTestService
      so we can run the binderRpcTest tests on Android against
      a Trusty service.
      
      Bug: 230135749
      Test: build Trusty
      Test: mmm tests
      Change-Id: Id4dbe453229c1f1b93da2811cec265c0e331edfe
      9d8adb12
  2. Jan 09, 2023
  3. Jan 07, 2023
  4. Jan 06, 2023
  5. Jan 05, 2023
  6. Jan 04, 2023
  7. Jan 03, 2023
    • Pawan Wagh's avatar
    • Pawan Wagh's avatar
      libbinder_rs : removing assert while reading parcel · 74eaf377
      Pawan Wagh authored
      Asserting while trying to read the parcel received from another process
      is causing crashes in fuzzer. Since, there is no gurantee that received
      parcel may have exact data which is being read, this assert should not
      exist.
      
      Test: m libbinder_rs
      Bug: 261827787
      Change-Id: I8a96ef05e65ff8250644accd7d237a486ec16cff
      74eaf377
    • Nikita Ioffe's avatar
      dumpstate: explicitly specify capabilities · 7ffeb395
      Nikita Ioffe authored
      If a service doesn't specify any capabilities in it's definition in the
      .rc file, then it will inherit all the capabilities from the init.
      Although whether a process can use capabilities is actually controlled
      by selinux (so inheriting all the init capabilities is not actually a
      security vulnerability), it's better for defense-in-depth and just
      bookkeeping to explicitly specify the capabilities that dumpstate needs.
      
      The list of capabilities that dumpstate is allowed to use was obtained via:
      ```
      $ adb pull /sys/fs/selinux/policy /tmp/selinux.policy
      $ sesearch --allow -s dumpstate -c capability,capability2 /tmp/selinux.policy
      allow dumpstate dumpstate:capability { chown dac_override dac_read_search fowner fsetid kill net_admin net_raw setgid setuid sys_ptrace sys_resource };
      allow dumpstate dumpstate:capability2 { block_suspend syslog };
      ```
      
      Note: dumpstate can transfer in several other domains, but all of them
      either don't need any capabilities:
      ```
      $ sesearch --allow -s vdc -c capability,capability2 /tmp/selinux.policy
      $ sesearch --allow -s perfetto -c capability,capability2 /tmp/selinux.policy
      $ sesearch --allow -s derive_sdk -c capability,capability2 /tmp/selinux.policy
      ```
      
      Bug: 249796710
      Test: atest BugreportManagerTestCases
      Test: presubmit
      Change-Id: I6f03675b60d69063c3d944b370f4a8d325cfa7f9
      7ffeb395
  8. Dec 30, 2022
  9. Dec 29, 2022
    • Nikita Ioffe's avatar
      installd: explicitly specify capabilities · 85837dbc
      Nikita Ioffe authored
      If a service doesn't specify any capabilities in it's definition in the
      .rc file, then it will inherit all the capabilities from the init.
      Although whether a process can use capabilities is actually controlled
      by selinux (so inheriting all the init capabilities is not actually a
      security vulnerability), it's better for defense-in-depth and just
      bookkeeping to explicitly specify the capabilities that installd needs.
      
      The list of capabilities that installd is allowed to use was obtained via:
      ```
      $ adb pull /sys/fs/selinux/policy /tmp/selinux.policy
      $ sesearch --allow -s installd -c capability,capability2 /tmp/selinux.policy
      allow installd installd:capability { chown dac_override dac_read_search fowner fsetid kill setgid setuid sys_admin };
      ```
      
      Note: installd can transfer in several other domains, but all of them
      either don't need any capabilities, or need a subset of installd
      capabilities:
      ```
      sesearch --allow -s dex2oat -c capability,capability2 /tmp/selinux.policy
      sesearch --allow -s dexoptanalyzer -c capability,capability2 /tmp/selinux.policy
      sesearch --allow -s viewcompiler -c capability,capability2 /tmp/selinux.policy
      sesearch --allow -s profman -c capability,capability2 /tmp/selinux.policy
      sesearch --allow -s idmap -c capability,capability2 /tmp/selinux.policy
      sesearch --allow -s migrate_legacy_obb_data -c capability,capability2 /tmp/selinux.policy
      allow migrate_legacy_obb_data migrate_legacy_obb_data:capability { chown dac_override dac_read_search fowner fsetid };
      ```
      
      Bug: 249796710
      Test: presubmit
      Change-Id: I98d54ab08707e406b54968974ba8ea457499fcde
      85837dbc
    • Steven Moreland's avatar
      native window auto-format · f5927b5d
      Steven Moreland authored
      Bug: N/A
      Test: N/A
      Change-Id: Ia4ea41938dfff18a8c6727b4cdd05bc4e08c7281
      f5927b5d
    • Treehugger Robot's avatar
      ae9dd5a3
    • Steven Moreland's avatar
      libbinder_ndk: add warning to linkToDeath · f270b1d4
      Steven Moreland authored
      For common issue around cookie lifetimes.
      
      Change-Id: Ia1cb8c4278d783acf2af874651bd0d459261a9cf
      Fixes: 254939515
      Test: N/A
      f270b1d4
  10. Dec 27, 2022
  11. Dec 23, 2022
    • Steven Moreland's avatar
      binderRpcTest: ThreadPoolGreaterThanEqualRequested · d6d816f0
      Steven Moreland authored
      This test fails 0.01% of the time, likely due to
      scheduler interactions. We can make the test more robust
      by using a secondary connection to the service, but
      limiting noise from this case for now.
      
      Fixes: 263370125
      Test: binderRpcTest
      Change-Id: I73fdbc9e232fc39ce579957fef32e94af606e56d
      d6d816f0
    • Steven Moreland's avatar
      binder_rpc_fuzzer: limit connections · 10f612bb
      Steven Moreland authored
      Unbounded connections will exhaust resources.
      
      Fixes: 260736889
      Test: w/ reproducer
      Change-Id: Ic21a1b4aab1127fbf4b9d3d943d0b27f423b84ea
      10f612bb
  12. Dec 22, 2022
  13. Dec 21, 2022
    • Steven Moreland's avatar
      libbinder: cache interface descriptor if empty · f2830fe7
      Steven Moreland authored
      This adds a few additional bytes of .ro data to store the warning
      message in the String, but worrying about re-fetching the interface
      descriptor when it is empty (which happens less often in native
      code after BBinder has a default descriptor, but still happens in
      Java, or in custom implementations) adds complexity to other code.
      Since we guarantee to always cache the descriptor, we don't need
      to think about this case as much.
      
      One alternative implementation would be to drop BpBinder mObitsSent
      and use both !mAlive and an empty obituary list to represent the
      obituaries being sent. However, due to sendObituary using mObitsSent
      in order to avoid taking a lock in some cases (something that
      should have never been done, because it's optimizing a fast path
      and the way it does it means that certain races will take a lock
      part of the time - which is flake prone), I couldn't find a way to
      remove this variable without introducing the possibility that
      we take an extra lock after linkToDeath fires, which could prevent
      system recovery and cause a deadlock. Moving this variable would
      have to be done more carefully.
      
      For now, we can avoid repeated binder calls for an empty interface
      descriptor. This is intended to help justify (perhaps overly so)
      other changes being made in the bug, but I'm submitting it for
      review entirely independently, because it's not strictly necessary
      for correctness assuming that the corresponding Bn implementation
      of getInterfaceDescriptor is correct. If the implementation of this
      function is adverserial, it could lead to a deadlock in some
      situations, but a far easier way to cause this same deadlock would
      be to not return from getInterfaceDescriptor at all, which is
      well-known.
      
      Bug: 262463798
      Test: binderAllocationLimits
      Change-Id: I07aee55f6092b52189ad2fadbbcd0880e2e3cbf4
      f2830fe7
    • Steven Moreland's avatar
      libbinder_ndk: ABpBinder linkern'space muliplicity · faf25a40
      Steven Moreland authored
      Previously, if the same process loaded the same class in two different
      linker namespaces, you could not have an ABpBinder which pointed to the
      same service in both of them.
      
      I kind of did this intentionally, because at the time I was still
      figuring out a lot of this stuff, and I didn't want to make the
      implementation unnecessarily complicated. I also wanted a chance to
      investigate these issues. In some cases, this may mean that an ODR
      issue is less noticeable (however - the way we should fix these is
      by having the build system and linkers detect when we overwrite a
      symbol which is not binary identical - a very difficult a noisy
      task, but a neglected and unfortunate one). Anyway, we have other
      checks for ODR issues now in the AIDL build system. It's okay.
      
      Anyway - it turns out the stability mechanism in AIDL is really
      awesome and enables some awesome usecases, so we need this support
      now. Well.
      
      Fixes: 262463798
      Test: libbinder_ndk_unit_test
      Change-Id: Idce05e13768cd4ad10c64873f393535d74cd4d3e
      faf25a40
    • Steven Moreland's avatar
      libbinder_ndk: remove associateClassInternal · 94a76791
      Steven Moreland authored
      The code here was pretty difficult to understand.
      
      Bug: 262463798
      Test: atest CtsNdkBinderTestCases
      Change-Id: Ie9920192a685149d3d5723e83246d59aa8ef50f4
      94a76791
    • Trevor Black's avatar
      Merge changes from topic "AHB_format_r_16+" · 112211ee
      Trevor Black authored
      * changes:
        The ahb changes necessary for
        swapchain: Don't call native_window_get_wide_color_support
      112211ee
  14. Dec 20, 2022
Loading