lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250627170835.75c73445@kernel.org>
Date: Fri, 27 Jun 2025 17:08:35 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Chintan Vankar <c-vankar@...com>
Cc: <andrew+netdev@...n.ch>, <davem@...emloft.net>, <edumazet@...gle.com>,
 <pabeni@...hat.com>, <rogerq@...nel.org>, <horms@...nel.org>,
 <mwalle@...nel.org>, <jacob.e.keller@...el.com>, <jpanis@...libre.com>,
 <s-vadapalli@...com>, <danishanwar@...com>, <netdev@...r.kernel.org>,
 <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net v2] net: ethernet: ti: am65-cpsw-nuss: Fix skb size
 by accounting for skb_shared_info

On Thu, 26 Jun 2025 10:42:26 +0530 Chintan Vankar wrote:
> While transitioning from netdev_alloc_ip_align() to build_skb(), memory
> for the "skb_shared_info" member of an "skb" was not allocated. Fix this
> by including sizeof(skb_shared_info) in the packet length during
> allocation.
> 
> Fixes: 8acacc40f733 ("net: ethernet: ti: am65-cpsw: Add minimal XDP support")
> Signed-off-by: Chintan Vankar <c-vankar@...com>
> ---
> 
> This patch is based on the commit '9caca6ac0e26' of origin/main branch of
> Linux-net repository.
> 
> Link to v1:
> https://lore.kernel.org/r/598f9e77-8212-426b-97ab-427cb8bd4910@ti.com/
> 
> Changes from v1 to v2:
> - Updated commit message and code change as suggested by Siddharth
>   Vadapalli.
> 
>  drivers/net/ethernet/ti/am65-cpsw-nuss.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
> index f20d1ff192ef..67fef2ea4900 100644
> --- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c
> +++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
> @@ -856,7 +856,7 @@ static struct sk_buff *am65_cpsw_build_skb(void *page_addr,
>  {
>  	struct sk_buff *skb;
>  
> -	len += AM65_CPSW_HEADROOM;
> +	len += AM65_CPSW_HEADROOM + SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
>  
>  	skb = build_skb(page_addr, len);

Looks to me like each packet is placed in a full page, isn't it?
If that's the case the correct value for "buffer size" is PAGE_SIZE
-- 
pw-bot: cr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ