lkml.org 
[lkml]   [2019]   [Aug]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC 06/19] ktf: A simple debugfs interface to test results
On Wed, Aug 14, 2019 at 07:17:07PM +0200, Knut Omang wrote:
> I notice the discussion and your response here:
> http://linux-kernel.2935.n7.nabble.com/debugfs-and-module-unloading-td865175.html
> I assume that means that protection against module unload while a debugfs file
> is open is now safe.

It should be, if you set the *owner field of your file_operations
properly. Try it and see!

> On older kernels, having this code in place is far better than an unprotected
> debugfs entry/exit - I have tested it extensively in the past :-)

Yes, it seems to work, but again, it really is racy and will fail.
Please don't use it.

> I perfectly agree with you that reducing the hole for a race condition
> is generally a bad idea, but from the above mail thread
> it seems that's the only available choice for older kernels?

I have no idea, but please, do not use that pattern of code as it is
racy in all kernels, from all of time.

thanks,

greg k-h

\
 
 \ /
  Last update: 2019-08-15 10:56    [W:0.092 / U:9.724 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site