Skip to content
Snippets Groups Projects
  1. Jul 11, 2024
    • quic_anane's avatar
      dsp-kernel: Handle UAF scenario in put_args · 0e27b6c7
      quic_anane authored
      
      Currently, the DSP updates header buffers with unused DMA handle fds.
      In the put_args section, if any DMA handle FDs are present in the
      header buffer, the corresponding map is freed. However, since the
      header buffer is exposed to users in unsigned PD, users can update
      invalid FDs. If this invalid FD matches with any FD that is already
      in use, it could lead to a use-after-free (UAF) vulnerability.
      As a solution,add DMA handle references for DMA FDs, and the map for
      the FD will be freed only when a reference is found.
      
      Change-Id: Ie4d19dc0ef0ebdda5ed2fe6f7b64598ef661a63f
      Signed-off-by: default avatarquic_anane <quic_anane@quicinc.com>
      0e27b6c7
  2. Jul 10, 2024
  3. Jul 09, 2024
  4. Jul 08, 2024
  5. Jul 03, 2024
    • Ramesh Nallagopu's avatar
      dsp-kernel: Fix to avoid untrusted pointer dereference · c60ac212
      Ramesh Nallagopu authored
      
      Currently, the compat ioctl call distinguishes itself using a global
      flag. If a user sends a compat ioctl call followed by a normal ioctl
      call, it may result in using a user passed address as a kernel address
      in the fastrpcdriver. To address this issue, consider localizing the
      compat flag for the ioctl call.
      
      Change-Id: Ie8fc724424534102736b8c0bc594720547ab6ff6
      Signed-off-by: default avatarrnallago <quic_rnallago@quicinc.com>
      c60ac212
    • Abhishek Singh's avatar
      dsp-kernel: Do not search the global map in the process-specific list · e2cfdde4
      Abhishek Singh authored
      
      If a user makes the ioctl call for the fastrpc_internal_mmap with the
      global map flag, fd, and va corresponding to some map already present
      in the process-specific list, then this map present in the process-
      specific list could be added to the global list. Because global maps
      are also searched in the process-specific list. If a map gets removed
      from the global list and another concurrent thread is using the same
      map for a process-specific use case, it could lead to a use-after-free.
      Avoid searching the global map in the process-specific list.
      
      Change-Id: I59c820eb984945d39cd6e4b163307ea43ee4d2f4
      Signed-off-by: default avatarAbhishek Singh <quic_abhishes@quicinc.com>
      e2cfdde4
  6. Jun 28, 2024
  7. Jun 24, 2024
  8. Jun 18, 2024
    • qctecmdr's avatar
      e5f9d3ac
    • Abhishek Singh's avatar
      dsp-kernel: Handle the spinlock recursion · 3463a894
      Abhishek Singh authored
      
      Currently, in print_debug_data, kref_put is being called inside the
      global lock, and the same lock is taken in the release callback of
      kref_put, leading to spinlock recursion. There is no need to get and
      put the reference for the fastrpce file inside this function because
      we have already taken the reference inside the update_ramdump_status
      while adding the init memory entry to the chan->initmems list.
      Moreover, the same list will be used in print_debug_data.
      
      Signed-off-by: default avatarAbhishek Singh <quic_abhishes@quicinc.com>
      Change-Id: Ifdc8b3e0c2bbc5cc4237eedaa24c8cd766262dfe
      3463a894
  9. Jun 08, 2024
  10. Jun 06, 2024
  11. May 30, 2024
  12. May 29, 2024
  13. May 28, 2024
  14. May 27, 2024
  15. May 21, 2024
  16. May 16, 2024
  17. May 14, 2024
  18. May 09, 2024
  19. May 02, 2024
  20. Apr 27, 2024
    • Abhishek Singh's avatar
      dsp-kernel: use-after-free (UAF) in global maps · 6dab51a3
      Abhishek Singh authored
      
      Currently, remote heap maps get added to the global list before the
      fastrpc_internal_mmap function completes the mapping. Meanwhile, the
      fastrpc_internal_munmap function accesses the map, starts unmapping, and
      frees the map before the fastrpc_internal_mmap function completes,
      resulting in a use-after-free (UAF) issue. Add the map to the list after
      the fastrpc_internal_mmap function completes the mapping.
      
      Signed-off-by: default avatarAbhishek Singh <quic_abhishes@quicinc.com>
      Change-Id: I8aa23cf215e53d0613774c2b2657954bca6c72f4
      6dab51a3
  21. Apr 10, 2024
  22. Mar 29, 2024
  23. Mar 22, 2024
  24. Mar 14, 2024
  25. Mar 07, 2024
  26. Mar 05, 2024
    • quic_anane's avatar
      dsp-kernel: Handle race-condition in dsp signal · 1d05790e
      quic_anane authored
      
      The `fastrpc_dspsignal_wait` function currently checks the
      signal state before waiting for a signal from the DSP. However,
      if the signal is already received before the check, it results
      in an infinite loop, causing excessive resource usage.
      
      This change addresses the race condition by checking both the
      pending and signaled states. If the signal is not in the pending
      state, it directly checks for the signaled state, resets the states,
      and returns to avoid looping.
      
      Change-Id: I00f80780cccf5a7b0e95f961607042efe62d9d30
      Signed-off-by: default avatarquic_anane <quic_anane@quicinc.com>
      1d05790e
    • Ramesh Nallagopu's avatar
      msm: adsprpc : Fix use after free in fastrpc_update_ramdump_status · cc973878
      Ramesh Nallagopu authored
      
      Thread1 can free up the fl->init memory in
      fastrpc_init_create_dynamic_process  with fl spin lock, same time thread2
      adding fl->init_mem to chan->initmems list with global spin lock in
      fastrpc_update_ramdump_status can lead to use after free in
      fastrpc_ramdump_collection. Fix is to use global spin lock while
      handling fl->init_mem.
      
      Change-Id: I7a497dc962b6967a4d594a3acce55f8ce0eb3a55
      Signed-off-by: default avatarrnallago <quic_rnallago@quicinc.com>
      cc973878
    • Ansa Ahmed's avatar
      msm: adsprpc: Handle UAF in fastrpc_mmap_remove_ssr · 4e20907a
      Ansa Ahmed authored
      
      Currently unlocking the spinlock during maps list iteration
      can lead to use after free. Fix is to lock, read one map
      from list, stop iteration and unlock, repeate same for all
      the maps complete in the list.
      
      Acked-by: default avatarRamesh Nallagopu <rnallago@qti.qualcomm.com>
      Change-Id: I834bdcb9dd55a33f6308188ec1f844b7d81cb30e
      Signed-off-by: default avatarAnsa Ahmed <quic_ansa@quicinc.com>
      4e20907a
  27. Mar 04, 2024
  28. Feb 20, 2024
  29. Feb 08, 2024
  30. Feb 06, 2024
  31. Jan 25, 2024
  32. Jan 24, 2024
    • Edgar Flores's avatar
      msm: adsprpc: Set buffer type in TVM to non-secure · 698dfba6
      Edgar Flores authored
      Customer is seeing issue when sharing buffer to secure PD.
      Buffer is being set to 'secure buffer type' by trusted driver which
      is invalid in TVM.
      There are no 'secure' buffers on TVM. All buffers in TVM need to be
      marked as 'non-secure'.
      
      Fix is to explicitly mark buffers as 'non-secure' for TVM only.
      
      Change-Id: I80c70bc59dcbd78be4119c1855fd4e5fa2e7d5cb
      698dfba6
Loading