Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp805112imw; Thu, 14 Jul 2022 11:04:55 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uAqDAjbr/WPlauoOV18dlRdbOpdYp9pU6B4fSg1yF4brNwX2/+o77Ou7TPgD6SXgNvaLRT X-Received: by 2002:a05:6402:430f:b0:43a:d521:bda with SMTP id m15-20020a056402430f00b0043ad5210bdamr14324052edc.69.1657821894818; Thu, 14 Jul 2022 11:04:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657821894; cv=none; d=google.com; s=arc-20160816; b=CsRe9ARtWFJqEKZfiKpYfnzh8+LdOEbedW1W9ytLS9phg3ofL4Joj+OZ2lJNbpwq3W yk7v+Vjr2nEq1jGN5gjs8quEZEICJeEp9vpkcMxN08t5atTJqyTdpa8AIHXIWEQeOJ6u lpzS+D9nZ7081ATZ/ApfDvopF/NnR63yDykHhK/Z8YVPiLEnA+X7rMdctJ+U5VWQKHzB LvOfbnyY6cMGPvmvCX9l112ZvAmsq2QEz/PjUgOAHiQSi7AlZnAbuBNTg0CC5NZ8kKk7 muUp9Fr+C4MbVi1Rras5fZNs4AS3SbgXozU933FG0MfMGPVHzGU5G9CKS7fsUV9tivMu MFmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=r2/2dkysu4wnkjw/ia5G9hxr4TWV7V6MHc7/sjbip9s=; b=IcjuQE6XIEjsBYLqvF/aPiR87i/zox1AAK8rYALMLWycj5pxgquCBGDvhDF+49sllF r8sNnt8qJKiig4w/8VFRotqmUp44BdhXqcQC4gXi6/MhR2MuFhzJsM+S9LLetZrPPsxd 4dFHHdLfNQbjM+g51iaUScaYqvEmpyb7O/nuTWYrn4KP0iuW8TWRyzSG/lLwXRBF7lVd cocrdErWPlIW+ak5DzoTXMB+iqY0dIkHkeGpdOiXl3dZRxZNUvZjKJWyxk8/5XdBsHIx 2JeVMc7pJLgjLnE/bIrxg4eqbe04AOsYqFVNZmAqA5IIu6YiyeEtlq1zpKIYmHGmfxC4 /TGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bQ+VUlWJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mp22-20020a1709071b1600b00726a78c2a41si2812800ejc.701.2022.07.14.11.04.27; Thu, 14 Jul 2022 11:04:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bQ+VUlWJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240179AbiGNRnY (ORCPT + 99 others); Thu, 14 Jul 2022 13:43:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239886AbiGNRnV (ORCPT ); Thu, 14 Jul 2022 13:43:21 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46FE65509E; Thu, 14 Jul 2022 10:43:21 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D9FEC6211C; Thu, 14 Jul 2022 17:43:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB438C34114; Thu, 14 Jul 2022 17:43:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657820600; bh=kg/rfOig8h7zvTG7CNWOXFC1hHSgJ1pLQcsSmugFb5E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bQ+VUlWJUp5+YLlUY9qfYouLMLqn4F16jWarpGPKd+69HFdrNfB50/i02Y/OY01pw MfEJ8xmGRlv5rMsVXeV1r5xGa81iSoRlwa8jkOI+bf1uutaBhaZ4pxyGYdwvFmsoqn Zxnww++1pVdCDKl3PvuHdmlF4Ar0SXcbNOrf4wMSSZeABmpDWQN+4/jnLMxiYdqkvE gLvlwuU57XLt6DjwKTDlvGrdS2FS8sW/fBN/QvJ1hHpj1P4iJscgnYEUu34CMGcqIp cmhkxp/01DvksvPbi5b8myZXgI96zKJueXLOwQO6H0xI+naLjKDIbe0wXUOO6HAbsH l2ZCcr93eOV0A== From: SeongJae Park To: SeongJae Park Cc: Jianglei Nie , akpm@linux-foundation.org, damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] mm/damon/reclaim: fix potential memory leak in damon_reclaim_init() Date: Thu, 14 Jul 2022 17:43:17 +0000 Message-Id: <20220714174317.49994-1-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220714164427.157184-1-sj@kernel.org> References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Jianglei, On Thu, 14 Jul 2022 16:44:27 +0000 SeongJae Park wrote: > Hello Jianglei, > > On Thu, 14 Jul 2022 14:37:46 +0800 Jianglei Nie wrote: > > > damon_reclaim_init() allocates a memory chunk for ctx with > > damon_new_ctx(). When damon_select_ops() fails, ctx is not released, which > > will lead to a memory leak. I realized this issue is also in DAMON_LRU_SORT, so posted a patch: https://lore.kernel.org/damon/20220714170458.49727-1-sj@kernel.org/ I mistakenly forgot CC-ing you, so letting you know here. Thanks, SJ