Re: [PATCH] fix fanotify_mark() breakage on big endian 32bit kernel

From: John David Anglin
Date: Sun Jul 06 2014 - 11:14:12 EST


On 6-Jul-14, at 5:15 AM, Heiko Carstens wrote:

But for the CONFIG_COMPAT=n case (32bit kernel & userspace),
compat_fanotify_mark() isn't used and the fanotify_mark syscall implementation
is used directly. In that case the upper and lower 32 bits of the 64bit mask
parameter is still swapped on big endian machines and thus leads to
fanotify_mark failing with -EINVAL.

Why do you think upper and lower 32 bits are swapped on big endian machines?
At least an s390 the C ABI defines that 64 bit values are split into an
even odd register pair, where the most significant bits are in the even numbered
register.


On hppa, there is no specific rule as to which registers are used to hold 64-bit integer values
on 32-bit machines except for the first two call arguments which are passed in registers.
For example, r25 and r26 contain the first argument and the most significant bits are in r25
and the least significant bits in r26..

In GCC, we typically have an odd even register pair to hold 64-bit values as register
r0 is not usable.

The rules are different for float values.

Dave
--
John David Anglin dave.anglin@xxxxxxxx



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