mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 04:04:43 +01:00
erofs: fix incorrect early exits in volume label handling
Crafted EROFS images containing valid volume labels can trigger
incorrect early returns, leading to folio reference leaks.
However, this does not cause system crashes or other severe issues.
Fixes: 1cf12c7177 ("erofs: Add support for FS_IOC_GETFSLABEL")
Cc: stable@kernel.org
Reviewed-by: Hongbo Li <lihongbo22@huawei.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
This commit is contained in:
parent
643575d5a4
commit
3afa4da388
1 changed files with 4 additions and 2 deletions
|
|
@ -347,8 +347,10 @@ static int erofs_read_superblock(struct super_block *sb)
|
|||
if (dsb->volume_name[0]) {
|
||||
sbi->volume_name = kstrndup(dsb->volume_name,
|
||||
sizeof(dsb->volume_name), GFP_KERNEL);
|
||||
if (!sbi->volume_name)
|
||||
return -ENOMEM;
|
||||
if (!sbi->volume_name) {
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
/* parse on-disk compression configurations */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue