public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/12] [media] rc-main: clear rc_map.name in ir_free_table()
@ 2016-08-09 21:32 Max Kellermann
  2016-08-09 21:32 ` [PATCH 02/12] [media] dvbdev: split dvb_unregister_device() Max Kellermann
                   ` (11 more replies)
  0 siblings, 12 replies; 16+ messages in thread
From: Max Kellermann @ 2016-08-09 21:32 UTC (permalink / raw)
  To: linux-media, shuahkh, mchehab; +Cc: linux-kernel

rc_unregister_device() will first call ir_free_table(), and later
device_del(); however, the latter causes a call to rc_dev_uevent(),
which prints rc_map.name, which at this point has already bee freed.

This fixes a use-after-free bug found with KASAN.

Signed-off-by: Max Kellermann <max.kellermann@gmail.com>
---
 drivers/media/rc/rc-main.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
index 8e7f292..1e5a520 100644
--- a/drivers/media/rc/rc-main.c
+++ b/drivers/media/rc/rc-main.c
@@ -159,6 +159,7 @@ static void ir_free_table(struct rc_map *rc_map)
 {
 	rc_map->size = 0;
 	kfree(rc_map->name);
+	rc_map->name = NULL;
 	kfree(rc_map->scan);
 	rc_map->scan = NULL;
 }


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2016-11-14 23:41 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-09 21:32 [PATCH 01/12] [media] rc-main: clear rc_map.name in ir_free_table() Max Kellermann
2016-08-09 21:32 ` [PATCH 02/12] [media] dvbdev: split dvb_unregister_device() Max Kellermann
2016-08-09 21:32 ` [PATCH 03/12] [media] dvb-core/en50221: use dvb_remove_device() Max Kellermann
2016-08-09 21:32 ` [PATCH 04/12] [media] dvb: make DVB frontend *_ops instances "const" Max Kellermann
2016-08-09 21:32 ` [PATCH 05/12] [media] dvb_frontend: merge duplicate dvb_tuner_ops.release implementations Max Kellermann
2016-08-09 23:01   ` kbuild test robot
2016-08-10 11:56     ` Max Kellermann
2016-08-09 23:19   ` kbuild test robot
2016-08-09 21:32 ` [PATCH 06/12] [media] dvb_frontend: tuner_ops.release returns void Max Kellermann
2016-08-09 21:32 ` [PATCH 07/12] [media] dvb_frontend: merge the two dvb_frontend_detach() versions Max Kellermann
2016-08-09 21:32 ` [PATCH 08/12] [media] dvb_frontend: add "detach" callback Max Kellermann
2016-08-09 21:32 ` [PATCH 09/12] [media] stb0899: move code to " Max Kellermann
2016-08-09 21:32 ` [PATCH 10/12] [media] dvb_frontend: move kref to struct dvb_frontend Max Kellermann
2016-08-09 21:32 ` [PATCH 11/12] [media] media-entity: clear media_gobj.mdev in _destroy() Max Kellermann
2016-08-09 21:33 ` [PATCH 12/12] drivers/media/media-device: fix double free bug in _unregister() Max Kellermann
2016-11-14 23:41 ` [PATCH 01/12] [media] rc-main: clear rc_map.name in ir_free_table() Shuah Khan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox