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] [day] [month] [year] [list]
Message-ID: <CAOi1vP8wH4g=e+ie-JHFh67R7kH3VO1hYQMcJ2_bHHg_o-51hQ@mail.gmail.com>
Date: Mon, 25 Nov 2024 15:55:16 +0100
From: Ilya Dryomov <idryomov@...il.com>
To: Xiubo Li <xiubli@...hat.com>
Cc: Max Kellermann <max.kellermann@...os.com>, ceph-devel@...r.kernel.org, 
	linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH 2/2] fs/ceph/mds_client: fix cred leak in ceph_mds_check_access()

On Mon, Nov 25, 2024 at 1:53 AM Xiubo Li <xiubli@...hat.com> wrote:
>
>
> On 11/23/24 15:21, Max Kellermann wrote:
> > get_current_cred() increments the reference counter, but the
> > put_cred() call was missing.
> >
> > Fixes: 596afb0b8933 ("ceph: add ceph_mds_check_access() helper")
> > Cc: stable@...r.kernel.org
> > Signed-off-by: Max Kellermann <max.kellermann@...os.com>
> > ---
> >   fs/ceph/mds_client.c | 3 +++
> >   1 file changed, 3 insertions(+)
> >
> > diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
> > index e8a5994de8b6..35d83c8c2874 100644
> > --- a/fs/ceph/mds_client.c
> > +++ b/fs/ceph/mds_client.c
> > @@ -5742,6 +5742,7 @@ int ceph_mds_check_access(struct ceph_mds_client *mdsc, char *tpath, int mask)
> >
> >               err = ceph_mds_auth_match(mdsc, s, cred, tpath);
> >               if (err < 0) {
> > +                     put_cred(cred);
> >                       return err;
> >               } else if (err > 0) {
> >                       /* always follow the last auth caps' permision */
> > @@ -5757,6 +5758,8 @@ int ceph_mds_check_access(struct ceph_mds_client *mdsc, char *tpath, int mask)
> >               }
> >       }
> >
> > +     put_cred(cred);
> > +
> >       doutc(cl, "root_squash_perms %d, rw_perms_s %p\n", root_squash_perms,
> >             rw_perms_s);
> >       if (root_squash_perms && rw_perms_s == NULL) {
>
> Good catch.
>
> Reviewed-by: Xiubo Li <xiubli@...hat.com>

Applied.

Thanks,

                Ilya

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ