From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 08DF7606A6AD for ; Tue, 1 Dec 2026 17:36:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Iji1D349 Received: by kanga.kvack.org (Postfix) id 0D9436B060B; Tue, 1 Dec 2026 12:36:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0626B6B066E; Tue, 1 Dec 2026 12:36:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EE1296B067C; Tue, 1 Dec 2026 12:36:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id D14DF6B0649 for ; Tue, 1 Dec 2026 12:36:13 -0500 (EST) Received: from smtpin27.hostedemail.com (lb01a-stub [10.200.18.249]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 59C8C14049E for ; Tue, 1 Dec 2026 17:36:13 +0000 (UTC) X-FDA: 85496117826.27.5D5AF8E Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by imf24.hostedemail.com (Postfix) with ESMTP id 9BDE8180005 for ; Tue, 1 Dec 2026 17:36:11 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20260515 header.b=Iji1D349; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf24.hostedemail.com: domain of sashiko-bot@kernel.org designates 172.234.252.31 as permitted sender) smtp.mailfrom=sashiko-bot@kernel.org ARC-Seal: i=1; a=rsa-sha256; d=hostedemail.com; s=arc-20220608; cv=none; t=1796146571; b=NqntQWyx9+casFlxj1GqDorS/T73nOMQKhHZEKNGa5PHkPrUPIxuGm8K0AEg/eUFI9F4em ABHlTlve+T4K2bjw28TjF4fhWsacVn0BlSiBYNHFbuGfKAdj14Fonu46eOKDQckJxPQfMh y2Dz1PH0mArWjMj1XMU1ICa2epOU9ZY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1796146571; h=from:from:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=0PQ8kI3NSJClgNstwJJrdzrvBwD85SK29/ryaQ6F3fE=; b=JsyEwa94oIVgSxs5NTnoYWbxr2H+TKEquO6E2n/m6pkrNXfp5UR6fMJsnM4WKoZtBkmC11 7kBA3t/GuVTTRsy1QewynghOUKYFP8tQpW+RzXd+WNhjBifZXndLkDgODcSJRoGw7dA/yf hJmr2JmW77J1N/tON3tkpaenLy25ul4= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20260515 header.b=Iji1D349; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf24.hostedemail.com: domain of sashiko-bot@kernel.org designates 172.234.252.31 as permitted sender) smtp.mailfrom=sashiko-bot@kernel.org Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 8522144D22; Tue, 1 Dec 2026 17:36:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E0D441F00899; Tue, 1 Dec 2026 17:36:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796146570; bh=0PQ8kI3NSJClgNstwJJrdzrvBwD85SK29/ryaQ6F3fE=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=Iji1D349lsiVPiz+sXxLwQgXC0grT4qX1jzbxgslh4rrcUz+xbsNCHCsrlOlCFX1K pQHfu3Ls3vzTDSjYigokv+aDZ1peqIv+Y5lNW1VJna/kwuNjmhtxluTT3kneeu+I5y 8ml90Uzo7k3lVhC6ntGnCxNUu8KdO2YUtybmdN+aojydn6myNyvGVDKIGfRHpHP5fl 2TSnTHLL4RGpMbUv68bhWMx3JcnT9zUtBQg3NOClGKx5caoOu8xgL6161PYYa86jMd T2CnZioUWTi9V0jAC+NzufNQqEE4PQb7LACnLSlWmhDzfhEBD7sxJD24oBTRGGO2eg SYO+WJpvBA4ug== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v2 07/11] selftests/cgroup: test the frozen state of a cgroup with tasks and children Reply-To: sashiko-reviews@lists.linux.dev To: "Shakeel Butt" , "Tejun Heo" Cc: "Andrew Morton" , "Johannes Weiner" , "Michal Koutny" , "Michal Hocko" , "Roman Gushchin" , "Christian Brauner" , "Oleg Nesterov" , "Sebastian Andrzej Siewior" , "Suren Baghdasaryan" , "T . J . Mercier" , "Usama Arif" , "Meta kernel team" , linux-mm@kvack.org In-Reply-To: <20261130173425.4117363-8-shakeel.butt@linux.dev> References: <20261130173425.4117363-1-shakeel.butt@linux.dev> <20261130173425.4117363-8-shakeel.butt@linux.dev> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 01 Dec 2026 17:36:09 +0000 X-Stat-Signature: oicw8gfrz8smajq7s8n5wq1ewciczutx X-Rspamd-Queue-Id: 9BDE8180005 X-Rspam-User: X-Rspamd-Server: rspam05 X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-HE-Tag: 1796146571-806475 X-HE-Meta: U2FsdGVkX19nszelI+L73eXmwuJ2pNfXKsinHyKmqxFJ6hH9rZeU0jrMNfs95SuJjZLbPdE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nWounEcmtV/xE35guSkAgEnL5ZiYOfr9fpK8VlTS6LmIGAY78y7pGud+dNU3L6//7Vbeb8ZwntfCoXwA3Vgu7M4sjQbXSQBDmcinAIZhliy/mvD5c/noYf/Xx4VFiY5nYjipv+rca/B6w4X9zLbNC7w6sEtrpSBW38F9WI0dLvFQGVvvkjfJQKQt8b60EZgwKcvy+enp9l/3TZL5SfQ3uxcRu7BTTA6GgCn4J8FzU4WKGZ1YA7DTXDT8FMihOtoSiGSHUPoY5wXT0f9hNaakqcloPJt3/Z7k2JWtn1lvryivo/YvaSHdtytpBZGrsjfHJOmuZr11aWZwCDBdcT0EKyiJp5bEPfx8rPigH2KXCH8toZ3GgrRhnT3GbHZsYx1noYvPGIWjfICjcjGSoSHZC062sw7VmEUhRdQiMOsI6nAoXySLUgDPtV04MqeWjAVOfI6emQgthburFTyUb9uNk2rQda924d911ZHealnFR2K+cAyhcsJZKtnx2tyKTWhc8VXlF5HATx4BgJSrtQG8SYbz53FwMzG6nMlUgdSdJlm9NDi5FxC6qxq7ZTgZv+nYN35C24uh9qSMHwggM6b+cPjUqM49kle3T1V7fOMI4iCf0ybFV1o7h8XX2ivZibU5Qv4NKFxipUgN88LVMKiYMX0zJEYZuvbSIk+tX Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] selftests/cgroup: NULL dereference in test_cgfreezer_nonleaf() via cg_name() -- commit 7a7c35569fc5e5295d8f0e537256fc64e4ab3eb7 Author: Shakeel Butt selftests/cgroup: test the frozen state of a cgroup with tasks and children This commit adds a cgroup freezer selftest verifying that a cgroup with both its own tasks and a child cgroup reports frozen only when all of its tasks and descendants are frozen. > diff --git a/tools/testing/selftests/cgroup/test_freezer.c b/tools/testin= g/selftests/cgroup/test_freezer.c > index 266b1a0f889f5..e24e977424921 100644 > --- a/tools/testing/selftests/cgroup/test_freezer.c > +++ b/tools/testing/selftests/cgroup/test_freezer.c [ ... ] > @@ -804,6 +805,109 @@ static int test_cgfreezer_vfork(const char *root) > return ret; > } > =20 > +/* > + * A cgroup with tasks of its own and child cgroups is frozen only once = its > + * tasks and all its descendants are frozen. > + * > + * A task frozen in a cgroup v1 freezer hierarchy sleeps in the refriger= ator, > + * where the cgroup v2 freezer can't trap it, so its v2 cgroup can't fre= eze > + * until it is thawed. A stopped task counts as frozen and isn't woken = by a > + * thaw. > + */ > +static int test_cgfreezer_nonleaf(const char *root) > +{ > + char *parent =3D NULL, *child =3D NULL, *staging =3D NULL, *v1cg =3D NU= LL; > + char v1root[] =3D "/tmp/cg_test_freezer_v1_XXXXXX"; > + int ret =3D KSFT_FAIL, frozen_pid, stopped_pid, i; > + bool mounted =3D false; > + > + if (!mkdtemp(v1root)) > + return KSFT_FAIL; > + > + if (mount("none", v1root, "cgroup", 0, "freezer")) { > + debug("Can't mount the cgroup v1 freezer\n"); > + ret =3D KSFT_SKIP; > + goto cleanup; > + } > + mounted =3D true; > + > + parent =3D cg_name(root, "cg_test_nonleaf"); > + child =3D cg_name(parent, "child"); > + staging =3D cg_name(root, "cg_test_nonleaf_staging"); > + v1cg =3D cg_name(v1root, "cg_test_nonleaf"); > + if (!parent || !child || !staging || !v1cg) > + goto cleanup; [Severity: Low] Can cg_name(parent, "child") dereference a NULL pointer if the allocation for parent fails? cg_name() unconditionally calls strlen() on its first argument, while parent is only checked for NULL after child is constructed. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261130173425.4117= 363-1-shakeel.butt@linux.dev?part=3D7