[dpdk-dev] [PATCH] net/bnxt: fix a possible stack smashing

Ajit Khaparde ajit.khaparde at broadcom.com
Thu Apr 30 20:29:06 CEST 2020


On Thu, Apr 30, 2020 at 6:45 AM Lance Richardson <
lance.richardson at broadcom.com> wrote:

> On Thu, Apr 30, 2020 at 9:37 AM Yuan Linsi <yuanlinsi01 at baidu.com> wrote:
> >
> > From: yuanlinsi01 <yuanlinsi01 at baidu.com>
> >
> > We see a stack smashing as a result of defensive code missing. Once the
> > nb_pkts is less than RTE_BNXT_DESCS_PER_LOOP, it will be modified to
> > zero after doing a floor align, and we can not exit the following
> > receiving packets loop. And the buffers will be overwrite, then the
> > stack frame was ruined.
> >
> > Fix the problem by adding defensive code, once the nb_pkts is zero, just
> > directly return with no packets.
> >
> > Fixes: bc4a000f2 ("net/bnxt: implement SSE vector mode")
> > Cc: stable at dpdk.org
> >
> > Signed-off-by: yuanlinsi01 <yuanlinsi01 at baidu.com>
> > Signed-off-by: rongdongsheng <rongdongsheng at baidu.com>
>
> Thanks for the fix!
>
> Acked-by: Lance Richardson <lance.richardson at broadcom.com>
>
Patch applied to dpdk-next-net-brcm.  Thanks


More information about the dev mailing list