Jean-Sébastien Pédron
bc346eefbd
drm: Import Linux commit b7ea85a4fed37835eec78a7be3039c8dc22b8178
Author: Huacai Chen <chenhc@lemote.com>
Date: Tue May 21 06:23:43 2013 +0000
drm: fix a use-after-free when GPU acceleration disabled
When GPU acceleration is disabled, drm_vblank_cleanup() will free the
vblank-related data, such as vblank_refcount, vblank_inmodeset, etc.
But we found that drm_vblank_post_modeset() may be called after the
cleanup, which use vblank_refcount and vblank_inmodeset. And this will
cause a kernel panic.
Fix this by return immediately if dev->num_crtcs is zero. This is the
same thing that drm_vblank_pre_modeset() does.
Call trace of a drm_vblank_post_modeset() after drm_vblank_cleanup():
[ 62.628906] [<ffffffff804868d0>] drm_vblank_post_modeset+0x34/0xb4
[ 62.628906] [<ffffffff804c7008>] atombios_crtc_dpms+0xb4/0x174
[ 62.628906] [<ffffffff804c70e0>] atombios_crtc_commit+0x18/0x38
[ 62.628906] [<ffffffff8047f038>] drm_crtc_helper_set_mode+0x304/0x3cc
[ 62.628906] [<ffffffff8047f92c>] drm_crtc_helper_set_config+0x6d8/0x988
[ 62.628906] [<ffffffff8047dd40>] drm_fb_helper_set_par+0x94/0x104
[ 62.628906] [<ffffffff80439d14>] fbcon_init+0x424/0x57c
[ 62.628906] [<ffffffff8046a638>] visual_init+0xb8/0x118
[ 62.628906] [<ffffffff8046b9f8>] take_over_console+0x238/0x384
[ 62.628906] [<ffffffff80436df8>] fbcon_takeover+0x7c/0xdc
[ 62.628906] [<ffffffff8024fa20>] notifier_call_chain+0x44/0x94
[ 62.628906] [<ffffffff8024fcbc>] __blocking_notifier_call_chain+0x48/0x68
[ 62.628906] [<ffffffff8042d990>] register_framebuffer+0x228/0x260
[ 62.628906] [<ffffffff8047e010>] drm_fb_helper_single_fb_probe+0x260/0x314
[ 62.628906] [<ffffffff8047e2c4>] drm_fb_helper_initial_config+0x200/0x234
[ 62.628906] [<ffffffff804e5560>] radeon_fbdev_init+0xd4/0xf4
[ 62.628906] [<ffffffff804e0e08>] radeon_modeset_init+0x9bc/0xa18
[ 62.628906] [<ffffffff804bfc14>] radeon_driver_load_kms+0xdc/0x12c
[ 62.628906] [<ffffffff8048b548>] drm_get_pci_dev+0x148/0x238
[ 62.628906] [<ffffffff80423564>] local_pci_probe+0x5c/0xd0
[ 62.628906] [<ffffffff80241ac4>] work_for_cpu_fn+0x1c/0x30
[ 62.628906] [<ffffffff802427c8>] process_one_work+0x274/0x3bc
[ 62.628906] [<ffffffff80242934>] process_scheduled_works+0x24/0x44
[ 62.628906] [<ffffffff8024515c>] worker_thread+0x31c/0x3f4
[ 62.628906] [<ffffffff802497a8>] kthread+0x88/0x90
[ 62.628906] [<ffffffff80206794>] kernel_thread_helper+0x10/0x18
Signed-off-by: Huacai Chen <chenhc@lemote.com>
Signed-off-by: Binbin Zhou <zhoubb@lemote.com>
Cc: <stable@vger.kernel.org>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Acked-by: Paul Menzel <paulepanter@users.sourceforge.net>
Signed-off-by: Dave Airlie <airlied@gmail.com>
Reported by: J.R. Oldroyd <fbsd@opal.com>
MFC after: 2 weeks
2015-03-04 20:43:46 +00:00
..
2014-06-28 03:56:17 +00:00
2014-03-30 23:43:36 +00:00
2014-10-28 12:00:39 +00:00
2015-03-01 00:40:09 +00:00
2014-06-21 00:53:56 +00:00
2014-11-21 21:01:24 +00:00
2014-09-19 03:51:26 +00:00
2014-09-18 21:01:41 +00:00
2015-01-23 15:14:30 +00:00
2014-11-21 21:01:24 +00:00
2014-11-21 21:01:24 +00:00
2015-03-04 02:17:36 +00:00
2014-11-21 21:01:24 +00:00
2014-08-08 11:47:04 +00:00
2015-01-30 01:13:07 +00:00
2014-10-08 01:03:32 +00:00
2014-09-23 06:31:15 +00:00
2015-01-04 23:14:04 +00:00
2014-09-23 06:31:15 +00:00
2014-09-23 05:54:18 +00:00
2014-10-13 13:13:42 +00:00
2014-08-08 11:47:09 +00:00
2015-01-06 12:59:37 +00:00
2014-11-21 21:01:24 +00:00
2014-10-28 12:00:39 +00:00
2014-11-26 04:23:21 +00:00
2015-03-02 02:14:44 +00:00
2015-02-14 22:12:17 +00:00
2015-02-24 01:00:46 +00:00
2015-01-05 16:43:22 +00:00
2014-09-18 21:03:13 +00:00
2015-01-06 12:59:37 +00:00
2014-08-30 18:01:45 +00:00
2014-09-18 21:05:59 +00:00
2014-11-21 21:01:24 +00:00
2014-09-19 03:51:26 +00:00
2014-09-19 03:51:26 +00:00
2014-12-01 11:45:24 +00:00
2014-09-19 03:51:26 +00:00
2015-02-18 05:53:04 +00:00
2014-09-18 20:53:02 +00:00
2015-01-06 12:59:37 +00:00
2014-10-17 17:34:05 +00:00
2014-10-16 18:04:43 +00:00
2015-01-06 15:48:20 +00:00
2015-01-06 12:59:37 +00:00
2015-01-06 12:59:37 +00:00
2014-12-20 16:40:49 +00:00
2015-01-06 12:59:37 +00:00
2014-11-20 20:50:05 +00:00
2015-01-06 12:59:37 +00:00
2015-01-23 15:14:30 +00:00
2015-02-19 01:19:42 +00:00
2015-02-24 21:31:13 +00:00
2015-01-23 15:14:30 +00:00
2015-01-21 19:53:52 +00:00
2014-09-19 03:51:26 +00:00
2014-10-10 19:12:04 +00:00
2014-11-21 21:01:24 +00:00
2014-12-17 07:27:19 +00:00
2015-03-04 20:43:46 +00:00
2015-02-13 11:00:13 +00:00
2015-02-25 21:44:53 +00:00
2015-03-01 21:41:33 +00:00
2015-01-05 09:58:32 +00:00
2014-09-18 20:11:28 +00:00
2014-08-07 21:56:32 +00:00
2014-09-24 11:23:55 +00:00
2015-03-01 20:32:35 +00:00
2015-01-06 12:59:37 +00:00
2015-01-05 09:58:32 +00:00
2015-03-01 12:54:22 +00:00
2014-09-25 20:40:24 +00:00
2015-02-27 20:11:02 +00:00
2015-02-03 18:59:52 +00:00
2014-11-24 16:12:11 +00:00
2014-03-16 10:55:57 +00:00
2015-01-21 20:08:24 +00:00
2015-03-03 02:08:17 +00:00
2014-12-24 03:49:33 +00:00
2014-09-18 20:21:46 +00:00
2014-11-21 21:01:24 +00:00
2014-10-30 21:21:53 +00:00
2015-03-02 22:28:47 +00:00
2014-09-19 03:51:26 +00:00
2014-10-21 07:31:21 +00:00
2015-01-06 12:59:37 +00:00
2014-09-18 21:07:05 +00:00
2014-11-21 21:01:24 +00:00
2014-08-05 23:35:19 +00:00
2014-08-05 23:58:49 +00:00
2014-11-21 21:01:24 +00:00
2014-11-21 21:01:24 +00:00
2015-02-11 10:37:55 +00:00
2014-11-21 21:01:24 +00:00
2015-02-17 05:07:38 +00:00
2014-11-26 04:23:21 +00:00
2014-11-26 04:23:21 +00:00
2014-11-06 18:14:12 +00:00
2015-01-06 12:59:37 +00:00
2014-09-19 03:51:26 +00:00
2015-02-28 19:02:44 +00:00
2014-11-21 21:01:24 +00:00
2014-09-23 06:31:15 +00:00
2015-02-06 16:45:10 +00:00
2014-11-13 22:06:57 +00:00
2014-09-19 03:51:26 +00:00
2014-12-24 07:04:04 +00:00
2015-02-08 19:15:14 +00:00
2015-01-05 09:58:32 +00:00
2014-05-20 19:55:06 +00:00
2015-01-21 20:32:36 +00:00
2014-09-19 03:51:26 +00:00
2014-12-19 01:41:51 +00:00
2014-09-28 07:40:26 +00:00
2015-02-28 14:57:57 +00:00
2015-02-25 21:44:53 +00:00
2014-09-24 11:33:43 +00:00
2014-11-22 20:31:20 +00:00
2015-01-06 12:59:37 +00:00
2014-09-19 03:51:26 +00:00
2015-02-17 05:10:41 +00:00
2015-02-10 21:33:32 +00:00
2014-10-10 14:17:42 +00:00
2014-11-18 21:51:01 +00:00
2014-07-28 14:27:05 +00:00
2015-01-24 12:51:15 +00:00
2014-06-28 03:56:17 +00:00
2014-09-19 03:51:26 +00:00
2015-01-21 09:01:48 +00:00
2014-06-13 18:20:44 +00:00
2014-11-18 21:55:50 +00:00
2015-02-27 15:14:25 +00:00
2015-01-06 12:59:37 +00:00
2015-02-26 22:22:06 +00:00
2015-02-26 22:22:06 +00:00
2014-11-23 21:37:33 +00:00
2015-01-06 15:41:23 +00:00
2014-10-11 19:36:59 +00:00
2014-10-13 06:51:40 +00:00
2014-11-21 21:01:24 +00:00
2015-02-10 21:33:32 +00:00
2014-12-01 11:45:24 +00:00
2015-01-06 12:59:37 +00:00
2014-06-28 03:56:17 +00:00
2014-09-25 18:43:52 +00:00
2014-11-20 20:50:05 +00:00
2014-09-19 03:51:26 +00:00
2015-02-24 06:20:50 +00:00
2014-10-16 18:04:43 +00:00
2014-09-23 05:54:18 +00:00
2015-01-12 07:43:19 +00:00
2014-09-10 05:44:15 +00:00
2014-11-20 20:50:05 +00:00
2014-11-11 04:48:09 +00:00
2014-06-10 21:40:43 +00:00
2014-10-17 17:34:05 +00:00
2014-06-17 18:10:06 +00:00
2015-02-13 19:44:04 +00:00
2015-02-19 16:34:48 +00:00
2015-01-05 09:58:32 +00:00
2014-12-03 00:47:05 +00:00
2015-02-18 05:53:04 +00:00
2015-03-01 21:41:35 +00:00
2015-01-06 12:59:37 +00:00
2015-01-06 12:59:37 +00:00
2014-09-19 03:51:26 +00:00
2014-04-28 17:58:40 +00:00
2014-11-18 21:58:57 +00:00
2015-01-02 22:45:55 +00:00
2014-10-21 07:31:21 +00:00
2014-12-01 11:45:24 +00:00
2014-12-01 11:45:24 +00:00
2015-02-11 05:25:23 +00:00
2015-02-18 08:21:51 +00:00
2014-10-21 01:31:24 +00:00
2014-09-19 10:33:23 +00:00
2014-11-11 18:15:05 +00:00
2014-10-21 07:31:21 +00:00
2015-01-06 12:59:37 +00:00
2015-01-06 12:59:37 +00:00
2014-11-18 22:02:37 +00:00
2015-02-27 15:47:30 +00:00
2014-09-19 03:55:19 +00:00
2015-02-28 21:50:04 +00:00
2014-09-19 03:51:26 +00:00
2014-08-20 16:07:17 +00:00
2014-05-16 21:19:17 +00:00
2014-11-21 21:01:24 +00:00
2014-06-28 03:56:17 +00:00
2015-01-12 07:37:06 +00:00
2014-10-13 06:51:40 +00:00
2015-02-13 11:13:08 +00:00
2015-01-06 12:59:37 +00:00
2015-01-06 12:59:37 +00:00
2015-02-10 12:08:52 +00:00
2015-02-18 14:33:33 +00:00
2014-09-19 03:51:26 +00:00
2014-11-20 20:50:05 +00:00
2014-09-18 21:16:05 +00:00
2014-11-13 18:01:51 +00:00
2014-11-21 21:01:24 +00:00
2015-01-27 17:33:18 +00:00
2014-03-16 10:55:57 +00:00
2014-11-21 21:34:19 +00:00
2015-01-06 12:59:37 +00:00
2015-01-06 12:59:37 +00:00
2014-11-21 21:01:24 +00:00
2014-09-19 03:51:26 +00:00
2015-01-05 19:49:20 +00:00
2014-09-18 20:06:10 +00:00
2014-09-24 11:58:23 +00:00
2015-03-03 09:48:19 +00:00
2014-06-13 19:34:34 +00:00
2015-03-03 17:20:19 +00:00
2014-09-18 20:30:47 +00:00
2014-09-23 06:31:15 +00:00
2015-02-15 11:37:40 +00:00
2015-01-27 05:34:46 +00:00
2014-12-01 11:45:24 +00:00
2014-09-18 20:17:27 +00:00
2015-03-01 12:54:22 +00:00
2014-09-24 11:31:46 +00:00
2015-01-06 12:59:37 +00:00
2014-12-01 11:45:24 +00:00
2015-02-28 22:37:48 +00:00
2015-01-06 12:59:37 +00:00
2014-11-18 22:12:51 +00:00
2014-11-22 18:40:14 +00:00
2014-11-20 20:09:18 +00:00
2015-02-14 17:45:53 +00:00
2014-09-19 03:51:26 +00:00
2015-01-06 12:59:37 +00:00
2015-02-28 15:21:06 +00:00
2014-09-18 20:35:22 +00:00