linux/fs/autofs
Jeffin Philip 5ab54837fc
fs: autofs: fix memory leak in autofs_fill_super()
In autofs_fill_super(), we create a new inode using
autofs_new_ino(), however, if we fail to create root_inode,
(that is, root_inode failure path), we return -ENOMEM without
freeing the new inode(ino) that we created causing a memory leak.
Fix this by adding autofs_free_ino() to free the inode we created
in root_inode failure path before returning ENOMEM.

Reported-by: syzbot+df1db6e034b3953e19f5@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=df1db6e034b3953e19f5
Fixes: 66917f85db ("autofs: add: new_inode check in autofs_fill_super()")
Cc: stable@vger.kernel.org
Signed-off-by: Jeffin Philip <jeffinphilip14@gmail.com>
Link: https://patch.msgid.link/20260903081048.132524-1-jeffinphilip14@gmail.com
Signed-off-by: Ian Kent <raven@themaw.net>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
2026-09-04 09:48:00 +02:00
..
autofs_i.h autofs: dont trigger mount if it cant succeed 2025-11-19 11:14:02 +01:00
dev-ioctl.c autofs: fix per-dentry timeout warning 2025-12-04 09:57:51 +01:00
expire.c autofs: add per dentry expire timeout 2024-08-30 08:22:36 +02:00
init.c fs: autofs: add MODULE_DESCRIPTION() 2024-05-28 12:06:59 +02:00
inode.c fs: autofs: fix memory leak in autofs_fill_super() 2026-09-04 09:48:00 +02:00
Kconfig arch/*/configs/*defconfig: Replace AUTOFS4_FS by AUTOFS_FS 2023-07-29 14:08:22 -07:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
root.c autofs: drop redundant S_IFDIR from mkdir 2026-07-01 12:48:44 +02:00
symlink.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 83 2019-05-24 17:37:52 +02:00
waitq.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00