From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Gu Bowen <gubowen5@huawei.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
Andrew Morton <akpm@linux-foundation.org>,
stable@vger.kernel.org, linux-mm@kvack.org,
Waiman Long <llong@redhat.com>, Breno Leitao <leitao@debian.org>,
John Ogness <john.ogness@linutronix.de>,
Lu Jialin <lujialin4@huawei.com>
Subject: Re: [PATCH v3] mm: Fix possible deadlock in console_trylock_spinning
Date: Mon, 18 Aug 2025 07:54:01 +0200 [thread overview]
Message-ID: <2025081846-spongy-cornstalk-ea09@gregkh> (raw)
In-Reply-To: <2285c764-e6b3-4cb4-ae12-0bfaa1e67358@huawei.com>
On Mon, Aug 18, 2025 at 10:24:38AM +0800, Gu Bowen wrote:
>
>
> On 8/14/2025 9:08 PM, Catalin Marinas wrote:
> > On Thu, Aug 14, 2025 at 10:33:56AM +0800, Gu Bowen wrote:
> > > On 8/14/2025 6:56 AM, Andrew Morton wrote:
> > > > I'm not sure which kernel version this was against, but kmemleak.c has
> > > > changed quite a lot.
> > > >
> > > > Could we please see a patch against a latest kernel version? Linus
> > > > mainline will suit.
> > > >
> > > > Thanks.
> > >
> > > I discovered this issue in kernel version 5.10. Afterwards, I reviewed the
> > > code of the mainline version and found that this deadlock path no longer
> > > exists due to the refactoring of console_lock in v6.2-rc1. For details on
> > > the refactoring, you can refer to this link :
> > > https://lore.kernel.org/all/20221116162152.193147-1-john.ogness@linutronix.de/.
> > > Therefore, theoretically, this issue existed before the refactoring of
> > > console_lock.
> >
> > Oh, so you can no longer hit this issue with mainline. This wasn't
> > mentioned (or I missed it) in the commit log.
> >
> > So this would be a stable-only fix that does not have a correspondent
> > upstream. Adding Greg for his opinion.
> >
>
> I have discovered that I made a mistake, this fix patch should be merged
> into the mainline. Since we have identified two types of deadlocks, the AA
> deadlock [1] and the ABBA deadlock[2], the latter's deadlock path no longer
> exists in the mainline due to the 40 patches that refactored console_lock.
> However, the AA deadlock issue persists, so I believe this fix should be
> applied to the mainline.
>
> [1] https://lore.kernel.org/all/20250731-kmemleak_lock-v1-1-728fd470198f@debian.org/#t
> [2] https://lore.kernel.org/all/20250730094914.566582-1-gubowen5@huawei.com/
Pleasae submit it as a normal patch then.
thanks,
greg k-h
prev parent reply other threads:[~2025-08-18 5:54 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-13 8:53 Gu Bowen
2025-08-13 16:22 ` Catalin Marinas
2025-08-13 22:56 ` Andrew Morton
2025-08-14 2:33 ` Gu Bowen
2025-08-14 13:08 ` Catalin Marinas
2025-08-14 13:56 ` Greg Kroah-Hartman
2025-08-14 14:38 ` Catalin Marinas
2025-08-14 14:54 ` Greg Kroah-Hartman
2025-08-14 17:00 ` Catalin Marinas
2025-08-18 2:24 ` Gu Bowen
2025-08-18 5:54 ` Greg Kroah-Hartman [this message]
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=2025081846-spongy-cornstalk-ea09@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=akpm@linux-foundation.org \
--cc=catalin.marinas@arm.com \
--cc=gubowen5@huawei.com \
--cc=john.ogness@linutronix.de \
--cc=leitao@debian.org \
--cc=linux-mm@kvack.org \
--cc=llong@redhat.com \
--cc=lujialin4@huawei.com \
--cc=stable@vger.kernel.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