Re: [patch] add epoll compat code to kernel/compat.c ...

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Heiko Carstens
Date: Sunday, February 11, 2007 - 2:47 pm

On Sun, Feb 11, 2007 at 12:15:24PM -0800, Davide Libenzi wrote:

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

?
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch] add epoll compat code to kernel/compat.c ..., Davide Libenzi, (Sun Feb 11, 1:15 pm)
Re: [patch] add epoll compat code to kernel/compat.c ..., Heiko Carstens, (Sun Feb 11, 2:47 pm)
Re: [patch] add epoll compat code to kernel/compat.c ..., Davide Libenzi, (Sun Feb 11, 4:18 pm)