xen: Make struct privcmd_irqfd's layout architecture independent
authorViresh Kumar <viresh.kumar@linaro.org>
Mon, 16 Oct 2023 07:11:24 +0000 (12:41 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Nov 2023 10:59:12 +0000 (11:59 +0100)
commit0d99e8c816adc6ec412910fa3912f01db3ffba40
tree4725753d909d3b931a32ebabc94636d0dcc1f822
parentda9de139a159dba665be29352d91e9cd7ec8391e
xen: Make struct privcmd_irqfd's layout architecture independent

[ Upstream commit 8dd765a5d769c521d73931850d1c8708fbc490cb ]

Using indirect pointers in an ioctl command argument means that the
layout is architecture specific, in particular we can't use the same one
from 32-bit compat tasks. The general recommendation is to have __u64
members and use u64_to_user_ptr() to access it from the kernel if we are
unable to avoid the pointers altogether.

Fixes: f8941e6c4c71 ("xen: privcmd: Add support for irqfd")
Reported-by: Arnd Bergmann <arnd@kernel.org>
Closes: https://lore.kernel.org/all/268a2031-63b8-4c7d-b1e5-8ab83ca80b4a@app.fastmail.com/
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Juergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/r/a4ef0d4a68fc858b34a81fd3f9877d9b6898eb77.1697439990.git.viresh.kumar@linaro.org
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/xen/privcmd.c
include/uapi/xen/privcmd.h