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]
Date:	Mon, 23 Aug 2010 18:13:39 +0200
From:	Andreas Gruenbacher <agruen@...e.de>
To:	Eric Paris <eparis@...hat.com>
Cc:	linux-kernel@...r.kernel.org, Andreas Dilger <adilger@...ger.ca>,
	Tvrtko Ursulin <tvrtko.ursulin@...hos.com>
Subject: Re: [PATCH 4/4] fanotify: drops the packed attribute from userspace event metadata

On Monday 23 August 2010 02:37:10 Eric Paris wrote:
>  #define FANOTIFY_METADATA_VERSION	1

FANOTIFY_METADATA_VERSION should be incremented, too.

>  struct fanotify_event_metadata {
>  	__u32 event_len;
>  	__u32 vers;
>  	__u64 mask;

We don't actually care if there are any holes in this structure; all we
care about is that the structure has the same alignment on 32-bit and
64-bit architectures.

Using type aligned_u64 here instead of __u64 will do the trick.

> +#ifdef __KERNEL__
> +/* see struct fanotify_event_metadata for the reason this exists */
> +struct fan_event_meta_packed {
> +	__u32 event_len;
> +	__u32 vers;
> +	__u64 mask;
> +	__s32 fd;
> +	__s32 pid;
> +} __attribute__ ((packed));

This does not add much value; the two structures can still go out of sync
A note to be careful about changes to struct fanotify_event_metadata
should really be warning enough.

Andreas
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ