mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Samuel Holland <samuel@sholland.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
	Arend van Spriel <arend@broadcom.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] debugfs: Fix use-after-free in debugfs_create_devm_seqfile()
Date: Sun, 4 Apr 2021 12:08:01 +0200	[thread overview]
Message-ID: <YGmQAWBN4+uQCIUa@kroah.com> (raw)
In-Reply-To: <20210404004504.5547-1-samuel@sholland.org>

On Sat, Apr 03, 2021 at 07:45:04PM -0500, Samuel Holland wrote:
> This function uses devres to clean up its allocation, but it never removes the
> file referencing that allocation. This causes a use-after-free and an oops if
> the file is accessed after the owning device is removed.

What in-kernel user of this is having this problem?

The driver should clean up the debugfs file, it is not the debugfs
core's job to auto-remove the file.

The resource is what is being cleaned up by the devm usage in debugfs,
that's all, not the file.

Please fix up the driver that is creating the file but then not removing
it.

thanks,

greg k-h

  reply	other threads:[~2021-04-04 10:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-04  0:45 Samuel Holland
2021-04-04 10:08 ` Greg Kroah-Hartman [this message]
2021-04-04 17:26   ` Samuel Holland
2021-04-05  6:24     ` Greg Kroah-Hartman

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=YGmQAWBN4+uQCIUa@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=arend@broadcom.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=samuel@sholland.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

Powered by JetHome