summaryrefslogtreecommitdiff
path: root/fs/exfat
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2020-06-08 17:16:29 +0300
committerNamjae Jeon <namjae.jeon@samsung.com>2020-06-09 10:50:18 +0300
commitfc961522ddbdf00254dd03b677627139cc1f68bc (patch)
treeb81f898f8dac5429084e0abb43b96c330bd6ff34 /fs/exfat
parenta949824f01f3b39f737d77aed6cba47aced09319 (diff)
downloadlinux-fc961522ddbdf00254dd03b677627139cc1f68bc.tar.xz
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: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Diffstat (limited to 'fs/exfat')
-rw-r--r--fs/exfat/nls.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/exfat/nls.c b/fs/exfat/nls.c
index c1ec05695497..57b5a7a4d1f7 100644
--- a/fs/exfat/nls.c
+++ b/fs/exfat/nls.c
@@ -692,8 +692,8 @@ static int exfat_load_upcase_table(struct super_block *sb,
index++;
}
}
- brelse(bh);
chksum = exfat_calc_chksum32(bh->b_data, i, chksum, CS_DEFAULT);
+ brelse(bh);
}
if (index >= 0xFFFF && utbl_checksum == chksum)