From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B7B46C5AE5C for ; Wed, 15 Nov 2023 23:30:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233640AbjKOXa5 (ORCPT ); Wed, 15 Nov 2023 18:30:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230014AbjKOXay (ORCPT ); Wed, 15 Nov 2023 18:30:54 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FB7319E; Wed, 15 Nov 2023 15:30:51 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 98BABC433C9; Wed, 15 Nov 2023 23:30:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1700091050; bh=6rn5cWJ7ClZ8Tq2sJ7TmyO0KeOdWzgpCmkjzWxIlbxg=; h=Date:To:From:Subject:From; b=GFA0nYsJQIIHvHgAO611CI2+7n3ySEcXJ2Zaf8MCAmI6rmG5B765B3AML90GhsLOL GMNqJ504tPqJJpMUbnCjhzj2KUQ3Q2mzlbx1yVSDrR/uHwrQ3kjiJoaTw6XhOlvv+q 2Cm+XSOkgp/LrlPY1FiXkXl1i1CFJYduGGgNGlSI= Date: Wed, 15 Nov 2023 15:30:50 -0800 To: mm-commits@vger.kernel.org, stable@vger.kernel.org, sj@kernel.org, akpm@linux-foundation.org From: Andrew Morton Subject: [merged mm-hotfixes-stable] mm-damon-sysfs-schemes-handle-tried-region-directory-allocation-failure.patch removed from -mm tree Message-Id: <20231115233050.98BABC433C9@smtp.kernel.org> Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The quilt patch titled Subject: mm/damon/sysfs-schemes: handle tried region directory allocation failure has been removed from the -mm tree. Its filename was mm-damon-sysfs-schemes-handle-tried-region-directory-allocation-failure.patch This patch was dropped because it was merged into the mm-hotfixes-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm ------------------------------------------------------ From: SeongJae Park Subject: mm/damon/sysfs-schemes: handle tried region directory allocation failure Date: Mon, 6 Nov 2023 23:34:08 +0000 DAMON sysfs interface's before_damos_apply callback (damon_sysfs_before_damos_apply()), which creates the DAMOS tried regions for each DAMOS action applied region, is not handling the allocation failure for the sysfs directory data. As a result, NULL pointer derefeence is possible. Fix it by handling the case. Link: https://lkml.kernel.org/r/20231106233408.51159-4-sj@kernel.org Fixes: f1d13cacabe1 ("mm/damon/sysfs: implement DAMOS tried regions update command") Signed-off-by: SeongJae Park Cc: [6.2+] Signed-off-by: Andrew Morton --- mm/damon/sysfs-schemes.c | 2 ++ 1 file changed, 2 insertions(+) --- a/mm/damon/sysfs-schemes.c~mm-damon-sysfs-schemes-handle-tried-region-directory-allocation-failure +++ a/mm/damon/sysfs-schemes.c @@ -1826,6 +1826,8 @@ static int damon_sysfs_before_damos_appl return 0; region = damon_sysfs_scheme_region_alloc(r); + if (!region) + return 0; list_add_tail(®ion->list, &sysfs_regions->regions_list); sysfs_regions->nr_regions++; if (kobject_init_and_add(®ion->kobj, _ Patches currently in -mm which might be from sj@kernel.org are