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 6E8052FC03D for ; Tue, 23 Sep 2025 06:01:56 +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=1758607316; cv=none; b=PKtAwjsgo9oVVdnRNBW95IRY3CpbX+qrF1xNXCCZrI/XVHtNshe+5/+N6gDhf62cojbBH+Pp382GHDKzsfCqSEmqVhvq+eV/fHdWxA2nmU7LjTbfLWv8WBvVXC5JdHx1ZJNPCKM2mcNA7/K1eN/TM786CgOXLXIkzRwoOlRkNII= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758607316; c=relaxed/simple; bh=NTL0zp9x0lo48ptgUbjmZDbA/P8czjEQmzyq2vS6o+0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=qGvt74L9J8/ZByw6UK6xZaNOkxoOzjQK9em5zXmJ10Vs6oWnyBvRbUt3R2AVaQK4g34Lp7lIPhf9uhNcJF7jy/kOP2VgzWDFhhdamf97SBC83sjMDZVzZ0BzL0cnr+asRe+JyDsufiOBq6pbhqf1uGOuRK9ufLR4+kn6qKHOuvs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ZFWyLtde; 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="ZFWyLtde" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EC17EC4CEF5; Tue, 23 Sep 2025 06:01:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1758607316; bh=NTL0zp9x0lo48ptgUbjmZDbA/P8czjEQmzyq2vS6o+0=; h=From:To:Cc:Subject:Date:Reply-to:From; b=ZFWyLtdej2gPxVyVnuVqerfAsbbKuZbbjAPkSd9pGzOXvAtM3dAd8SRcEjXYVm1Bz BUySpQ564/R5EpkzIB74+QEYXH0xCsgi1o9yn4uNkrAYKXNib5SvO6AqyxSqmL0cgv cLdemsKkMYs1INGrUrsVQfR9TEMsJ8UCcr/v2LXQ= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-39887: tracing/osnoise: Fix null-ptr-deref in bitmap_parselist() Date: Tue, 23 Sep 2025 08:01:18 +0200 Message-ID: <2025092302-CVE-2025-39887-12f0@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=2635; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=To0EkurVVIttx/8OIcYB4yPfxu67sxaP/erM80oOzdk=; b=owGbwMvMwCRo6H6F97bub03G02pJDBmXzOfpLvi10K/jKOO3ldfOcRyISmHbFvjgolXLkY2rN gkbLFQS6YhlYRBkYpAVU2T5so3n6P6KQ4pehranYeawMoEMYeDiFICJbHzIMD/LcOWEpSYXJj4T lXiWrnHr6v5tp9UYFhzk5pm/dn+prsyclUGRDrMXdZcc4wQA 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: tracing/osnoise: Fix null-ptr-deref in bitmap_parselist() A crash was observed with the following output: BUG: kernel NULL pointer dereference, address: 0000000000000010 Oops: Oops: 0000 [#1] SMP NOPTI CPU: 2 UID: 0 PID: 92 Comm: osnoise_cpus Not tainted 6.17.0-rc4-00201-gd69eb204c255 #138 PREEMPT(voluntary) RIP: 0010:bitmap_parselist+0x53/0x3e0 Call Trace: osnoise_cpus_write+0x7a/0x190 vfs_write+0xf8/0x410 ? do_sys_openat2+0x88/0xd0 ksys_write+0x60/0xd0 do_syscall_64+0xa4/0x260 entry_SYSCALL_64_after_hwframe+0x77/0x7f This issue can be reproduced by below code: fd=open("/sys/kernel/debug/tracing/osnoise/cpus", O_WRONLY); write(fd, "0-2", 0); When user pass 'count=0' to osnoise_cpus_write(), kmalloc() will return ZERO_SIZE_PTR (16) and cpulist_parse() treat it as a normal value, which trigger the null pointer dereference. Add check for the parameter 'count'. The Linux kernel CVE team has assigned CVE-2025-39887 to this issue. Affected and fixed versions =========================== Issue introduced in 6.16 with commit 17f89102fe23d7389085a8820550df688f79888a and fixed in 6.16.8 with commit e33228a2cc7ff706ca88533464e8a3b525b961ed Issue introduced in 6.16 with commit 17f89102fe23d7389085a8820550df688f79888a and fixed in 6.17-rc6 with commit c1628c00c4351dd0727ef7f670694f68d9e663d8 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-39887 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: kernel/trace/trace_osnoise.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/e33228a2cc7ff706ca88533464e8a3b525b961ed https://git.kernel.org/stable/c/c1628c00c4351dd0727ef7f670694f68d9e663d8