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]
Date:   Tue, 1 Dec 2020 18:52:28 +0530
From:   Selva Jove <selvajove@...il.com>
To:     Aleksei Marov <alekseymmm@...l.ru>
Cc:     SelvaKumar S <selvakuma.s1@...sung.com>,
        linux-nvme@...ts.infradead.org, kbusch@...nel.org, axboe@...nel.dk,
        Damien Le Moal <damien.lemoal@....com>, hch@....de,
        sagi@...mberg.me, linux-block@...r.kernel.org,
        linux-kernel@...r.kernel.org, nj.shetty@...sung.com,
        joshi.k@...sung.com, javier.gonz@...sung.com
Subject: Re: [RFC PATCH 1/2] block: add simple copy support

Thanks for reporting the memory leak. Will add a fix.

On Tue, Dec 1, 2020 at 3:58 PM Aleksei Marov <alekseymmm@...l.ru> wrote:
>
> On Tue, 2020-12-01 at 11:09 +0530, SelvaKumar S wrote:
> > +     ret = __blkdev_issue_copy(bdev, dest, nr_srcs, rlist, gfp_mask, flags,
> > +                     &bio);
> > +     if (!ret && bio) {
> > +             ret = submit_bio_wait(bio);
> > +             if (ret == -EOPNOTSUPP)
> > +                     ret = 0;
> > +
> > +             kfree(page_address(bio_first_bvec_all(bio)->bv_page) +
> > +                             bio_first_bvec_all(bio)->bv_offset);
> > +             bio_put(bio);
> > +     }
> > +
> > +     return ret;
> > +}
> I think  there is an issue here that if bio_add_page  returns error in
> __blkdev_issue_copy then ret is -ENOMEM and we never do bio_put for bio
> allocated in  __blkdev_issue_copy so it is small memory leak.
>
>

Powered by blists - more mailing lists