Skip to content

Commit

Permalink
jfs: Fix sanity check in dbMount
Browse files Browse the repository at this point in the history
[ Upstream commit 67373ca8404fe57eb1bb4b57f314cff77ce54932 ]

MAXAG is a legitimate value for bmp->db_numag

Fixes: e63866a47556 ("jfs: fix out-of-bounds in dbNextAG() and diAlloc()")

Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
kleikamp authored and opsiff committed Nov 1, 2024
1 parent 8022d9f commit 0bc0340
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/jfs/jfs_dmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ int dbMount(struct inode *ipbmap)
}

bmp->db_numag = le32_to_cpu(dbmp_le->dn_numag);
if (!bmp->db_numag || bmp->db_numag >= MAXAG) {
if (!bmp->db_numag || bmp->db_numag > MAXAG) {
err = -EINVAL;
goto err_release_metapage;
}
Expand Down

0 comments on commit 0bc0340

Please sign in to comment.