[lkml]   [2015]   [Feb]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] compat: Fix endian issue in union sigval
On 2/14/2015 6:22 AM, Catalin Marinas wrote:
> 1. user populates sival_int compat_sigevent and invokes
> compat_sys_mq_notify()
> 2. kernel get_compat_sigevent() copies compat_sigevent into the native
> sigevent. compat and native sival_int are the same, no problem so
> far. The other half of 64-bit sival_ptr is zeroed by a memset in this
> function (this other half can be top or bottom, depending on
> endianness)
> 3. signal is about to be delivered to user via arch code. The
> compat_ptr(from->si_ptr) conversion always takes the least
> significant part of the native si_ptr. On big endian 64-bit, this is
> zero because get_compat_sigevent() populated the top part of si_ptr
> with si_int.

Thanks, that makes sense. I was missing the fact that the conversion
issue was actually around the in-kernel 64-bit version of the structure.
Using si_int consistently does seem like it should do the right thing;
I'll post a patch for tilegx32 big-endian to do the right thing here.

Chris Metcalf, EZChip Semiconductor

 \ /
  Last update: 2015-02-21 08:41    [W:0.076 / U:2.428 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site