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: <20210825130923.GF1721383@nvidia.com>
Date:   Wed, 25 Aug 2021 10:09:23 -0300
From:   Jason Gunthorpe <jgg@...dia.com>
To:     Maor Gottlieb <maorg@...dia.com>
Cc:     dledford@...hat.com, hch@...radead.org, leonro@...dia.com,
        aelior@...vell.com, daniel@...ll.ch, airlied@...ux.ie,
        dennis.dalessandro@...nelisnetworks.com,
        dri-devel@...ts.freedesktop.org, intel-gfx@...ts.freedesktop.org,
        jani.nikula@...ux.intel.com, joonas.lahtinen@...ux.intel.com,
        linux-kernel@...r.kernel.org, linux-rdma@...r.kernel.org,
        maarten.lankhorst@...ux.intel.com, mripard@...nel.org,
        mkalderon@...vell.com, mike.marciniszyn@...nelisnetworks.com,
        mustafa.ismail@...el.com, rodrigo.vivi@...el.com,
        sroland@...are.com, shiraz.saleem@...el.com, tzimmermann@...e.de,
        linux-graphics-maintainer@...are.com, liweihang@...wei.com,
        liangwenpeng@...wei.com, yishaih@...dia.com, zackr@...are.com,
        zyjzyj2000@...il.com
Subject: Re: [PATCH rdma-next v4 2/3] lib/scatterlist: Fix wrong update of
 orig_nents

On Wed, Aug 25, 2021 at 07:59:27AM +0300, Maor Gottlieb wrote:
> 
> On 8/24/2021 10:12 PM, Jason Gunthorpe wrote:
> > On Tue, Aug 24, 2021 at 05:25:30PM +0300, Maor Gottlieb wrote:
> > > @@ -514,11 +531,13 @@ struct scatterlist *sg_alloc_append_table_from_pages(struct sg_table *sgt,
> > >   		offset = 0;
> > >   		cur_page = j;
> > >   	}
> > > -	sgt->nents += added_nents;
> > > +	sgt_append->sgt.nents += added_nents;
> > > +	sgt_append->sgt.orig_nents = sgt_append->sgt.nents;
> > > +	sgt_append->prv = s;
> > Why is nents being touched here?
> > 
> > Shouldn't it just be
> > 
> >      sgt_append->sgt.orig_nents += added_nents;
> >      sgt_append->prv = s;
> > 
> > ?
> 
> In general yes, but all the sg_alloc_* functions update both
> orig_nents and nents (to same value). May be drivers that pass nents
> instead of orig_nents to dma_map_sg* (like umem did before this
> patch set). So I prefer to set it here as well, also not to break
> sg_alloc_table_from_pages_segment which use the same path. This kind
> of change could be done very carefully next cycle for all
> sg_alloc_*.

Ok, interesting

Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ