]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
arm64: compat Fix siginfo_t -> compat_siginfo_t conversion on big endian
authorCatalin Marinas <catalin.marinas@arm.com>
Mon, 23 Feb 2015 15:13:40 +0000 (15:13 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 27 Feb 2015 18:05:56 +0000 (18:05 +0000)
commit9d42d48a342aee208c1154696196497fdc556bbf
tree6984daeb050a874f4e4e96eb1093c2ed2e3de69f
parenta1e50a82256ed2f1312e70c52a84323e2e378f49
arm64: compat Fix siginfo_t -> compat_siginfo_t conversion on big endian

The native (64-bit) sigval_t union contains sival_int (32-bit) and
sival_ptr (64-bit). When a compat application invokes a syscall that
takes a sigval_t value (as part of a larger structure, e.g.
compat_sys_mq_notify, compat_sys_timer_create), the compat_sigval_t
union is converted to the native sigval_t with sival_int overlapping
with either the least or the most significant half of sival_ptr,
depending on endianness. When the corresponding signal is delivered to a
compat application, on big endian the current (compat_uptr_t)sival_ptr
cast always returns 0 since sival_int corresponds to the top part of
sival_ptr. This patch fixes copy_siginfo_to_user32() so that sival_int
is copied to the compat_siginfo_t structure.

Cc: <stable@vger.kernel.org>
Reported-by: Bamvor Jian Zhang <bamvor.zhangjian@huawei.com>
Tested-by: Bamvor Jian Zhang <bamvor.zhangjian@huawei.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/kernel/signal32.c