Re: Re: [PATCH] RDMA/siw: Fix missing check in siw_get_hdr
From: dinghao . liu
Date: Fri Feb 26 2021 - 07:33:57 EST
"Bernard Metzler" <BMT@xxxxxxxxxxxxxx>写道:
>
-----"Dinghao Liu" <dinghao.liu@xxxxxxxxxx> wrote: -----
>
>
>To: dinghao.liu@xxxxxxxxxx, kjlu@xxxxxxx
>
>From: "Dinghao Liu" <dinghao.liu@xxxxxxxxxx>
>
>Date: 02/26/2021 08:56AM
>
>Cc: "Bernard Metzler" <bmt@xxxxxxxxxxxxxx>, "Doug Ledford"
>
><dledford@xxxxxxxxxx>, "Jason Gunthorpe" <jgg@xxxxxxxx>,
>
>linux-rdma@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx
>
>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