aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2023-03-01 08:47:19 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2023-03-01 08:47:19 -0800
commit6e110580bc1ab84d02509750ce09277914174c6a (patch)
tree087a50424b051ac9c2077a9e1b3b242324e89b03
parente103ecedceb37b565962a199c75dd4df57742d50 (diff)
parentfad376fce0af58deebc5075b8539dc05bf639af3 (diff)
downloadlinux-andi-6e110580bc1ab84d02509750ce09277914174c6a.tar.gz
Merge tag 'jfs-6.3' of https://github.com/kleikamp/linux-shaggy
Pull jfs update from Dave Kleikamp: "Just one simple sanity check" * tag 'jfs-6.3' of https://github.com/kleikamp/linux-shaggy: fs/jfs: fix shift exponent db_agl2size negative
-rw-r--r--fs/jfs/jfs_dmap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/jfs/jfs_dmap.c b/fs/jfs/jfs_dmap.c
index 765838578a722c..a3eb1e82694778 100644
--- a/fs/jfs/jfs_dmap.c
+++ b/fs/jfs/jfs_dmap.c
@@ -193,7 +193,8 @@ int dbMount(struct inode *ipbmap)
bmp->db_agwidth = le32_to_cpu(dbmp_le->dn_agwidth);
bmp->db_agstart = le32_to_cpu(dbmp_le->dn_agstart);
bmp->db_agl2size = le32_to_cpu(dbmp_le->dn_agl2size);
- if (bmp->db_agl2size > L2MAXL2SIZE - L2MAXAG) {
+ if (bmp->db_agl2size > L2MAXL2SIZE - L2MAXAG ||
+ bmp->db_agl2size < 0) {
err = -EINVAL;
goto err_release_metapage;
}