lkml.org 
[lkml]   [2020]   [Oct]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRE: [RFC] debugfs: protect against rmmod while files are open
    Date
    From: Johannes Berg
    > Sent: 09 October 2020 11:48
    >
    > On Fri, 2020-10-09 at 12:41 +0200, Johannes Berg wrote:
    >
    > > If the fops doesn't have a release method, we don't even need
    > > to keep a reference to the real_fops, we can just fops_put()
    > > them already in debugfs remove, and a later full_proxy_release()
    > > won't call anything anyway - this just crashed/UAFed because it
    > > used real_fops, not because there was actually a (now invalid)
    > > release() method.
    >
    > I actually implemented something a bit better than what I described - we
    > never need a reference to the real_fops for the release method alone,
    > and that means if the release method is in the kernel image, rather than
    > a module, it can still be called.
    >
    > That together should reduce the ~117 places you changed in the large
    > patchset to around a handful.

    Is there an equivalent problem for normal cdev opens
    in any modules?

    David

    -
    Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
    Registration No: 1397386 (Wales)
    \
     
     \ /
      Last update: 2020-10-09 12:57    [W:3.703 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site