Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DFE1434B425 for ; Wed, 24 Dec 2025 13:12:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766581953; cv=none; b=XnwViHgXF7ApFf4JEBN6o1QPKiD+ee3+ZpQcBmfddRhxtzXHoKKLM8LsSpFZqQN0JRX/Q2a9ca4l6pHsNYfEJKiS5uIcDPzJsM4Rg0tsw10BCbzk+JAipFxfpFDFRDUOw7q9CIv8RU1jK7V9r5wM09X5NaRCo9HtiDZkLaXKf8I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766581953; c=relaxed/simple; bh=sGEx9KOP909F2tc+jRWUePgVrc0P180TTQ0p18TPnEM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=CPuGkKfFO2Cq3RQ7oGbdwFDPCGNqO3o3ETMb+0rOLCWO/SgywJe0dut5Dkq+6GYKToPb3XBl8tvL9IfCWWSETznwB64yeomwVo8F0JJDjiF10VJ6EWsiPqunhF3eVsYa7KMWsBasULQxp5KZXJbnMzn/jhH8gCnvTdTb6HUYcBQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=CurYk+lY; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="CurYk+lY" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 673E0C19421; Wed, 24 Dec 2025 13:12:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1766581952; bh=sGEx9KOP909F2tc+jRWUePgVrc0P180TTQ0p18TPnEM=; h=From:To:Cc:Subject:Date:Reply-To:From; b=CurYk+lYznEPmnkw+qbTmr0N8sp1P84cpvrj7dYOfJb9E/R7g5Iu4y1eUBRcP+JNJ WMfV1UnESPeyUXhu8VlZYSeSDD+2cOHV/YIJW6e2YZfpt0XN67TYntdd/l8dd8MLTN jBoaFeBq9cy3DdxeZLmRr2wew9gzQsapD1HIhTwo= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-54134: autofs: fix memory leak of waitqueues in autofs_catatonic_mode Date: Wed, 24 Dec 2025 14:07:31 +0100 Message-ID: <2025122421-CVE-2023-54134-2972@gregkh> X-Mailer: git-send-email 2.52.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=5949; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=nwkVL39x8F+tzIaiavsbKhkWvZngIepatrRpJuk96To=; b=owGbwMvMwCRo6H6F97bub03G02pJDJneT31XLZ635Ot0pdS1YhuuTlc6eDw3qKS7WUdWZOIK/ TMHpbdodcSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBEjFUZ5oo/mVF8TzUySOv6 pkudbb7qa76e3MWwYKtmuMrcbB8bYbNNjzYmV5pUNy51AwA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: autofs: fix memory leak of waitqueues in autofs_catatonic_mode Syzkaller reports a memory leak: BUG: memory leak unreferenced object 0xffff88810b279e00 (size 96): comm "syz-executor399", pid 3631, jiffies 4294964921 (age 23.870s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 08 9e 27 0b 81 88 ff ff ..........'..... 08 9e 27 0b 81 88 ff ff 00 00 00 00 00 00 00 00 ..'............. backtrace: [] kmalloc_trace+0x20/0x90 mm/slab_common.c:1046 [] kmalloc include/linux/slab.h:576 [inline] [] autofs_wait+0x3fa/0x9a0 fs/autofs/waitq.c:378 [] autofs_do_expire_multi+0xa7/0x3e0 fs/autofs/expire.c:593 [] autofs_expire_multi+0x53/0x80 fs/autofs/expire.c:619 [] autofs_root_ioctl_unlocked+0x322/0x3b0 fs/autofs/root.c:897 [] autofs_root_ioctl+0x25/0x30 fs/autofs/root.c:910 [] vfs_ioctl fs/ioctl.c:51 [inline] [] __do_sys_ioctl fs/ioctl.c:870 [inline] [] __se_sys_ioctl fs/ioctl.c:856 [inline] [] __x64_sys_ioctl+0xfc/0x140 fs/ioctl.c:856 [] do_syscall_x64 arch/x86/entry/common.c:50 [inline] [] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 [] entry_SYSCALL_64_after_hwframe+0x63/0xcd autofs_wait_queue structs should be freed if their wait_ctr becomes zero. Otherwise they will be lost. In this case an AUTOFS_IOC_EXPIRE_MULTI ioctl is done, then a new waitqueue struct is allocated in autofs_wait(), its initial wait_ctr equals 2. After that wait_event_killable() is interrupted (it returns -ERESTARTSYS), so that 'wq->name.name == NULL' condition may be not satisfied. Actually, this condition can be satisfied when autofs_wait_release() or autofs_catatonic_mode() is called and, what is also important, wait_ctr is decremented in those places. Upon the exit of autofs_wait(), wait_ctr is decremented to 1. Then the unmounting process begins: kill_sb calls autofs_catatonic_mode(), which should have freed the waitqueues, but it only decrements its usage counter to zero which is not a correct behaviour. edit:imk This description is of course not correct. The umount performed as a result of an expire is a umount of a mount that has been automounted, it's not the autofs mount itself. They happen independently, usually after everything mounted within the autofs file system has been expired away. If everything hasn't been expired away the automount daemon can still exit leaving mounts in place. But expires done in both cases will result in a notification that calls autofs_wait_release() with a result status. The problem case is the summary execution of of the automount daemon. In this case any waiting processes won't be woken up until either they are terminated or the mount is umounted. end edit: imk So in catatonic mode we should free waitqueues which counter becomes zero. edit: imk Initially I was concerned that the calling of autofs_wait_release() and autofs_catatonic_mode() was not mutually exclusive but that can't be the case (obviously) because the queue entry (or entries) is removed from the list when either of these two functions are called. Consequently the wait entry will be freed by only one of these functions or by the woken process in autofs_wait() depending on the order of the calls. end edit: imk The Linux kernel CVE team has assigned CVE-2023-54134 to this issue. Affected and fixed versions =========================== Fixed in 4.14.326 with commit 1985e8eae8627f02e3364690c5fed7af1c46be55 Fixed in 4.19.295 with commit 976abbdc120a97049b9133e60fa7b29627d11de4 Fixed in 5.4.257 with commit 6079dc77c6f32936e8a6766ee8334ae3c99f4504 Fixed in 5.10.197 with commit 69ddafc7a7afd8401bab53eff5af813fa0d368a2 Fixed in 5.15.133 with commit 71eeddcad7342292c19042c290c477697acaccab Fixed in 6.1.55 with commit 726deae613bc1b6096ad3b61cc1e63e33330fbc2 Fixed in 6.5.5 with commit 696b625f3f85d80fca48c24d2948fbc451e74366 Fixed in 6.6 with commit ccbe77f7e45dfb4420f7f531b650c00c6e9c7507 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2023-54134 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: fs/autofs/waitq.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/1985e8eae8627f02e3364690c5fed7af1c46be55 https://git.kernel.org/stable/c/976abbdc120a97049b9133e60fa7b29627d11de4 https://git.kernel.org/stable/c/6079dc77c6f32936e8a6766ee8334ae3c99f4504 https://git.kernel.org/stable/c/69ddafc7a7afd8401bab53eff5af813fa0d368a2 https://git.kernel.org/stable/c/71eeddcad7342292c19042c290c477697acaccab https://git.kernel.org/stable/c/726deae613bc1b6096ad3b61cc1e63e33330fbc2 https://git.kernel.org/stable/c/696b625f3f85d80fca48c24d2948fbc451e74366 https://git.kernel.org/stable/c/ccbe77f7e45dfb4420f7f531b650c00c6e9c7507