Javier Martinez Canillas
0fac5f8fb1
video: fbdev: vesafb: Fix a use-after-free due early fb_info cleanup
...
[ Upstream commit acde4003efc16480375543638484d8f13f2e99a3 ]
Commit b3c9a924aab6 ("fbdev: vesafb: Cleanup fb_info in .fb_destroy rather
than .remove") fixed a use-after-free error due the vesafb driver freeing
the fb_info in the .remove handler instead of doing it in .fb_destroy.
This can happen if the .fb_destroy callback is executed after the .remove
callback, since the former tries to access a pointer freed by the latter.
But that change didn't take into account that another possible scenario is
that .fb_destroy is called before the .remove callback. For example, if no
process has the fbdev chardev opened by the time the driver is removed.
If that's the case, fb_info will be freed when unregister_framebuffer() is
called, making the fb_info pointer accessed in vesafb_remove() after that
to no longer be valid.
To prevent that, move the expression containing the info->par to happen
before the unregister_framebuffer() function call.
Fixes: b3c9a924aab6 ("fbdev: vesafb: Cleanup fb_info in .fb_destroy rather than .remove")
Reported-by: Pascal Ernster <dri-devel@hardfalcon.net >
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com >
Tested-by: Pascal Ernster <dri-devel@hardfalcon.net >
Signed-off-by: Helge Deller <deller@gmx.de >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2022-06-09 10:23:16 +02:00
..
2021-06-03 10:32:49 +02:00
2022-06-09 10:22:31 +02:00
2020-11-22 22:58:55 +01:00
2020-05-06 19:29:10 +02:00
2020-01-30 08:04:01 -08:00
2021-07-26 20:06:00 +02:00
2022-04-08 14:23:14 +02:00
2021-06-03 10:32:49 +02:00
2020-12-08 18:34:25 +01:00
2022-04-08 14:23:59 +02:00
2021-02-18 15:14:32 +01:00
2022-04-08 14:24:01 +02:00
2021-07-26 20:06:03 +02:00
2020-09-08 13:33:15 +02:00
2020-12-08 18:36:52 +01:00
2020-01-06 09:45:59 +01:00
2020-11-30 20:04:24 +01:00
2020-01-03 14:27:43 +01:00
2021-02-24 13:38:31 -08:00
2019-06-19 17:09:55 +02:00
2022-06-09 10:23:15 +02:00
2021-02-12 10:01:45 +00:00
2021-07-21 13:09:21 +02:00
2020-09-08 13:33:20 +02:00
2021-07-26 20:05:50 +02:00
2019-04-01 17:46:55 +02:00
2019-04-01 17:46:55 +02:00
2019-04-01 17:46:55 +02:00
2019-04-01 17:46:55 +02:00
2022-04-08 14:23:00 +02:00
2022-04-08 14:23:14 +02:00
2019-12-05 10:57:53 +02:00
2019-06-03 16:00:08 +02:00
2019-12-05 10:57:53 +02:00
2019-12-05 10:57:53 +02:00
2020-12-08 18:34:08 +01:00
2020-03-09 11:12:19 +01:00
2020-01-30 08:04:01 -08:00
2020-12-08 18:34:08 +01:00
2020-12-08 18:34:08 +01:00
2020-01-15 17:31:50 +01:00
2021-11-18 19:16:51 +01:00
2022-04-08 14:24:00 +02:00
2019-12-05 10:57:53 +02:00
2019-12-05 10:57:53 +02:00
2022-04-08 14:23:14 +02:00
2019-05-30 11:26:32 -07:00
2020-09-08 13:33:16 +02:00
2019-06-19 17:09:55 +02:00
2021-02-12 10:01:45 +00:00
2019-12-05 10:57:53 +02:00
2022-05-18 10:26:49 +02:00
2021-07-26 22:10:29 +02:00
2020-12-08 18:34:08 +01:00
2019-12-05 10:57:53 +02:00
2020-10-17 08:23:14 +02:00
2020-02-19 10:58:22 -08:00
2021-10-06 11:12:28 +02:00
2020-12-08 18:34:50 +01:00
2020-07-20 11:47:29 +02:00
2020-08-23 17:36:59 -05:00
2019-12-05 10:57:53 +02:00
2021-05-21 15:04:05 +02:00
2020-06-09 09:39:13 -07:00
2020-06-17 10:57:41 -07:00
2022-02-01 17:27:12 +01:00
2020-09-08 13:33:17 +02:00
2021-05-13 18:58:39 +02:00
2021-05-07 18:34:18 +02:00
2021-10-06 11:12:28 +02:00
2020-12-08 18:34:08 +01:00
2020-07-20 11:47:29 +02:00
2020-10-15 10:46:16 -07:00
2019-12-05 10:57:53 +02:00
2020-07-20 11:47:29 +02:00
2020-11-30 20:04:56 +01:00
2021-07-21 15:02:03 +02:00
2020-01-03 14:27:49 +01:00
2020-08-23 17:36:59 -05:00
2020-12-08 18:34:08 +01:00
2019-12-05 10:57:53 +02:00
2020-11-30 20:04:43 +01:00
2020-07-16 12:35:15 -07:00
2020-01-30 08:04:01 -08:00
2020-01-30 08:04:01 -08:00
2020-01-30 08:04:01 -08:00
2020-12-04 01:01:22 +11:00
2020-08-05 19:47:22 +02:00
2020-03-18 12:27:03 +01:00
2020-08-23 17:36:59 -05:00
2020-08-23 17:36:59 -05:00
2019-08-26 10:02:02 +02:00
2020-06-09 09:39:13 -07:00
2020-11-29 22:51:07 +01:00
2020-08-20 17:48:12 +02:00
2020-08-20 17:48:12 +02:00
2020-12-05 21:01:04 +01:00
2020-09-08 13:33:19 +02:00
2020-08-23 17:36:59 -05:00
2020-04-17 15:50:11 +02:00
2020-09-25 16:34:50 +02:00
2020-01-30 08:04:01 -08:00
2020-11-01 10:29:04 +01:00
2019-06-12 20:28:11 +02:00
2022-05-18 10:26:48 +02:00
2019-12-05 10:57:53 +02:00
2020-08-23 17:36:59 -05:00
2019-04-01 17:46:59 +02:00
2022-04-08 14:24:02 +02:00
2022-04-08 14:23:14 +02:00
2021-07-27 17:18:26 +02:00
2020-11-30 20:04:59 +01:00
2022-06-09 10:22:26 +02:00
2022-06-09 10:22:26 +02:00
2019-12-05 10:57:53 +02:00
2019-12-05 10:57:53 +02:00
2019-12-05 10:57:53 +02:00
2020-12-08 18:34:08 +01:00
2020-11-30 20:04:30 +01:00
2020-11-30 20:04:50 +01:00
2019-12-05 10:57:53 +02:00
2020-01-30 08:04:01 -08:00
2022-05-09 09:14:31 +02:00
2020-12-08 18:33:48 +01:00
2020-05-06 21:04:45 +02:00
2019-05-30 11:26:32 -07:00
2022-06-09 10:23:16 +02:00
2019-12-05 10:57:53 +02:00
2022-01-20 09:13:14 +01:00
2020-04-17 15:50:08 +02:00
2019-06-05 17:36:37 +02:00
2020-09-08 13:33:18 +02:00
2022-04-08 14:23:59 +02:00
2019-06-19 17:09:55 +02:00
2019-06-05 17:36:37 +02:00
2020-03-02 16:32:04 +01:00
2020-12-08 18:34:36 +01:00
2020-08-23 17:36:59 -05:00
2021-07-13 13:58:29 -05:00