Commit fc961522 authored by Dan Carpenter's avatar Dan Carpenter Committed by Namjae Jeon

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: b676fdbcf4c8 ("exfat: standardize checksum calculation")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarNamjae Jeon <namjae.jeon@samsung.com>
parent a949824f
...@@ -692,8 +692,8 @@ static int exfat_load_upcase_table(struct super_block *sb, ...@@ -692,8 +692,8 @@ static int exfat_load_upcase_table(struct super_block *sb,
index++; index++;
} }
} }
brelse(bh);
chksum = exfat_calc_chksum32(bh->b_data, i, chksum, CS_DEFAULT); chksum = exfat_calc_chksum32(bh->b_data, i, chksum, CS_DEFAULT);
brelse(bh);
} }
if (index >= 0xFFFF && utbl_checksum == chksum) if (index >= 0xFFFF && utbl_checksum == chksum)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment