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-05-19 22:31:31 +01:00
2020-03-18 17:53:28 +01:00
2020-05-19 22:31:31 +01:00
2020-05-19 22:31:32 +01:00
2020-04-28 16:13:03 +02:00
2020-05-08 09:29:18 +02:00
2020-04-02 14:16:44 +02:00
2020-04-28 16:14:17 +02:00
2020-05-18 21:37:02 +02:00
2020-05-19 22:31:32 +01:00
2020-05-19 22:31:32 +01:00
2020-04-02 14:16:44 +02:00
2020-05-19 22:31:32 +01:00
2020-04-13 01:46:02 +00:00
2020-05-09 23:06:07 +02:00
2020-05-20 17:05:07 +01:00
2020-04-02 14:16:44 +02:00
2020-04-28 16:03:53 +02:00
2020-05-19 22:31:33 +01:00
2020-05-12 13:48:24 +02:00
2020-05-19 22:31:33 +01:00
2020-05-05 10:19:33 +02:00
2020-05-19 22:31:33 +01:00
2020-05-19 22:31:33 +01:00
2020-05-19 22:31:33 +01:00
2020-05-19 22:31:34 +01:00
2020-05-09 22:11:45 +02:00
2020-05-19 22:31:34 +01:00
2020-04-28 14:06:20 -05:00
2020-05-19 22:31:34 +01:00
2020-04-03 17:11:41 +02:00
2020-05-19 22:31:34 +01:00
2020-04-02 14:16:45 +02:00
2020-05-19 22:31:35 +01:00
2020-03-26 10:22:36 -04:00
2020-02-12 18:32:54 +01:00
2020-04-02 14:16:45 +02:00
2020-03-18 17:53:28 +01:00
2020-04-27 15:42:12 +02:00
2020-05-15 15:01:04 +02:00
2020-05-19 22:31:35 +01:00
2020-05-05 10:00:07 +03:00
2020-05-19 09:56:58 +03:00
2020-04-28 16:05:15 +02:00
2020-04-17 08:12:22 +02:00
2020-05-06 21:08:37 +02:00
2020-05-19 22:31:35 +01:00
2020-04-28 15:08:51 +02:00
2020-05-19 22:31:35 +01:00
2020-05-19 22:31:36 +01:00
2020-05-19 22:31:36 +01:00
2020-05-19 22:31:36 +01:00
2020-04-03 09:07:49 +10:00
2020-05-19 22:31:36 +01:00
2020-04-02 14:16:46 +02:00
2020-02-15 13:21:22 +01:00
2020-03-18 17:53:28 +01:00
2020-03-30 12:20:41 +01:00
2020-03-31 11:12:42 +02:00
2020-02-26 13:31:41 +02:00
2020-02-26 13:31:41 +02:00
2020-04-03 17:11:41 +02:00
2020-05-18 16:32:59 +01:00
2020-05-19 22:31:31 +01:00
2020-03-18 17:52:36 +02:00
2020-03-16 09:23:55 +01:00
2020-02-15 21:15:17 +01:00
2020-03-18 17:53:28 +01:00
2020-05-17 17:27:57 +01:00
2020-04-03 17:11:41 +02:00
2020-05-18 16:33:40 +01:00
2020-05-18 16:33:40 +01:00
2020-04-28 15:05:19 +02:00
2020-04-29 18:44:26 +03:00
2020-05-17 21:29:41 +01:00
2020-04-21 08:15:03 +02:00
2020-04-08 16:27:08 +02:00
2020-05-19 22:31:37 +01:00
2020-02-17 10:27:13 +01:00
2020-03-18 17:53:28 +01:00
2020-05-19 22:31:31 +01:00
2020-05-19 22:31:31 +01:00
2020-05-19 22:31:31 +01:00
2020-05-19 22:31:31 +01:00
2020-05-19 22:31:31 +01:00
2020-05-19 22:31:31 +01:00
2020-03-04 06:33:00 +05:30
2020-03-26 15:38:17 +01:00
2020-05-19 22:31:37 +01:00
2020-05-19 22:31:37 +01:00
2020-02-11 18:39:47 +02:00
2020-03-18 14:42:18 +01:00
2020-03-16 09:27:09 +01:00
2020-05-18 16:27:54 +01:00
2020-03-26 16:09:10 +01:00
2020-05-05 13:39:38 +02:00
2020-03-26 15:45:43 +01:00
2020-05-05 10:51:56 +02:00
2020-04-29 18:44:26 +03:00
2020-04-03 17:11:41 +02:00
2020-05-19 22:31:31 +01:00
2020-05-17 21:54:16 +01:00
2020-02-29 00:16:12 +01:00
2020-03-06 09:24:29 +01:00
2020-03-11 14:54:09 +01:00
2020-05-14 14:35:13 +02:00
2020-05-19 21:52:16 +01:00
2020-04-28 16:05:15 +02:00
2020-04-28 16:05:15 +02:00