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  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]
Date:   Tue, 5 Oct 2021 15:22:00 -0300
From:   Jason Gunthorpe <jgg@...dia.com>
To:     Logan Gunthorpe <logang@...tatee.com>
Cc:     Doug Ledford <dledford@...hat.com>, linux-rdma@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Zheng Yongjun <zhengyongjun3@...wei.com>,
        Wenpeng Liang <liangwenpeng@...wei.com>,
        Leon Romanovsky <leon@...nel.org>,
        Weihang Li <liweihang@...wei.com>,
        Mark Bloch <mbloch@...dia.com>
Subject: Re: [PATCH] RDMA/rw: switch to dma_map_sgtable()

On Fri, Oct 01, 2021 at 03:32:15PM -0600, Logan Gunthorpe wrote:
> There are a couple of subtle error path bugs related to mapping the
> sgls:
> 
> - In rdma_rw_ctx_init(), dma_unmap would be called with an sg that
>   could have been incremented from the original call, as well as an
>   nents that was not the original number of nents called when mapped.
> - Similarly in rdma_rw_ctx_signature_init, both sg and prot_sg were
>   unmapped with the incorrect number of nents.
> 
> To fix this, switch to the sgtable interface for mapping which
> conveniently stores the original nents for unmapping. This will get
> cleaned up further once the dma mapping interface supports P2PDMA and
> pci_p2pdma_map_sg() can be removed. At that point the sgtable interface
> will be preferred as it offers better error reporting for P2PDMA pages.
> 
> Signed-off-by: Logan Gunthorpe <logang@...tatee.com>
 ---
>  drivers/infiniband/core/rw.c | 66 ++++++++++++++++++++++--------------
>  1 file changed, 41 insertions(+), 25 deletions(-)

Applied to for-next, thanks

Jason

Powered by blists - more mailing lists