Skip to content

Commit fc96152

Browse files
Dan Carpenternamjaejeon
authored andcommitted
exfat: Fix potential use after free in exfat_load_upcase_table()
This code calls brelse(bh) and then dereferences "bh" on the next line resulting in a possible use after free. The brelse() should just be moved down a line. Fixes: b676fdb ("exfat: standardize checksum calculation") Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Namjae Jeon <[email protected]>
1 parent a949824 commit fc96152

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/exfat/nls.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,8 +692,8 @@ static int exfat_load_upcase_table(struct super_block *sb,
692692
index++;
693693
}
694694
}
695-
brelse(bh);
696695
chksum = exfat_calc_chksum32(bh->b_data, i, chksum, CS_DEFAULT);
696+
brelse(bh);
697697
}
698698

699699
if (index >= 0xFFFF && utbl_checksum == chksum)

0 commit comments

Comments
 (0)