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