diff --git a/fs/jfs/jfs_dmap.c b/fs/jfs/jfs_dmap.c index a841cf2..4ad9b34 100644 --- a/fs/jfs/jfs_dmap.c +++ b/fs/jfs/jfs_dmap.c @@ -2864,6 +2864,9 @@ static int dbJoin(dmtree_t *tp, int leafno, int newval, bool is_ctl) if (newval >= tp->dmt_budmin) { /* pickup a pointer to the leaves of the tree. */ + if (newval > tp->dmt_budmin + + le32_to_cpu(tp->dmt_l2nleafs)) + return -EIO; leaf = tp->dmt_stree + le32_to_cpu(tp->dmt_leafidx); /* try to join the specified leaf into a large binary