1. 22 11月, 2022 8 次提交
  2. 18 11月, 2022 1 次提交
  3. 16 11月, 2022 20 次提交
  4. 15 11月, 2022 1 次提交
  5. 14 11月, 2022 2 次提交
  6. 11 11月, 2022 2 次提交
    • S
      drm: Fix potential null-ptr-deref in drm_vblank_destroy_worker() · 4979524f
      Shang XiaoJing 提交于
      drm_vblank_init() call drmm_add_action_or_reset() with
      drm_vblank_init_release() as action. If __drmm_add_action() failed, will
      directly call drm_vblank_init_release() with the vblank whose worker is
      NULL. As the resule, a null-ptr-deref will happen in
      kthread_destroy_worker(). Add the NULL check before calling
      drm_vblank_destroy_worker().
      
      BUG: null-ptr-deref
      KASAN: null-ptr-deref in range [0x0000000000000068-0x000000000000006f]
      CPU: 5 PID: 961 Comm: modprobe Not tainted 6.0.0-11331-gd465bff1-dirty
      RIP: 0010:kthread_destroy_worker+0x25/0xb0
        Call Trace:
          <TASK>
          drm_vblank_init_release+0x124/0x220 [drm]
          ? drm_crtc_vblank_restore+0x8b0/0x8b0 [drm]
          __drmm_add_action_or_reset+0x41/0x50 [drm]
          drm_vblank_init+0x282/0x310 [drm]
          vkms_init+0x35f/0x1000 [vkms]
          ? 0xffffffffc4508000
          ? lock_is_held_type+0xd7/0x130
          ? __kmem_cache_alloc_node+0x1c2/0x2b0
          ? lock_is_held_type+0xd7/0x130
          ? 0xffffffffc4508000
          do_one_initcall+0xd0/0x4f0
          ...
          do_syscall_64+0x35/0x80
          entry_SYSCALL_64_after_hwframe+0x46/0xb0
      
      Fixes: 5e6c2b4f ("drm/vblank: Add vblank works")
      Signed-off-by: NShang XiaoJing <shangxiaojing@huawei.com>
      Reviewed-by: NLyude Paul <lyude@redhat.com>
      Signed-off-by: NLyude Paul <lyude@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20221101070716.9189-3-shangxiaojing@huawei.com
      4979524f
    • S
      drm/drv: Fix potential memory leak in drm_dev_init() · ff963634
      Shang XiaoJing 提交于
      drm_dev_init() will add drm_dev_init_release() as a callback. When
      drmm_add_action() failed, the release function won't be added. As the
      result, the ref cnt added by device_get() in drm_dev_init() won't be put
      by drm_dev_init_release(), which leads to the memleak. Use
      drmm_add_action_or_reset() instead of drmm_add_action() to prevent
      memleak.
      
      unreferenced object 0xffff88810bc0c800 (size 2048):
        comm "modprobe", pid 8322, jiffies 4305809845 (age 15.292s)
        hex dump (first 32 bytes):
          e8 cc c0 0b 81 88 ff ff ff ff ff ff 00 00 00 00  ................
          20 24 3c 0c 81 88 ff ff 18 c8 c0 0b 81 88 ff ff   $<.............
        backtrace:
          [<000000007251f72d>] __kmalloc+0x4b/0x1c0
          [<0000000045f21f26>] platform_device_alloc+0x2d/0xe0
          [<000000004452a479>] platform_device_register_full+0x24/0x1c0
          [<0000000089f4ea61>] 0xffffffffa0736051
          [<00000000235b2441>] do_one_initcall+0x7a/0x380
          [<0000000001a4a177>] do_init_module+0x5c/0x230
          [<000000002bf8a8e2>] load_module+0x227d/0x2420
          [<00000000637d6d0a>] __do_sys_finit_module+0xd5/0x140
          [<00000000c99fc324>] do_syscall_64+0x3f/0x90
          [<000000004d85aa77>] entry_SYSCALL_64_after_hwframe+0x63/0xcd
      
      Fixes: 2cbf7fc6 ("drm: Use drmm_ for drm_dev_init cleanup")
      Signed-off-by: NShang XiaoJing <shangxiaojing@huawei.com>
      Reviewed-by: NLyude Paul <lyude@redhat.com>
      Signed-off-by: NLyude Paul <lyude@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20221101070716.9189-2-shangxiaojing@huawei.com
      ff963634
  7. 10 11月, 2022 6 次提交