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: <52CC851B.2060401@cogentembedded.com>
Date:	Wed, 08 Jan 2014 02:52:11 +0400
From:	Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To:	Fan Du <fan.du@...driver.com>, steffen.klassert@...unet.com
CC:	davem@...emloft.net, stephen@...workplumber.org,
	dev@...ts.strongswan.org, netdev@...r.kernel.org
Subject: Re: [PATCH net-next 1/2] include/uapi/linux/xfrm.h: Pack struct xfrm_userpolicy_info

Hello.

On 07-01-2014 10:48, Fan Du wrote:

> Otherwise 64bits kernel has sizeof(struct xfrm_userpolicy_info) 168 bytes,
> while 32bits compiled iproute2 see the same structure as 164 bytes, which
> leading deficit xfrm policy, in turn broken IPsec connectivity.

> Fix this by packing the structure.

    This will force byte-by-byte access to all members on some arches like ARM...

> Signed-off-by: Fan Du <fan.du@...driver.com>
> ---
>   include/uapi/linux/xfrm.h |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

> diff --git a/include/uapi/linux/xfrm.h b/include/uapi/linux/xfrm.h
> index a8cd6a4..470bfae 100644
> --- a/include/uapi/linux/xfrm.h
> +++ b/include/uapi/linux/xfrm.h
> @@ -405,7 +405,7 @@ struct xfrm_userpolicy_info {
>   	/* Automatically expand selector to include matching ICMP payloads. */
>   #define XFRM_POLICY_ICMP	2
>   	__u8				share;
> -};
> +} __attribute__((packed));

    Please use the __packed macro instead. I guess you haven't run checkpatch.pl?

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ