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: <20170920192533.GA25404@dhcp-216.srv.tuxera.com>
Date:   Wed, 20 Sep 2017 22:25:33 +0300
From:   Rakesh Pandit <rakesh@...era.com>
To:     Javier González <jg@...htnvm.io>
CC:     <mb@...htnvm.io>, <axboe@...com>, <linux-block@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>,
        Javier González <javier@...xlabs.com>,
        Matias Bjørling <matias@...xlabs.com>
Subject: Re: [PATCH 08/20] lightnvm: pblk: sched. metadata on write thread

On Wed, Sep 20, 2017 at 09:28:34PM +0300, Rakesh Pandit wrote:
> Hi Javier,
> 
> one small issue I found for error path while going through changes:
> 
> On Mon, Jun 26, 2017 at 11:57:17AM +0200, Javier González wrote:
> ..
> > +static int pblk_lines_alloc_metadata(struct pblk *pblk)
> > +{
[..]
> > +		if (!l_mg->sline_meta[i])
> > +			goto fail_free_smeta;
> 
> For this error path the the goto label at end doesn't free up
> resources correctly.  It needs a
> 
> while (--index >= 0)...
> 
> logic with appropriate adjustment.
> 
> > +	}
[..]
> > +	if (!l_mg->vsc_list)
> > +		goto fail_free_emeta;
> > +
> > +	for (i = 0; i < l_mg->nr_lines; i++)
> > +		l_mg->vsc_list[i] = cpu_to_le32(EMPTY_ENTRY);
> > +
> > +	return 0;
> > +
> > +fail_free_emeta:
> > +	while (--i >= 0) {
> > +		vfree(l_mg->eline_meta[i]->buf);
> 
> This would need l_mg->emeta_alloc_type check to decide whether
> allocation was done with kmalloc or vmalloc.
> 
> > +		kfree(&l_mg->eline_meta[i]);
> > +	}
> > +
> > +fail_free_smeta:
> > +	for (i = 0; i < PBLK_DATA_LINES; i++)
> > +		pblk_mfree(&l_mg->sline_meta[i], l_mg->smeta_alloc_type);
> > +
> > +	return -ENOMEM;
> > +}
> > +
> 
> Thanks,

I failed to see earlier that it has been merged already.  Will post a
patch in a while.

Thanks,

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ