]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
squashfs: fix memory leak in squashfs_fill_super
authorPhillip Lougher <phillip@squashfs.org.uk>
Mon, 11 Aug 2025 22:37:40 +0000 (23:37 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:34:35 +0000 (16:34 +0200)
commit81e8bdf7fb21295d3a5f47399a70f4b0a4cd1bf9
tree5ee5bfc23a3b7ee3010e469b394ba549d11dbfd4
parent202a3432d21ac060629a760fff3b0a39859da3ea
squashfs: fix memory leak in squashfs_fill_super

commit b64700d41bdc4e9f82f1346c15a3678ebb91a89c upstream.

If sb_min_blocksize returns 0, squashfs_fill_super exits without freeing
allocated memory (sb->s_fs_info).

Fix this by moving the call to sb_min_blocksize to before memory is
allocated.

Link: https://lkml.kernel.org/r/20250811223740.110392-1-phillip@squashfs.org.uk
Fixes: 734aa85390ea ("Squashfs: check return result of sb_min_blocksize")
Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
Reported-by: Scott GUO <scottzhguo@tencent.com>
Closes: https://lore.kernel.org/all/20250811061921.3807353-1-scott_gzh@163.com
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/squashfs/super.c