Ryusuke Konishi
74e08b1cc7
nilfs2: fix sanity check of btree level in nilfs_btree_root_broken()
...
commit d8fd150fe3 upstream.
The range check for b-tree level parameter in nilfs_btree_root_broken()
is wrong; it accepts the case of "level == NILFS_BTREE_LEVEL_MAX" even
though the level is limited to values in the range of 0 to
(NILFS_BTREE_LEVEL_MAX - 1).
Since the level parameter is read from storage device and used to index
nilfs_btree_path array whose element count is NILFS_BTREE_LEVEL_MAX, it
can cause memory overrun during btree operations if the boundary value
is set to the level parameter on device.
This fixes the broken sanity check and adds a comment to clarify that
the upper bound NILFS_BTREE_LEVEL_MAX is exclusive.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
Signed-off-by: Ben Hutchings <ben@decadent.org.uk >
2015-08-07 00:32:09 +01:00
..
2014-11-05 20:27:42 +00:00
2014-01-03 04:33:18 +00:00
2012-10-30 23:26:26 +00:00
2012-11-16 16:46:48 +00:00
2015-05-09 23:16:14 +01:00
2014-11-05 20:27:43 +00:00
2013-04-25 20:25:31 +01:00
2013-03-06 03:24:19 +00:00
2014-01-03 04:33:21 +00:00
2013-09-10 01:57:27 +01:00
2014-04-09 02:20:44 +01:00
2015-05-09 23:16:35 +01:00
2014-12-14 16:23:47 +00:00
2013-07-27 05:34:20 +01:00
2015-05-09 23:16:12 +01:00
2014-12-14 16:23:48 +00:00
2014-12-14 16:23:49 +00:00
2014-12-14 16:23:49 +00:00
2015-05-09 23:16:12 +01:00
2013-03-06 03:23:52 +00:00
2013-06-19 02:16:59 +01:00
2015-02-20 00:49:36 +00:00
2015-01-01 01:27:50 +00:00
2013-03-20 15:03:20 +00:00
2015-02-20 00:49:37 +00:00
2013-05-30 14:35:10 +01:00
2013-11-28 14:01:59 +00:00
2013-01-03 03:32:56 +00:00
2013-11-28 14:02:00 +00:00
2015-05-09 23:16:15 +01:00
2013-09-10 01:57:20 +01:00
2014-06-09 13:29:03 +01:00
2013-10-26 21:06:04 +01:00
2012-10-10 03:31:16 +01:00
2013-01-03 03:32:57 +00:00
2014-02-15 19:20:17 +00:00
2013-10-26 21:05:57 +01:00
2013-03-06 03:23:57 +00:00
2013-05-30 14:35:13 +01:00
2012-11-16 16:46:52 +00:00
2013-08-02 22:14:47 +02:00
2012-10-30 23:26:34 +00:00
2013-05-13 15:02:30 +01:00
2013-10-26 21:05:56 +01:00
2014-07-11 13:33:34 +01:00
2013-05-13 15:02:14 +01:00
2015-08-07 00:32:02 +01:00
2014-11-05 20:27:43 +00:00
2015-02-20 00:49:30 +00:00
2015-05-09 23:16:12 +01:00
2014-12-14 16:23:52 +00:00
2013-03-06 03:24:27 +00:00
2012-09-19 15:05:16 +01:00
2013-04-25 20:25:38 +01:00
2014-06-09 13:29:03 +01:00
2013-04-25 20:25:50 +01:00
2015-08-07 00:32:06 +01:00
2014-07-11 13:33:53 +01:00
2014-08-06 18:07:37 +01:00
2012-10-10 03:30:45 +01:00
2014-09-13 23:41:50 +01:00
2013-09-10 01:57:37 +01:00
2015-02-20 00:49:40 +00:00
2013-03-06 03:24:11 +00:00
2014-05-18 14:58:06 +01:00
2014-09-13 23:41:41 +01:00
2014-01-03 04:33:21 +00:00
2013-07-27 05:34:29 +01:00
2014-01-03 04:33:33 +00:00
2014-02-15 19:20:09 +00:00
2015-08-07 00:32:09 +01:00
2013-03-20 15:03:41 +00:00
2013-04-25 20:25:40 +01:00
2013-01-16 01:13:13 +00:00
2014-01-03 04:33:24 +00:00
2014-02-15 19:20:16 +00:00
2013-11-28 14:01:59 +00:00
2014-04-02 00:58:44 +01:00
2013-03-06 03:23:57 +00:00
2013-04-25 20:25:36 +01:00
2013-03-06 03:24:22 +00:00
2012-12-06 11:20:18 +00:00
2014-07-11 13:33:59 +01:00
2013-03-06 03:23:45 +00:00
2014-01-03 04:33:32 +00:00
2013-06-29 04:06:40 +01:00
2013-10-26 21:05:59 +01:00
2014-07-11 13:33:35 +01:00
2015-02-20 00:49:35 +00:00
2012-11-16 16:46:52 +00:00
2014-04-30 16:23:23 +01:00
2013-03-20 15:03:33 +00:00
2014-08-06 18:07:31 +01:00
2014-08-06 18:07:42 +01:00
2013-01-16 01:13:25 +00:00
2013-06-29 04:06:39 +01:00
2013-04-25 20:25:36 +01:00
2014-12-14 16:23:49 +00:00
2013-06-19 02:17:01 +01:00
2015-02-20 00:49:37 +00:00
2013-02-06 04:33:57 +00:00
2013-04-10 03:20:11 +01:00
2015-02-20 00:49:34 +00:00
2013-11-28 14:02:03 +00:00
2014-04-02 00:58:57 +01:00
2014-08-06 18:07:33 +01:00
2013-05-30 14:35:03 +01:00
2015-02-20 00:49:34 +00:00
2013-03-06 03:23:52 +00:00
2013-09-10 01:57:28 +01:00
2015-02-20 00:49:35 +00:00
2012-10-10 03:31:25 +01:00