Messages in this thread | | | Date | Fri, 26 Feb 2021 20:32:22 +0800 (GMT+08:00) | From | dinghao.liu@zju ... | Subject | Re: Re: [PATCH] RDMA/siw: Fix missing check in siw_get_hdr |
| |
"Bernard Metzler" <BMT@zurich.ibm.com>写道: > -----"Dinghao Liu" <dinghao.liu@zju.edu.cn> wrote: ----- > > >To: dinghao.liu@zju.edu.cn, kjlu@umn.edu > >From: "Dinghao Liu" <dinghao.liu@zju.edu.cn> > >Date: 02/26/2021 08:56AM > >Cc: "Bernard Metzler" <bmt@zurich.ibm.com>, "Doug Ledford" > ><dledford@redhat.com>, "Jason Gunthorpe" <jgg@ziepe.ca>, > >linux-rdma@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
| |