"Bernard Metzler" <b...@zurich.ibm.com>写道:
> -----"Dinghao Liu" <dinghao....@zju.edu.cn> wrote: -----
> 
> >To: dinghao....@zju.edu.cn, k...@umn.edu
> >From: "Dinghao Liu" <dinghao....@zju.edu.cn>
> >Date: 02/26/2021 08:56AM
> >Cc: "Bernard Metzler" <b...@zurich.ibm.com>, "Doug Ledford"
> ><dledf...@redhat.com>, "Jason Gunthorpe" <j...@ziepe.ca>,
> >linux-r...@vger.kernel.org, linux-kernel@vger.kernel.org
> >Subject: [EXTERNAL] [PATCH] RDMA/siw: Fix missing check in
> >siw_get_hdr
> >
> >We should also check the range of opcode after calling
> >__rdmap_get_opcode() in the else branch to prevent potential
> >overflow.
> 
> Hi Dinghao,
> No this is not needed. We always first read the minimum
> header information (MPA len, DDP flags, RDMAP opcode,
> STag, target offset). Only if we have received that
> into local buffer, we check for the opcode this one time.
> Now the opcode determines the remaining length of the
> variably sized part of the header to be received.
> 
> We do not have to check the opcode again, since we
> already received and checked it.
> 

It's clear to me, thanks!

Regards,
Dinghao

Reply via email to