lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAH2r5mtwMep4J1yu1jUUEp3+CmwhFuv2mJKqN1ViBkSxi-jGTg@mail.gmail.com>
Date:   Mon, 19 Apr 2021 18:39:26 -0500
From:   Steve French <smfrench@...il.com>
To:     Aurélien Aptel <aaptel@...e.com>
Cc:     Muhammad Usama Anjum <musamaanjum@...il.com>,
        Steve French <sfrench@...ba.org>,
        Ronnie Sahlberg <lsahlber@...hat.com>,
        "open list:COMMON INTERNET FILE SYSTEM CLIENT (CIFS)" 
        <linux-cifs@...r.kernel.org>,
        open list <linux-kernel@...r.kernel.org>,
        kernel-janitors <kernel-janitors@...r.kernel.org>,
        Dan Carpenter <dan.carpenter@...cle.com>,
        Colin King <colin.king@...onical.com>
Subject: Re: [PATCH v2] cifs: remove unnecessary copies of tcon->crfid.fid

I changed the comment to

+               /*
+                * See commit 2f94a3125b87. Increment the refcount when we
+                * get a lease for root, release it if lease break occurs
+                */

and added Aurelien's Reviewed-by.  Let me know if you see any
additional problems.

On Sat, Apr 17, 2021 at 5:54 AM Aurélien Aptel <aaptel@...e.com> wrote:
>
> Hi,
>
> This is better I think.
>
> Muhammad Usama Anjum <musamaanjum@...il.com> writes:
> > @@ -894,6 +891,10 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon,
> >
> >       /* BB TBD check to see if oplock level check can be removed below */
> >       if (o_rsp->OplockLevel == SMB2_OPLOCK_LEVEL_LEASE) {
> > +             /*
> > +              * caller expects this func to set the fid in crfid to valid
> > +              * cached root, so increment the refcount.
> > +              */
>
> This comment is misleading. crfid variable doesn't exist anymore, and
> the kref_get() here is because of this commit:
>
>     commit 2f94a3125b87
>     Author: Ronnie Sahlberg <lsahlber@...hat.com>
>     Date:   Thu Mar 28 11:20:02 2019 +1000
>
>         cifs: fix kref underflow in close_shroot()
>
>         [...]
> -->     This extra get() is only used to hold the structure until we get a lease
> -->     break from the server at which point we will kref_put() it during lease
> -->     processing.
>         [...]
>
>
>
> When we queue a lease break, we usually get() the cifsFileInfo, but if
> that cifsFileInfo is backed by a cached_fid, the cached_fid isn't
> bumped. That commit was probably a work around for that.
>
> @Ronnie :
>
> struct cached_fid is starting to look very much like struct
> cifsFileInfo. I wonder why we couldn't use it, along with
> find_writable_file()/find_readable_file() to handle the caching.
>
> Alternatively, make cifsFileInfo use cached_fid (perhaps renaming it in
> the process, I don't know)
>
> Because I suspect a lot more issues will come up regarding cached_fid
> refcount and cifsFileInfo refcount going out of sync otherwise.
>
> Cheers,
> --
> Aurélien Aptel / SUSE Labs Samba Team
> GPG: 1839 CB5F 9F5B FB9B AA97  8C99 03C8 A49B 521B D5D3
> SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg, DE
> GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 247165 (AG München)
>


-- 
Thanks,

Steve

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ