aboutsummaryrefslogtreecommitdiff
path: root/fs/ubifs/super.c
diff options
context:
space:
mode:
authorGravatar Zhihao Cheng <chengzhihao1@huawei.com> 2023-09-23 11:28:59 +0800
committerGravatar Richard Weinberger <richard@nod.at> 2023-10-28 23:19:08 +0200
commit75690493591fe283e4c92a3ba7c4420e9858abdb (patch)
tree6a9e05748db7f109e8106e93b9d3bf2824398bf9 /fs/ubifs/super.c
parentubi: block: Fix use-after-free in ubiblock_cleanup (diff)
downloadlinux-75690493591fe283e4c92a3ba7c4420e9858abdb.tar.gz
linux-75690493591fe283e4c92a3ba7c4420e9858abdb.tar.bz2
linux-75690493591fe283e4c92a3ba7c4420e9858abdb.zip
ubifs: ubifs_link: Fix wrong name len calculating when UBIFS is encrypted
The length of dentry name is calculated after the raw name is encrypted, except for ubifs_link(), which could make the size of dir underflow. Here is a reproducer: touch $TMP/file mkdir $TMP/dir stat $TMP/dir for i in $(seq 1 8) do ln $TMP/file $TMP/dir/$i unlink $TMP/dir/$i done stat $TMP/dir The size of dir will be underflow(-96). Fix it by calculating dentry name's length after the name is encrypted. Fixes: f4f61d2cc6d8 ("ubifs: Implement encrypted filenames") Reported-by: Roland Ruckerbauer <roland.ruckerbauer@robart.cc> Link: https://lore.kernel.org/linux-mtd/1638777819.2925845.1695222544742.JavaMail.zimbra@robart.cc/T/#u Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'fs/ubifs/super.c')
0 files changed, 0 insertions, 0 deletions