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 A08D337FF77 for ; Wed, 22 Apr 2026 13:56:12 +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=1776866172; cv=none; b=OzM8ZecKnwnoPk/4Jj32vilF0TlRiqx8u8KT5XO9sIr/XbzjlBnYfGLdxWUdl+R6uD5/ECs6X1Zc8NRnVOKWRJ/2A9Q1RwI/x4dfTF4T4w4einvBlboDGQjjS8uOb0TssVlZR+f/evXB5V/0Iq1sUcjTOFiMpt71MMMxKibYc1Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776866172; c=relaxed/simple; bh=qZyKrE6Ush0KFx9hJLL4bPl8LMhQPP3MIy7sKwVZC2w=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=QQhc2hZJBoO61metO38+TCUiuBT3vZXK/Tm6s0OFm4YJ3i66xUWErDNUZHNrdIpsxVSQzr3oZZN6+ufdVy5A+lnwf47/hAXYEyrqT/HJiwQ0BnRmoZ8B1d5hEjj02EiBRwE8XAVB0ntHdPlA8Ldgfme7Tx2zsDmhQDm2U8u2v9Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=qFO/8lEf; 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="qFO/8lEf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 37D25C19425; Wed, 22 Apr 2026 13:56:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1776866172; bh=qZyKrE6Ush0KFx9hJLL4bPl8LMhQPP3MIy7sKwVZC2w=; h=From:To:Cc:Subject:Date:Reply-To:From; b=qFO/8lEf8To2cfZcHjRCU2v8xRn8+a4n7hG0S9AwgyghgOooVU3dy/1o7utpKj9KV 0n8XpLZcBlv5qHcWgrLyuknrZTahCpYGM5VjKiaJr0GuHWjIPJVaq9+Gc/4HTGWdvu 961PABOOYpz7IKGl/N43eaXA+fMc139mmqxvsHaM= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-31457: mm/damon/sysfs: check contexts->nr in repeat_call_fn Date: Wed, 22 Apr 2026 15:54:03 +0200 Message-ID: <2026042250-CVE-2026-31457-601a@gregkh> X-Mailer: git-send-email 2.54.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=2602; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=zh5Mg7E5L8FfF5p9QuQmwVka3XsGXD+np906P0DiYPI=; b=owGbwMvMwCRo6H6F97bub03G02pJDJkvLr1bO6/0Sm6o04w1isstJvQv8Uy6p2Wy8+Csu9ebq 7TV+x7IdcSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBE1J0Z5lfk94jerMp8IBq8 uv6Xx3MeraVNsxjmhzovUDJY8Fh31uKrn2XFJ9y2+TtFBgA= 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: mm/damon/sysfs: check contexts->nr in repeat_call_fn damon_sysfs_repeat_call_fn() calls damon_sysfs_upd_tuned_intervals(), damon_sysfs_upd_schemes_stats(), and damon_sysfs_upd_schemes_effective_quotas() without checking contexts->nr. If nr_contexts is set to 0 via sysfs while DAMON is running, these functions dereference contexts_arr[0] and cause a NULL pointer dereference. Add the missing check. For example, the issue can be reproduced using DAMON sysfs interface and DAMON user-space tool (damo) [1] like below. $ sudo damo start --refresh_interval 1s $ echo 0 | sudo tee \ /sys/kernel/mm/damon/admin/kdamonds/0/contexts/nr_contexts The Linux kernel CVE team has assigned CVE-2026-31457 to this issue. Affected and fixed versions =========================== Issue introduced in 6.17 with commit d809a7c64ba8229286b333c0cba03b1cdfb50238 and fixed in 6.18.21 with commit 3527e9fdc38570cea0f6ddb7a2c9303d4044b217 Issue introduced in 6.17 with commit d809a7c64ba8229286b333c0cba03b1cdfb50238 and fixed in 6.19.11 with commit 652cd0641a763dd0e846b0d12814977fadb2b7d8 Issue introduced in 6.17 with commit d809a7c64ba8229286b333c0cba03b1cdfb50238 and fixed in 7.0 with commit 6557004a8b59c7701e695f02be03c7e20ed1cc15 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-2026-31457 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: mm/damon/sysfs.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/3527e9fdc38570cea0f6ddb7a2c9303d4044b217 https://git.kernel.org/stable/c/652cd0641a763dd0e846b0d12814977fadb2b7d8 https://git.kernel.org/stable/c/6557004a8b59c7701e695f02be03c7e20ed1cc15