* [PATCH] net: hns3: fix length overflow when CONFIG_ARM64_64K_PAGES
@ 2018-04-04 9:40 Tan Xiaojun
2018-04-04 15:46 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Tan Xiaojun @ 2018-04-04 9:40 UTC (permalink / raw)
To: yisen.zhuang, salil.mehta
Cc: huawei.libin, tanxiaojun, netdev, linux-kernel, wangzhou1,
linyunsheng
When enable the config item "CONFIG_ARM64_64K_PAGES", the size of PAGE_SIZE
is 65536(64K). But the type of length is u16, it will overflow. So change it
to u32.
Signed-off-by: Tan Xiaojun <tanxiaojun@huawei.com>
---
drivers/net/ethernet/hisilicon/hns3/hns3_enet.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
index 9e4cfbb..98cdbd3 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
@@ -288,7 +288,7 @@ struct hns3_desc_cb {
u16 page_offset;
u16 reuse_flag;
- u16 length; /* length of the buffer */
+ u32 length; /* length of the buffer */
/* desc type, used by the ring user to mark the type of the priv data */
u16 type;
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net: hns3: fix length overflow when CONFIG_ARM64_64K_PAGES
2018-04-04 9:40 [PATCH] net: hns3: fix length overflow when CONFIG_ARM64_64K_PAGES Tan Xiaojun
@ 2018-04-04 15:46 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-04-04 15:46 UTC (permalink / raw)
To: tanxiaojun
Cc: yisen.zhuang, salil.mehta, huawei.libin, netdev, linux-kernel,
wangzhou1, linyunsheng
From: Tan Xiaojun <tanxiaojun@huawei.com>
Date: Wed, 4 Apr 2018 17:40:48 +0800
> When enable the config item "CONFIG_ARM64_64K_PAGES", the size of PAGE_SIZE
> is 65536(64K). But the type of length is u16, it will overflow. So change it
> to u32.
>
> Signed-off-by: Tan Xiaojun <tanxiaojun@huawei.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-04-04 15:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-04 9:40 [PATCH] net: hns3: fix length overflow when CONFIG_ARM64_64K_PAGES Tan Xiaojun
2018-04-04 15:46 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).