Chris Wilson
0e799e840a
drm: Restore the NULL check for drm_gem_object_put()
...
Some users want to pass NULL to drm_gem_object_put(), but those using
__drm_gem_object_put() did not. Compromise, have both and let the
compiler sort it out.
drm_gem_fb_destroy() calls drm_gem_object_put() with NULL obj causing:
[ 11.584209] BUG: kernel NULL pointer dereference, address: 0000000000000000
[ 11.584213] #PF: supervisor write access in kernel mode
[ 11.584215] #PF: error_code(0x0002) - not-present page
[ 11.584216] PGD 0 P4D 0
[ 11.584220] Oops: 0002 [#1 ] SMP NOPTI
[ 11.584223] CPU: 7 PID: 1571 Comm: gnome-shell Tainted: G E 5.7.0-rc1-1-default+ #27
[ 11.584225] Hardware name: Micro-Star International Co., Ltd. MS-7A31/X370 XPOWER GAMING TITANIUM (MS-7A31), BIOS 1.MR 12/03/2019
[ 11.584237] RIP: 0010:drm_gem_fb_destroy+0x28/0x70 [drm_kms_helper]
<snip>
[ 11.584256] Call Trace:
[ 11.584279] drm_mode_rmfb+0x189/0x1c0 [drm]
[ 11.584299] ? drm_mode_rmfb+0x1c0/0x1c0 [drm]
[ 11.584314] drm_ioctl_kernel+0xaa/0xf0 [drm]
[ 11.584329] drm_ioctl+0x1ff/0x3b0 [drm]
[ 11.584347] ? drm_mode_rmfb+0x1c0/0x1c0 [drm]
[ 11.584421] amdgpu_drm_ioctl+0x49/0x80 [amdgpu]
[ 11.584427] ksys_ioctl+0x87/0xc0
[ 11.584430] __x64_sys_ioctl+0x16/0x20
[ 11.584434] do_syscall_64+0x5f/0x240
[ 11.584438] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 11.584440] RIP: 0033:0x7f0ef80f7227
Reported-by: Nirmoy Das <nirmoy.das@amd.com>
Fixes: b5d250744ccc ("drm/gem: fold drm_gem_object_put_unlocked and __drm_gem_object_put()")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Nirmoy Das <nirmoy.das@amd.com>
Cc: Emil Velikov <emil.velikov@collabora.com>
Cc: Christian König <christian.koenig@amd.com>.
Acked-by: Nirmoy Das <nirmoy.das@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200520142347.29060-1-chris@chris-wilson.co.uk
2020-05-20 17:05:07 +01:00
..
2020-04-10 09:52:15 -07:00
2020-04-01 08:03:28 +02:00
2020-04-09 09:31:38 -06:00
2020-03-25 11:50:48 +01:00
2020-04-07 10:43:41 -07:00
2020-04-10 17:20:06 -07:00
2020-04-03 15:05:35 -07:00
2020-04-10 17:57:48 -07:00
2020-04-05 10:43:32 -07:00
2020-04-05 09:24:58 +02:00
2020-04-06 10:14:39 -07:00
2020-04-10 11:32:22 +02:00
2020-04-08 21:35:29 -07:00
2020-04-02 19:15:03 -07:00
2020-03-25 08:35:03 +09:00
2020-04-10 15:36:22 -07:00
2020-05-20 13:02:19 +02:00
2020-03-30 16:40:08 -07:00
2020-03-25 11:50:48 +01:00
2020-04-03 13:22:40 -07:00
2020-04-10 12:27:06 -07:00
2020-04-04 10:27:00 -07:00
2020-05-20 17:05:07 +01:00
2020-04-01 15:18:42 -07:00
2020-04-07 10:43:40 -07:00
2020-04-10 15:36:22 -07:00
2020-03-25 22:30:46 -07:00
2020-03-24 13:45:24 +01:00
2020-04-02 15:54:13 -07:00
2020-03-29 10:35:50 +02:00
2020-04-04 18:07:59 -07:00
2020-03-30 16:40:08 -07:00
2020-04-08 21:25:49 -07:00
2020-04-01 18:18:18 -07:00
2020-04-07 20:20:12 -07:00
2020-03-27 11:33:27 +01:00
2020-04-05 11:57:12 -07:00
2020-04-06 23:12:08 +02:00
2020-03-30 11:43:51 -07:00
2020-04-03 13:22:40 -07:00
2020-04-08 21:03:40 -07:00
2020-03-30 15:05:01 -07:00
2020-04-03 15:05:35 -07:00
2020-03-26 22:40:47 -04:00
2020-03-30 07:35:28 +01:00
2020-04-08 10:51:53 -07:00
2020-03-31 16:13:09 -07:00
2020-03-24 13:42:44 +01:00
2020-04-07 12:40:56 -07:00
2020-04-08 10:51:53 -07:00
2020-03-25 18:58:11 -07:00
2020-04-03 14:25:02 -07:00
2020-04-08 21:03:40 -07:00
2020-04-10 10:06:54 -07:00
2020-03-25 19:23:49 +01:00
2020-04-02 17:32:52 -07:00
2020-04-05 22:05:23 +02:00
2020-04-08 11:00:00 -07:00
2020-03-31 18:48:22 +02:00
2020-03-31 10:05:01 -07:00
2020-04-03 14:25:02 -07:00
2020-04-04 10:27:00 -07:00
2020-04-10 15:36:22 -07:00
2020-04-10 15:36:22 -07:00
2020-03-30 16:40:08 -07:00
2020-04-03 00:09:59 +11:00
2020-03-30 11:16:38 -07:00
2020-04-03 21:41:42 +02:00
2020-03-30 14:58:26 -07:00
2020-04-03 10:47:21 -07:00
2020-04-07 19:48:52 -07:00
2020-04-10 12:21:11 -07:00
2020-04-10 12:21:11 -07:00
2020-04-09 10:51:30 -07:00
2020-04-03 13:22:40 -07:00
2020-04-02 15:50:04 -07:00
2020-04-10 15:36:21 -07:00
2020-04-10 12:21:11 -07:00
2020-04-03 15:05:35 -07:00
2020-04-07 20:00:16 -07:00
2020-04-05 11:12:59 -07:00
2020-04-02 17:03:53 -07:00
2020-04-02 10:41:40 -04:00
2020-04-01 13:51:51 -06:00
2020-04-02 10:41:40 -04:00
2020-05-18 12:10:02 +02:00
2020-04-08 10:51:53 -07:00
2020-04-01 11:35:23 +02:00
2020-04-10 17:20:06 -07:00
2020-04-03 13:12:26 -07:00
2020-04-08 10:51:53 -07:00
2020-04-08 10:51:53 -07:00