diff options
author | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2015-05-05 16:24:00 -0700 |
---|---|---|
committer | Sasha Levin <sasha.levin@oracle.com> | 2015-05-23 15:43:03 -0400 |
commit | f4ccf646b9332123ed5d49dfa4806989248f8725 (patch) | |
tree | 72f76637addb29ef438ee9ae3150b48f44226f4f /include/clocksource | |
parent | 806d32c55b5f014012f3cc62f62fc078b891c630 (diff) |
nilfs2: fix sanity check of btree level in nilfs_btree_root_broken()
[ Upstream commit d8fd150fe3935e1692bf57c66691e17409ebb9c1 ]
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>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Diffstat (limited to 'include/clocksource')
0 files changed, 0 insertions, 0 deletions