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: <20070211214734.GB8631@osiris.ibm.com>
Date:	Sun, 11 Feb 2007 22:47:34 +0100
From:	Heiko Carstens <heiko.carstens@...ibm.com>
To:	Davide Libenzi <davidel@...ilserver.org>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	David Woodhouse <dwmw2@...radead.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Martin Schwidefsky <schwidefsky@...ibm.com>
Subject: Re: [patch] add epoll compat code to kernel/compat.c ...

On Sun, Feb 11, 2007 at 12:15:24PM -0800, Davide Libenzi wrote:
> 
> Add epoll compat_ code to kernel/compat.c. IA64 and ARM-OABI are currently 
> using their own version of epoll compat_ code and they could probably wire 
> to the new common code. Patch over 2.6.20.
> + * epoll (fs/eventpoll.c) compat bits follow ...
> + */
> +struct compat_epoll_event {
> +	u32 events;
> +	u32 data[2];
> +};
> +
>[...]
> +
> + * We need the compat layer over the epoll_event structure, only if the offset
> + * of the __u64 data member is not 4 (size of the events member that precedes the
> + * data one).
> + */
> +#define EPOLL_NEED_EVENT_COMPAT() (offsetof(struct epoll_event, data) != 4)

With

struct epoll_event {
        __u32 events;
        __u64 data;
};

this won't work on s390. offsetof(struct epoll_event, data) is 8 on both
31 bit and 64 bit. So it will do the conversion and corrupt all the data.
Actually we would only need the compat conversion for the sigset_t stuff.

But then again I thought most 32 bit architectures would add a 4 byte
pad between events and data, no?

Maybe we need some arch dependent struct compat_epoll_event and have
something like
#define EPOLL_NEED_EVENT_COMPAT() \
(offsetof(struct epoll_event, data) != offsetof(struct compat_epoll_event, data))

?
-
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