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: <20210824191248.GY1721383@nvidia.com>
Date:   Tue, 24 Aug 2021 16:12:48 -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 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;

?

Let me know I can fix it

Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ