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] [day] [month] [year] [list]
Date:   Thu, 21 Oct 2021 12:44:22 +0200
From:   Paolo Abeni <pabeni@...hat.com>
To:     Jianguo Wu <wujianguo106@....com>, netdev@...r.kernel.org
Cc:     willemb@...gle.com, davem@...emloft.net, jchapman@...alix.com
Subject: Re: [PATCH] udp: reduce padding field unused to 1-byte in struct
 udp_sock

Hello,

On Thu, 2021-10-21 at 18:27 +0800, Jianguo Wu wrote:
> From: Jianguo Wu <wujianguo@...natelecom.cn>
> 
> In commit 342f0234c71b ("[UDP]: Introduce UDP encapsulation type for L2TP"),
> it includes a padding field(__u8 unused[3]) to put the new encap_rcv field
> on a 4-byte boundary.
> 
> But commit bec1f6f69736 ("udp: generate gso with UDP_SEGMENT") and a new 2-bytes
> field gso_size, so we should cut 2-bytes padding.
> 
> Fixes: bec1f6f69736 udp: generate gso with UDP_SEGMENT)
> Signed-off-by: Jianguo Wu <wujianguo@...natelecom.cn>
> ---
>  include/linux/udp.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/udp.h b/include/linux/udp.h
> index ae66dad..c1b4e5b 100644
> --- a/include/linux/udp.h
> +++ b/include/linux/udp.h
> @@ -70,7 +70,7 @@ struct udp_sock {
>  #define UDPLITE_SEND_CC  0x2  		/* set via udplite setsockopt         */
>  #define UDPLITE_RECV_CC  0x4		/* set via udplite setsocktopt        */
>  	__u8		 pcflag;        /* marks socket as UDP-Lite if > 0    */
> -	__u8		 unused[3];
> +	__u8		 unused;
>  	/*
>  	 * For encapsulation sockets.
>  	 */

Note that after this patch we will have a 4 bytes hole on 64bits
arches.

My personal take is that we can as well drop the 'unused' field:
someone intentioned to modify the 'udp_sock' struct should have a look
at the binary layout anyway.

Cheers,

Paolo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ