From patchwork Sun Dec 22 23:12:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13918314 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB96CE77188 for ; Sun, 22 Dec 2024 23:12:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 30DC86B007B; Sun, 22 Dec 2024 18:12:28 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2BC346B0082; Sun, 22 Dec 2024 18:12:28 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1AB5C6B0083; Sun, 22 Dec 2024 18:12:28 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id F293F6B007B for ; Sun, 22 Dec 2024 18:12:27 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 8E34C807DE for ; Sun, 22 Dec 2024 23:12:27 +0000 (UTC) X-FDA: 82924144716.21.5B9FD5C Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf19.hostedemail.com (Postfix) with ESMTP id 25E471A0007 for ; Sun, 22 Dec 2024 23:11:46 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=JsU6PInZ; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf19.hostedemail.com: domain of sj@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734909128; a=rsa-sha256; cv=none; b=TIYE8e6ozVyTdDgL/qEtQrM/DvvJtDFrVWoe27nsN/oi9XOrtmtixuxqKygZl6xvqED4ua L1ZBJ+o1MJU27HrlbYl8Rzt9czDGGsML+7HRX4Ce3ZJOIeUoO+WuB5Nx0vOb4gOwAk/Dhc vDBXq2ldvcek8UGkqGzxe5S3uePjqD8= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=JsU6PInZ; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf19.hostedemail.com: domain of sj@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734909128; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=4SwY/SE92EcOu5DhXLffiV6S76cN9iBK62uJ9iZC1+k=; b=k+cKuzi7/1Mjih6QF0ae7cmIi3ydbpksuRLAWhprqXKMBKMaq3Tfxk4FIAFeysWg8/WZIO nkv2dkHdQiE6HwaPs+rihzh4VnZrOAJmsFlnjzJ1qeGtWlnqRkTowoSsHzLOyj/KrWdFS8 DJM/QMY+ElKk8rzM9OG0roMsfRDdmE8= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id F0C0BA40B14; Sun, 22 Dec 2024 23:10:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 93CB1C4CECD; Sun, 22 Dec 2024 23:12:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734909144; bh=SSI7Tn6SikEE6Gd2Q2oJVusNNucHn6YZQJN4/lEumMw=; h=From:To:Cc:Subject:Date:From; b=JsU6PInZI4ZU+mTYWAy3mJrw4QpTpSHHTzuM8brMxVYeb6PV1y8aUjtxnEnq+dDiS rSUCWil/pTvVPz8ohac6pjlw9vQ/UC8khy5mRzGC5rfSRMh87RrZ+Pped3grcKQ5TZ drVYXiW1kaypnjOHgoBv1rBiN7uXO9dOgYq3h+nkVQxo1zHPuUaV+11I4o/EKviRUq H7UQNQ3sGzLayu0Z9VzFWd79U8F0fK4JLcRvvgxx8LcIosoMDLJOrdnCXlCEKfecTa LP5ZkqAEZNldmXFHVRICIJcUXuPJONxKjc+4x38OyaqlVgEV8SLKERPitXqSxWi8iR stmAAIxWDM9gg== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/2] mm/damon/core: fix memory leaks and ignored inputs from damon_commit_ctx() Date: Sun, 22 Dec 2024 15:12:20 -0800 Message-Id: <20241222231222.85060-1-sj@kernel.org> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 25E471A0007 X-Stat-Signature: itn1bcrzzz9bshba61789qrd9wxamgq3 X-HE-Tag: 1734909106-219038 X-HE-Meta: U2FsdGVkX18FYzwNfD0hT70eecyI5dB8pVslRPwSLumbrZMOilFshHjy7DETo9BOSYfK4bysmA/sNoJE+WEwyanp2lano9QFmrT5o3RzCKQSSz1rhVFF2mKThUUSnCoRq63DM9uCgl3ZdWzvyKQW39a4CyLzd/1hR9nNb10XAY8CpywJimPwolmuvwfkRujGx2BslvkS2iU5+lG3Tac+fgSB/wDhV/wlajj7imyFBAVkGbRSy2Kwn3O04ALDQ6dFIc2n/NBBw2oNNzWqc0bQz24okSt7mUsVsJztbgQkBZLkKEV9fO52Jr+xesIX6rfXkeHGOr6paxLvNEtHjogyFkoy/zZJj43/g5PDSFR78KWDxW0SN1OzFNILcAKvuL41fA+sO9yOQmwIf8xCqzy/0dX5SumGTbPA8kMEBWl1oWfa02f5rIqbBg/6dOleonyJl4VCUn1NbPutiUIRSJEFLRYuMAIFx+ollEhXUcvqnVOqMdeGEpmrhNZsAPXotndHPLLEjvDSiP25ac/sXz8pdDNZpsmOpfmuP/dEmeocbNHPchE+bu07t1GsP4xkGg6gjhrgnXbN+SnFP8fQP1nWHhcq4nEnh9CKpcm0xgbuyraHXL7gFgkLv7/le3vS3igy45w6+7uPk4kLYIIGl7hi594qCIq06v1I2OhJ0G7t5AVsY+Yu7Bbmx0yVjmprleOaFWl9SU/0g1DmF5qg6dBLx1B0+8GLUypDzkdus16EuVPIldhWQqEsoIpTvdARz2l2jR4yBEya4sw1Lht0FUXe1wMFLE//7kKk/dxqX3PRQCn3KgZATjPvWCCGQTv/74jNL+WYUHIExMeZxIzTU67CdT6m5Zo4Jwhzr/+jnwcAVgQP+9ykOSALU8HVcEgNKBAVzeT60+Y23MoSfm4/cZ2nEMKQLUEwvFQSMQFR9PySab2RhZl72ldFRkiiE4s/G9oV+UpssTDN+/1cjeDBrpf N34MbZl7 ZGxupJr0hl/N6P7Keo73fZ5PyW2s2ES6Q75BLBvs6JYllMiWGaEB9qNpdKxRSinSt/MNuaIrQhCCWN1cwrT6vLde73RFBMolEXJHXsAzuaBzJw1j+WA44VWsErYRTuFMhwu5d3XfPGO2/CEDo2w9RilgSVQG1P9W14zOyrKlQjtlreOZNscZQU4wBESlnVmsjkB7zujd9z33B0vuVn5kN2a6BCfjLylY5S8kufr7Nn90A/wcY1NIAUBm27uwYwO4T9iM5 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Due to two bugs in damon_commit_targets() and damon_commit_schemes(), which are called from damon_commit_ctx(), some user inputs can be ignored, and some mmeory objects can be leaked. Fix those. Note that only DAMON sysfs interface users are affected. Other DAMON core API user modules that more focused more on simple and dedicated production usages, including DAMON_RECLAIM and DAMON_LRU_SORT are not using the buggy function in the way, so not affected. SeongJae Park (2): mm/damon/core: fix new damon_target objects leaks on damon_commit_targets() mm/damon/core: fix ignored quota goals and filters of newly committed schemes mm/damon/core.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) base-commit: a2b6c37664ce2d7ab39837dae4078fcb01078f13