Jerome Marchand
17ec4cd985
zram: don't call idr_remove() from zram_remove()
...
The use of idr_remove() is forbidden in the callback functions of
idr_for_each(). It is therefore unsafe to call idr_remove in
zram_remove().
This patch moves the call to idr_remove() from zram_remove() to
hot_remove_store(). In the detroy_devices() path, idrs are removed by
idr_destroy(). This solves an use-after-free detected by KASan.
[akpm@linux-foundation.org: fix coding stype, per Sergey]
Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
Acked-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: <stable@vger.kernel.org> [4.2+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-01-15 17:56:32 -08:00
..
2016-01-13 19:15:14 -08:00
2016-01-11 19:33:59 -08:00
2015-12-29 15:32:24 -05:00
2016-01-14 16:00:49 -08:00
2015-12-31 10:17:05 +02:00
2016-01-15 17:56:32 -08:00
2016-01-06 16:37:14 +01:00
2015-12-22 11:42:30 -08:00
2016-01-06 08:25:24 -05:00
2016-01-13 11:19:24 -08:00
2015-12-12 16:43:44 -08:00
2016-01-12 11:01:12 +01:00
2016-01-04 21:46:45 -05:00
2016-01-15 13:18:47 -08:00
2016-01-15 13:18:47 -08:00
2016-01-15 13:18:47 -08:00
2016-01-13 10:59:52 -08:00
2016-01-01 18:31:34 +01:00
2015-12-21 11:44:00 +09:00
2016-01-14 17:04:19 -08:00
2016-01-14 10:53:15 -08:00
2016-01-15 12:41:32 -08:00
2016-01-14 16:20:42 -08:00
2016-01-07 16:07:54 +01:00
2016-01-13 10:23:36 -08:00
2016-01-09 07:31:58 -08:00
2015-12-21 13:31:31 -08:00
2016-01-14 11:25:37 -08:00
2015-12-26 17:05:25 -08:00
2016-01-14 17:04:19 -08:00
2016-01-13 11:14:05 -08:00
2016-01-11 16:26:03 -08:00
2016-01-12 11:01:12 +01:00
2016-01-11 23:55:43 -05:00
2016-01-04 09:57:41 +01:00
2016-01-12 12:17:28 +01:00
2015-12-29 08:28:32 -07:00
2015-11-30 21:12:05 +05:30
2016-01-15 12:28:00 -08:00
2016-01-14 17:04:19 -08:00
2015-12-16 00:16:58 +01:00
2016-01-14 10:53:15 -08:00
2016-01-15 13:18:47 -08:00
2016-01-05 18:04:58 +01:00
2016-01-13 11:25:54 -08:00
2016-01-15 13:33:12 -08:00
2015-12-29 19:06:23 +01:00
2016-01-10 07:53:55 -08:00
2015-12-22 10:12:04 -07:00
2016-01-14 11:13:28 -08:00
2015-12-12 16:07:25 +01:00
2016-01-03 16:32:59 -08:00
2016-01-12 20:25:09 -08:00
2015-12-26 17:01:18 -08:00
2016-01-11 20:05:39 -08:00
2016-01-01 03:14:51 +01:00
2016-01-04 22:12:42 +01:00
2016-01-14 01:03:18 +01:00
2016-01-12 01:12:40 +01:00
2016-01-15 12:14:47 -08:00
2016-01-15 13:18:47 -08:00
2016-01-13 13:16:16 -08:00
2016-01-04 10:26:58 -05:00
2016-01-13 19:37:36 -08:00
2016-01-15 13:18:47 -08:00
2016-01-15 13:18:47 -08:00
2015-12-16 16:36:25 +02:00
2016-01-14 16:00:49 -08:00
2015-12-09 01:18:34 +01:00
2016-01-15 13:18:47 -08:00
2016-01-15 13:18:47 -08:00
2015-12-01 14:26:33 -08:00
2016-01-04 12:55:44 -07:00
2015-12-08 21:55:49 -05:00
2016-01-14 10:34:33 -08:00
2015-12-07 17:28:11 +02:00
2016-01-07 13:21:53 +00:00
2015-12-08 04:26:05 +01:00