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 9D47C1369AA for ; Tue, 27 Feb 2024 09:49:26 +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=1709027366; cv=none; b=OISCBsyavjU0EGLM9TlwHN/CZoA3MM0yMq8f5CVJISkUSkIrn8+5Nnv4OHEB0t/RwbL75F3TLvG4E79Woog11xr1Jqg2+UdFCRsdoFo6Q63ZU8SwuQPfbPgfvA6Hcq5+DggG5J50DCZ5NlFNP/Q6oxIpXnPysIuLV4P9p4iOThM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709027366; c=relaxed/simple; bh=D4dFwv/32T2453exaAz8IOK+dFdLmXtemdllyPLWTJQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=cGoFqFfb9Y+SsLM59qYPRfUb0uY9seQL8TflO1N8jF2/I1RHIKx9X1nukC/aJXlmRLdlvxH1n0HnK7fASzh0PrtKVQL82dvtHgs9QHCpN6cog4mX2p7zngBIFOSpk3sthtQyuC1qpO8V2I9g72oVNo7JkpnYBDT46QoE4UJXse0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=wDe22JEi; 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="wDe22JEi" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26687C433C7; Tue, 27 Feb 2024 09:49:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1709027366; bh=D4dFwv/32T2453exaAz8IOK+dFdLmXtemdllyPLWTJQ=; h=From:To:Cc:Subject:Date:Reply-to:From; b=wDe22JEiYPQ7kjshHR9C4kHMstu/uqwOoWiNdK1weIQzm/Zf4UvS2bUtoawu88M3B 5Ekct/aIR79dF3vqXK37BcxfrMbuYKsK+f195JMfVdnsbu+eNnG/oKitfxY8YUfeyf +G8PhdksjYjhI8diIXPEE8B1lUnD8zOvRZJnO8C0= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2021-46937: mm/damon/dbgfs: fix 'struct pid' leaks in 'dbgfs_target_ids_write()' Date: Tue, 27 Feb 2024 10:48:58 +0100 Message-ID: <2024022751-CVE-2021-46937-3ae8@gregkh> X-Mailer: git-send-email 2.44.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=2213; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=D4dFwv/32T2453exaAz8IOK+dFdLmXtemdllyPLWTJQ=; b=owGbwMvMwCRo6H6F97bub03G02pJDKl3NzCvKZ9x8qPcZyPTT/wZT9V/tLjq++6vr4r0X8r10 e/ourf2HbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjARjucMC3a7J1bNPrFYnF9z 1+Eas0erbTZGb2OYn3+r/EuymuOfno7eXJOgnrdxjWEZAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: mm/damon/dbgfs: fix 'struct pid' leaks in 'dbgfs_target_ids_write()' DAMON debugfs interface increases the reference counts of 'struct pid's for targets from the 'target_ids' file write callback ('dbgfs_target_ids_write()'), but decreases the counts only in DAMON monitoring termination callback ('dbgfs_before_terminate()'). Therefore, when 'target_ids' file is repeatedly written without DAMON monitoring start/termination, the reference count is not decreased and therefore memory for the 'struct pid' cannot be freed. This commit fixes this issue by decreasing the reference counts when 'target_ids' is written. The Linux kernel CVE team has assigned CVE-2021-46937 to this issue. Affected and fixed versions =========================== Issue introduced in 5.15 with commit 4bc05954d007 and fixed in 5.15.13 with commit ffe4a1ba1a82 Issue introduced in 5.15 with commit 4bc05954d007 and fixed in 5.16 with commit ebb3f994dd92 Please see https://www.kernel.org or 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-2021-46937 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/dbgfs.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/ffe4a1ba1a82c416a6b3a09d46594f6a885ae141 https://git.kernel.org/stable/c/ebb3f994dd92f8fb4d70c7541091216c1e10cb71