mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Chunyan Zhang <chunyan.zhang@unisoc.com>
Cc: "Rafael J . Wysocki" <rafael@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Jing Xia <jing.xia@unisoc.com>,
	Jing Xia <jing.xia.mail@gmail.com>,
	Xuewen Yan <xuewen.yan@unisoc.com>, Ke Wang <ke.wang@unisoc.com>,
	Chunyan Zhang <zhang.lyra@gmail.com>
Subject: Re: [PATCH] class: fix use-after-free in class_register()
Date: Mon, 18 Dec 2023 07:52:18 +0100	[thread overview]
Message-ID: <2023121830-proxy-washed-ae4d@gregkh> (raw)
In-Reply-To: <20231218024403.1076134-1-chunyan.zhang@unisoc.com>

On Mon, Dec 18, 2023 at 10:44:03AM +0800, Chunyan Zhang wrote:
> From: Jing Xia <jing.xia@unisoc.com>
> 
> The lock_class_key is still registered and can be found in
> lock_keys_hash hlist after subsys_private is freed in error
> handler path.A task who iterate over the lock_keys_hash
> later may cause use-after-free.So fix that up and unregister
> the lock_class_key before kfree(cp).

What task iterates over all hashes?

And can you put ' ' after your '.'?

And how was this found?

> 
> Signed-off-by: Jing Xia <jing.xia@unisoc.com>
> Signed-off-by: Xuewen Yan <xuewen.yan@unisoc.com>

What commit id does this fix?

Also note in the changelog that this only can happen if lockdep is
enabled, which is not true for normal systems.

thanks,

greg k-h

  reply	other threads:[~2023-12-18  6:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-18  2:44 Chunyan Zhang
2023-12-18  6:52 ` Greg Kroah-Hartman [this message]
2023-12-18  6:53   ` Greg Kroah-Hartman
2023-12-18 10:41   ` jing xia

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=2023121830-proxy-washed-ae4d@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=chunyan.zhang@unisoc.com \
    --cc=jing.xia.mail@gmail.com \
    --cc=jing.xia@unisoc.com \
    --cc=ke.wang@unisoc.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=xuewen.yan@unisoc.com \
    --cc=zhang.lyra@gmail.com \
    /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®