Skip to content

Commit 920496d

Browse files
ea1davismdiewa
authored andcommitted
jfs: fix uaf in jfs_evict_inode
When the execution of diMount(ipimap) fails, the object ipimap that has been released may be accessed in diFreeSpecial(). Asynchronous ipimap release occurs when rcu_core() calls jfs_free_node(). Therefore, when diMount(ipimap) fails, sbi->ipimap should not be initialized as ipimap. Reported-and-tested-by: [email protected] Signed-off-by: Edward Adam Davis <[email protected]> Signed-off-by: Dave Kleikamp <[email protected]> CVE-2023-52600 (cherry picked from commit e0e1958) Signed-off-by: Bethany Jamison <[email protected]> Acked-by: Stefan Bader <[email protected]> Acked-by: Manuel Diewald <[email protected]> Signed-off-by: Stefan Bader <[email protected]>
1 parent 81c94d3 commit 920496d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

fs/jfs/jfs_mount.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,15 +172,15 @@ int jfs_mount(struct super_block *sb)
172172
}
173173
jfs_info("jfs_mount: ipimap:0x%p", ipimap);
174174

175-
/* map further access of per fileset inodes by the fileset inode */
176-
sbi->ipimap = ipimap;
177-
178175
/* initialize fileset inode allocation map */
179176
if ((rc = diMount(ipimap))) {
180177
jfs_err("jfs_mount: diMount failed w/rc = %d", rc);
181178
goto err_ipimap;
182179
}
183180

181+
/* map further access of per fileset inodes by the fileset inode */
182+
sbi->ipimap = ipimap;
183+
184184
return rc;
185185

186186
/*

0 commit comments

Comments
 (0)