1. 24 11月, 2022 3 次提交
  2. 18 11月, 2022 3 次提交
  3. 08 11月, 2022 1 次提交
  4. 02 11月, 2022 1 次提交
  5. 31 10月, 2022 1 次提交
  6. 19 10月, 2022 2 次提交
  7. 14 10月, 2022 1 次提交
  8. 29 9月, 2022 5 次提交
  9. 04 8月, 2022 1 次提交
  10. 18 7月, 2022 2 次提交
  11. 13 7月, 2022 3 次提交
    • G
      Revert "iommu: handle page response timeout" · bf06a577
      Guo Mengqi 提交于
      hulk inclusion
      category: bugfix
      bugzilla: https://gitee.com/openeuler/kernel/issues/I5EOOG
      CVE: NA
      
      --------------------------------
      
      This reverts commit da76349c.
      However, the iommu_fault_param and iommu_fault_event changes
      are reserved to avoid KABI change.
      Signed-off-by: NGuo Mengqi <guomengqi3@huawei.com>
      Reviewed-by: NWeilong Chen <chenweilong@huawei.com>
      Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
      bf06a577
    • Z
      sw64: iommu: fix iommu interrupt handler · aadce492
      Zheng Chongzhen 提交于
      Sunway inclusion
      category: bugfix
      bugzilla: https://gitee.com/openeuler/kernel/issues/I56OSP
      
      --------------------------------
      
      When porting ZX200 chipset driver on SW64 platform, we meet an IOMMU
      exception show as follows:
      
      iommu_interrupt, iommu_status = 0xc8014000dffe0000, devid 0xa00, dva 0xdffe0000,
      1Unable to handle kernel paging request at virtual address 0000000000000040
      CPU 0 swapper/0(0): Oops 0
      pc = [<ffffffff81424b80>]  ra = [<ffffffff81424b24>]  ps = 0001    Not tainted
      pc is at iommu_interrupt+0x140/0x3e0
      ra is at iommu_interrupt+0xe4/0x3e0
      v0 = 0000000000000051  t0 = c8014000dffe0000  t1 = 0000000000000000
      t2 = 0000000000000000  t3 = 0000000000000000  t4 = 0000000000000001
      t5 = 0000000000000001  t6 = 0000000000000000  t7 = ffffffff82948000
      s0 = fff00003ffff0400  s1 = 0000000000000001  s2 = 0000000000000a00
      s3 = 0000000000000a00  s4 = 00000000dffe0000  s5 = fff0000100680e80
      s6 = ffffffff8294ba70
      a0 = 0000000000000001  a1 = 0000000000000001  a2 = ffffffff8294b790
      a3 = ffffffff8294b7a8  a4 = 0000000000000000  a5 = ffffffff82c5fb7a
      t8 = 0000000000000001  t9 = fffffffffffcac48  t10 = 0000000000000000
      t11= 0000000000000000  pv = ffffffff809f4f10  at = ffffffff82bff6c0
      gp = ffffffff82c1f510  sp = (____ptrval____)
      
      The root cause is that the device which raises iommu exception is not in the
      device list, then reference a null sdev will cause a page fualt. To work
      around this problem, we apply this patch by just clearing IOMMUEXCPT_STATUS
      and then go on.
      
      BTW, why the device raise IOMMU exception is not a valid device ID, it's a
      puzzling problem.
      Signed-off-by: NZheng Chongzhen <zhengchongzhen@wxiat.com>
      Signed-off-by: NGu Zitao <guzitao@wxiat.com>
      aadce492
    • Z
      sw64: iommu: work around iova mapping on pci bars · 5e50a697
      Zhou Qihang 提交于
      Sunway inclusion
      category: bugfix
      bugzilla: https://gitee.com/openeuler/kernel/issues/I5G5T3
      
      --------------------------------
      
      Since the RCs of SW64 chipset do not support Peer-to-Peer DMA, we used
      to return -EINVAL error on iova mampping on PCI BARs. However, it will
      cause driver loading errors when QEMU calls vfio module to passthrough
      PCI devices with this kind of BARs, shown as follows:
      > qemu-system-sw64: VFIO_MAP_DMA: -22
      > qemu-system-sw64: vfio_dma_map(0x121c28020, 0x8800c0000000, 0x40000,
        0x4165f21b2000) = -22 (Invalid argument)
      > qemu: hardware error: vfio: DMA mapping failed, unable to continue
      
      To fix this problem, this patch will return success on the iova mapping
      of PCI BARs that pretends to support this feature.
      Signed-off-by: NZhou Qihang <zhouqihang@wxiat.com>
      Signed-off-by: NGu Zitao <guzitao@wxiat.com>
      5e50a697
  12. 06 7月, 2022 2 次提交
  13. 07 6月, 2022 1 次提交
  14. 28 5月, 2022 1 次提交
  15. 26 5月, 2022 1 次提交
  16. 19 5月, 2022 1 次提交
    • V
      iommu: Fix potential use-after-free during probe · 105248c7
      Vijayanand Jitta 提交于
      stable inclusion
      from stable-v5.10.101
      commit cb86e511e78e796de6947b8f3acca1b7c76fb2ff
      bugzilla: https://gitee.com/openeuler/kernel/issues/I5669Z
      
      Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=cb86e511e78e796de6947b8f3acca1b7c76fb2ff
      
      --------------------------------
      
      commit b54240ad upstream.
      
      Kasan has reported the following use after free on dev->iommu.
      when a device probe fails and it is in process of freeing dev->iommu
      in dev_iommu_free function, a deferred_probe_work_func runs in parallel
      and tries to access dev->iommu->fwspec in of_iommu_configure path thus
      causing use after free.
      
      BUG: KASAN: use-after-free in of_iommu_configure+0xb4/0x4a4
      Read of size 8 at addr ffffff87a2f1acb8 by task kworker/u16:2/153
      
      Workqueue: events_unbound deferred_probe_work_func
      Call trace:
       dump_backtrace+0x0/0x33c
       show_stack+0x18/0x24
       dump_stack_lvl+0x16c/0x1e0
       print_address_description+0x84/0x39c
       __kasan_report+0x184/0x308
       kasan_report+0x50/0x78
       __asan_load8+0xc0/0xc4
       of_iommu_configure+0xb4/0x4a4
       of_dma_configure_id+0x2fc/0x4d4
       platform_dma_configure+0x40/0x5c
       really_probe+0x1b4/0xb74
       driver_probe_device+0x11c/0x228
       __device_attach_driver+0x14c/0x304
       bus_for_each_drv+0x124/0x1b0
       __device_attach+0x25c/0x334
       device_initial_probe+0x24/0x34
       bus_probe_device+0x78/0x134
       deferred_probe_work_func+0x130/0x1a8
       process_one_work+0x4c8/0x970
       worker_thread+0x5c8/0xaec
       kthread+0x1f8/0x220
       ret_from_fork+0x10/0x18
      
      Allocated by task 1:
       ____kasan_kmalloc+0xd4/0x114
       __kasan_kmalloc+0x10/0x1c
       kmem_cache_alloc_trace+0xe4/0x3d4
       __iommu_probe_device+0x90/0x394
       probe_iommu_group+0x70/0x9c
       bus_for_each_dev+0x11c/0x19c
       bus_iommu_probe+0xb8/0x7d4
       bus_set_iommu+0xcc/0x13c
       arm_smmu_bus_init+0x44/0x130 [arm_smmu]
       arm_smmu_device_probe+0xb88/0xc54 [arm_smmu]
       platform_drv_probe+0xe4/0x13c
       really_probe+0x2c8/0xb74
       driver_probe_device+0x11c/0x228
       device_driver_attach+0xf0/0x16c
       __driver_attach+0x80/0x320
       bus_for_each_dev+0x11c/0x19c
       driver_attach+0x38/0x48
       bus_add_driver+0x1dc/0x3a4
       driver_register+0x18c/0x244
       __platform_driver_register+0x88/0x9c
       init_module+0x64/0xff4 [arm_smmu]
       do_one_initcall+0x17c/0x2f0
       do_init_module+0xe8/0x378
       load_module+0x3f80/0x4a40
       __se_sys_finit_module+0x1a0/0x1e4
       __arm64_sys_finit_module+0x44/0x58
       el0_svc_common+0x100/0x264
       do_el0_svc+0x38/0xa4
       el0_svc+0x20/0x30
       el0_sync_handler+0x68/0xac
       el0_sync+0x160/0x180
      
      Freed by task 1:
       kasan_set_track+0x4c/0x84
       kasan_set_free_info+0x28/0x4c
       ____kasan_slab_free+0x120/0x15c
       __kasan_slab_free+0x18/0x28
       slab_free_freelist_hook+0x204/0x2fc
       kfree+0xfc/0x3a4
       __iommu_probe_device+0x284/0x394
       probe_iommu_group+0x70/0x9c
       bus_for_each_dev+0x11c/0x19c
       bus_iommu_probe+0xb8/0x7d4
       bus_set_iommu+0xcc/0x13c
       arm_smmu_bus_init+0x44/0x130 [arm_smmu]
       arm_smmu_device_probe+0xb88/0xc54 [arm_smmu]
       platform_drv_probe+0xe4/0x13c
       really_probe+0x2c8/0xb74
       driver_probe_device+0x11c/0x228
       device_driver_attach+0xf0/0x16c
       __driver_attach+0x80/0x320
       bus_for_each_dev+0x11c/0x19c
       driver_attach+0x38/0x48
       bus_add_driver+0x1dc/0x3a4
       driver_register+0x18c/0x244
       __platform_driver_register+0x88/0x9c
       init_module+0x64/0xff4 [arm_smmu]
       do_one_initcall+0x17c/0x2f0
       do_init_module+0xe8/0x378
       load_module+0x3f80/0x4a40
       __se_sys_finit_module+0x1a0/0x1e4
       __arm64_sys_finit_module+0x44/0x58
       el0_svc_common+0x100/0x264
       do_el0_svc+0x38/0xa4
       el0_svc+0x20/0x30
       el0_sync_handler+0x68/0xac
       el0_sync+0x160/0x180
      
      Fix this by setting dev->iommu to NULL first and
      then freeing dev_iommu structure in dev_iommu_free
      function.
      Suggested-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NVijayanand Jitta <quic_vjitta@quicinc.com>
      Link: https://lore.kernel.org/r/1643613155-20215-1-git-send-email-quic_vjitta@quicinc.comSigned-off-by: NJoerg Roedel <jroedel@suse.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NYu Liao <liaoyu15@huawei.com>
      Reviewed-by: NWei Li <liwei391@huawei.com>
      Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
      105248c7
  17. 17 5月, 2022 2 次提交
  18. 27 4月, 2022 4 次提交
  19. 08 3月, 2022 2 次提交
  20. 02 3月, 2022 1 次提交
  21. 22 2月, 2022 2 次提交