From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Omar Sandoval <osandov@osandov.com>
Cc: linux-kernel@vger.kernel.org, Jiri Kosina <jikos@kernel.org>
Subject: Re: debugfs vs. device removal
Date: Thu, 19 Jan 2017 16:53:45 +0100 [thread overview]
Message-ID: <20170119155345.GA11660@kroah.com> (raw)
In-Reply-To: <20170119154841.GA6416@vader>
On Thu, Jan 19, 2017 at 07:48:41AM -0800, Omar Sandoval wrote:
> Hi,
>
> In the block layer, we abuse sysfs to export some per-device debugging
> information. I was looking into moving this to debugfs, but I realized
> that debugfs doesn't have a mechanism to ensure that a file associated
> with a device is safe to use when the device is removed.
What do you mean by "safe"? The race conditions where you remove a file
and still have it open should all now be resolved in 4.8 and 4.9, di dwe
miss something?
> At a quick glance, HID has some per-device information in debugfs.
> However, I don't see any sort of protection against a device being
> removed. I was easily able to trigger an oops by reading from
> /sys/kernel/debug/hid/*/rdesc in a loop and removing the USB device
> (trace attached).
>
> How can I safely export per-device debugging information to debugfs?
Try 4.9 and see if you can still reproduce this, it should be fixed. If
not, we might have forgotten to include the .owner field for the hid
debugfs file...
thanks,
greg k-h
next prev parent reply other threads:[~2017-01-19 15:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-19 15:48 debugfs vs. device removal Omar Sandoval
2017-01-19 15:53 ` Greg Kroah-Hartman [this message]
2017-01-19 16:03 ` Jiri Kosina
2017-01-19 17:33 ` Omar Sandoval
2017-01-19 18:03 ` Greg Kroah-Hartman
2017-01-19 19:40 ` Omar Sandoval
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=20170119155345.GA11660@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=jikos@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=osandov@osandov.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