From: Waiman Long <llong@redhat.com>
To: Kamaljit Singh <Kamaljit.Singh1@wdc.com>,
Waiman Long <llong@redhat.com>,
"cgroups@vger.kernel.org" <cgroups@vger.kernel.org>
Cc: "linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: cgroup null pointer dereference
Date: Thu, 24 Apr 2025 21:33:08 -0400 [thread overview]
Message-ID: <623427dc-b555-4e38-a064-c20c26bb2a21@redhat.com> (raw)
In-Reply-To: <BY5PR04MB684951591DE83E6FD0CBD364BC842@BY5PR04MB6849.namprd04.prod.outlook.com>
On 4/24/25 8:53 PM, Kamaljit Singh wrote:
> Hi Waiman,
>
>> On 4/23/25 1:30 PM, Kamaljit Singh wrote:
>>> Hello,
>>>
>>> While running IOs to an nvme fabrics target we're hitting this null pointer which causes
>>> CPU hard lockups and NMI. Before the lockups, the Medusa IOs ran successfully for ~23 hours.
>>>
>>> I did not find any panics listing nvme or block driver calls.
>>>
>>> RIP: 0010:cgroup_rstat_flush+0x1d0/0x750
>>> points to rstat.c, cgroup_rstat_push_children(), line 162 under second while() to the following code.
>>>
>>> 160 /* updated_next is parent cgroup terminated */
>>> 161 while (child != parent) {
>>> 162 child->rstat_flush_next = head;
>>> 163 head = child;
>>> 164 crstatc = cgroup_rstat_cpu(child, cpu);
>>> 165 grandchild = crstatc->updated_children;
>>>
>>> In my test env I've added a null check to 'child' and re-running the long-term test.
>>> I'm wondering if this patch is sufficient to address any underlying issue or is just a band-aid.
>>> Please share any known patches or suggestions.
>>> - while (child != parent) {
>>> + while (child && child != parent) {
>> Child can become NULL only if the updated_next list isn't parent
>> terminated. This should not happen. A warning is needed if it really
>> happens. I will take a further look to see if there is a bug somewhere.
> My test re-ran for 36+ hours without any CPU lockups or NMI. This patch seems to have helped.
>
I now see what is wrong. The cgroup_rstat_push_children() function is
supposed to be called with cgroup_rstat_lock held, but commit
093c8812de2d3 ("cgroup: rstat: Cleanup flushing functions and locking")
changes that. Hence racing can corrupt the list. I will work on a patch
to fix that regression.
Cheers,
Longman
next prev parent reply other threads:[~2025-04-25 1:33 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-23 17:30 Kamaljit Singh
2025-04-23 21:26 ` Waiman Long
2025-04-25 0:53 ` Kamaljit Singh
2025-04-25 1:33 ` Waiman Long [this message]
2025-04-25 1:43 ` Waiman Long
2025-04-25 1:49 ` Waiman Long
2025-04-25 2:22 ` Kamaljit Singh
2025-04-25 14:54 ` hch
2025-04-25 15:04 ` Waiman Long
2025-04-25 15:11 ` hch
2025-04-25 15:22 ` Waiman Long
2025-04-25 15:26 ` hch
2025-04-25 17:20 ` Kamaljit Singh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=623427dc-b555-4e38-a064-c20c26bb2a21@redhat.com \
--to=llong@redhat.com \
--cc=Kamaljit.Singh1@wdc.com \
--cc=cgroups@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®