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 B9A1C26E71C for ; Thu, 11 Sep 2025 16:56:59 +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=1757609819; cv=none; b=GuscxADg+QcL8zJ5aFuLaEW/ZcLqpanG9dlr5JxX5UAFYL9ajYNKPRoIt3AE5ympQqgWpTe3k/uSkHovu0689/e1kSYHZqkWKdR1H5q6xjZa2Uzhd7LhOZlFtOZ0bXslPfnKoEXxb1kX+FyAJhxO6rr7bIhcmE3vaXyo12SD9+I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757609819; c=relaxed/simple; bh=UgJI4VHRKY7ageNrVdi8dCH2ZZRCNaP6SisyXHnbEGo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Af6L6N0gAriqSaASpV36hCtqSq4we/Xsu4x9Yzl8p29ktWr1wVuOo52HuuKXZ2hFEc6EpouilHyfVasxJFzptrnPpa1XMtuSao1ZOszlI1XDomXDXGByW+EipcHK5F0xjW3pPIztyG3kXWZo9MRkPlSsvxFeS3HJwjwmI6bOSBA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=hAqDE4ig; 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="hAqDE4ig" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 43D41C4CEF8; Thu, 11 Sep 2025 16:56:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1757609819; bh=UgJI4VHRKY7ageNrVdi8dCH2ZZRCNaP6SisyXHnbEGo=; h=From:To:Cc:Subject:Date:Reply-to:From; b=hAqDE4igboB5f7OxRjPn8teH9lW62zEMJXxvua+2cWNdSVCB/sidpwSmK9YBp2Act +Y5y8jTiqa9g0lVaWiuXTpv6NOQDLbm6wmmoyJ24M2NDHm7G8FVebUrY2HBL5OE45o SnfxC3Cs6wq9CwW+JgZPQ8YrTcbNBrQ4oWv1m0iY= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-39765: ALSA: timer: fix ida_free call while not allocated Date: Thu, 11 Sep 2025 18:56:44 +0200 Message-ID: <2025091143-CVE-2025-39765-5eac@gregkh> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=4144; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=vvsbNS1cI+fy2zqS/fhhHLaveHzQAWPot+8cBCOqwGo=; b=owGbwMvMwCRo6H6F97bub03G02pJDBmH/nsniQr/7D09peH/J6Vmn+KWn8rB82YovQtUDDn12 //SPs/cjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZjIaQeGBSti35/6o5k0K8Ey TndiJIPhf+tPbAxzBd7/5Y6ove5on/kzfuVJxnl6PcGzAA== 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: ALSA: timer: fix ida_free call while not allocated In the snd_utimer_create() function, if the kasprintf() function return NULL, snd_utimer_put_id() will be called, finally use ida_free() to free the unallocated id 0. the syzkaller reported the following information: ------------[ cut here ]------------ ida_free called for id=0 which is not allocated. WARNING: CPU: 1 PID: 1286 at lib/idr.c:592 ida_free+0x1fd/0x2f0 lib/idr.c:592 Modules linked in: CPU: 1 UID: 0 PID: 1286 Comm: syz-executor164 Not tainted 6.15.8 #3 PREEMPT(lazy) Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-4.fc42 04/01/2014 RIP: 0010:ida_free+0x1fd/0x2f0 lib/idr.c:592 Code: f8 fc 41 83 fc 3e 76 69 e8 70 b2 f8 (...) RSP: 0018:ffffc900007f79c8 EFLAGS: 00010282 RAX: 0000000000000000 RBX: 1ffff920000fef3b RCX: ffffffff872176a5 RDX: ffff88800369d200 RSI: 0000000000000000 RDI: ffff88800369d200 RBP: 0000000000000000 R08: ffffffff87ba60a5 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000002 R14: 0000000000000000 R15: 0000000000000000 FS: 00007f6f1abc1740(0000) GS:ffff8880d76a0000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f6f1ad7a784 CR3: 000000007a6e2000 CR4: 00000000000006f0 Call Trace: snd_utimer_put_id sound/core/timer.c:2043 [inline] [snd_timer] snd_utimer_create+0x59b/0x6a0 sound/core/timer.c:2184 [snd_timer] snd_utimer_ioctl_create sound/core/timer.c:2202 [inline] [snd_timer] __snd_timer_user_ioctl.isra.0+0x724/0x1340 sound/core/timer.c:2287 [snd_timer] snd_timer_user_ioctl+0x75/0xc0 sound/core/timer.c:2298 [snd_timer] vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:907 [inline] __se_sys_ioctl fs/ioctl.c:893 [inline] __x64_sys_ioctl+0x198/0x200 fs/ioctl.c:893 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x7b/0x160 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x76/0x7e [...] The utimer->id should be set properly before the kasprintf() function, ensures the snd_utimer_put_id() function will free the allocated id. The Linux kernel CVE team has assigned CVE-2025-39765 to this issue. Affected and fixed versions =========================== Issue introduced in 6.12 with commit 37745918e0e7575bc40f38da93a99b9fa6406224 and fixed in 6.12.44 with commit 34327b362ce2849a5eb02f47e800049e7a20a0ba Issue introduced in 6.12 with commit 37745918e0e7575bc40f38da93a99b9fa6406224 and fixed in 6.16.4 with commit af386b52531d14c4b20f11c452787b1b6dd4eb8d Issue introduced in 6.12 with commit 37745918e0e7575bc40f38da93a99b9fa6406224 and fixed in 6.17-rc3 with commit 5003a65790ed66be882d1987cc2ca86af0de3db1 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-2025-39765 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: sound/core/timer.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/34327b362ce2849a5eb02f47e800049e7a20a0ba https://git.kernel.org/stable/c/af386b52531d14c4b20f11c452787b1b6dd4eb8d https://git.kernel.org/stable/c/5003a65790ed66be882d1987cc2ca86af0de3db1