[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BN8PR21MB1284BC427B0AA4C01C263BDECAB89@BN8PR21MB1284.namprd21.prod.outlook.com>
Date: Thu, 14 Oct 2021 12:51:48 +0000
From: Haiyang Zhang <haiyangz@...rosoft.com>
To: Jiasheng Jiang <jiasheng@...as.ac.cn>,
KY Srinivasan <kys@...rosoft.com>,
Stephen Hemminger <sthemmin@...rosoft.com>,
"wei.liu@...nel.org" <wei.liu@...nel.org>,
Dexuan Cui <decui@...rosoft.com>,
"davem@...emloft.net" <davem@...emloft.net>,
"kuba@...nel.org" <kuba@...nel.org>
CC: "linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"bpf@...r.kernel.org" <bpf@...r.kernel.org>
Subject: RE: [PATCH] hv_netvsc: Add comment of netvsc_xdp_xmit()
> -----Original Message-----
> From: Jiasheng Jiang <jiasheng@...as.ac.cn>
> Sent: Wednesday, October 13, 2021 9:26 PM
> To: KY Srinivasan <kys@...rosoft.com>; Haiyang Zhang
> <haiyangz@...rosoft.com>; Stephen Hemminger <sthemmin@...rosoft.com>;
> wei.liu@...nel.org; Dexuan Cui <decui@...rosoft.com>;
> davem@...emloft.net; kuba@...nel.org
> Cc: linux-hyperv@...r.kernel.org; netdev@...r.kernel.org; linux-
> kernel@...r.kernel.org; bpf@...r.kernel.org; Jiasheng Jiang
> <jiasheng@...as.ac.cn>
> Subject: [PATCH] hv_netvsc: Add comment of netvsc_xdp_xmit()
>
> Adding comment to avoid the misusing of netvsc_xdp_xmit().
> Otherwise the value of skb->queue_mapping could be 0 and
> then the return value of skb_get_rx_queue() could be MAX_U16
> cause by overflow.
>
> Fixes: 351e158 ("hv_netvsc: Add XDP support")
> Signed-off-by: Jiasheng Jiang <jiasheng@...as.ac.cn>
> ---
> drivers/net/hyperv/netvsc_drv.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/hyperv/netvsc_drv.c
> b/drivers/net/hyperv/netvsc_drv.c
> index f682a55..ac9529c 100644
> --- a/drivers/net/hyperv/netvsc_drv.c
> +++ b/drivers/net/hyperv/netvsc_drv.c
> @@ -803,6 +803,7 @@ void netvsc_linkstatus_callback(struct net_device
> *net,
> schedule_delayed_work(&ndev_ctx->dwork, 0);
> }
>
> +/* This function should only be called after skb_record_rx_queue() */
> static void netvsc_xdp_xmit(struct sk_buff *skb, struct net_device
> *ndev)
> {
Thanks.
Reviewed-by: Haiyang Zhang <haiyangz@...rosoft.com>
Powered by blists - more mailing lists