OpenCloudOS-Kernel/arch/arm64
Thomas Huth 2def950c63 KVM: arm64: Limit length in kvm_vm_ioctl_mte_copy_tags() to INT_MAX
In case of success, this function returns the amount of handled bytes.
However, this does not work for large values: The function is called
from kvm_arch_vm_ioctl() (which still returns a long), which in turn
is called from kvm_vm_ioctl() in virt/kvm/kvm_main.c. And that function
stores the return value in an "int r" variable. So the upper 32-bits
of the "long" return value are lost there.

KVM ioctl functions should only return "int" values, so let's limit
the amount of bytes that can be requested here to INT_MAX to avoid
the problem with the truncated return value. We can then also change
the return type of the function to "int" to make it clearer that it
is not possible to return a "long" here.

Fixes: f0376edb1d ("KVM: arm64: Add ioctl to fetch/store tags in a guest")
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Gavin Shan <gshan@redhat.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Message-Id: <20230208140105.655814-5-thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2023-03-16 10:18:06 -04:00
..
boot We have one small patch to the clk core this time around. It fixes a corner 2023-02-25 15:16:23 -08:00
configs ARM: SoC fixes for 6.3, part 1 2023-02-27 10:09:40 -08:00
crypto crypto: arm64/sm4-gcm - Fix possible crash in GCM cryption 2023-02-10 17:20:19 +08:00
hyperv hyperv: simplify and rename generate_guest_id 2022-09-28 13:36:56 +00:00
include KVM: arm64: Limit length in kvm_vm_ioctl_mte_copy_tags() to INT_MAX 2023-03-16 10:18:06 -04:00
kernel arm64 fixes: 2023-03-02 14:57:53 -08:00
kvm KVM: arm64: Limit length in kvm_vm_ioctl_mte_copy_tags() to INT_MAX 2023-03-16 10:18:06 -04:00
lib Merge branch 'for-next/sysregs' into for-next/core 2022-12-06 11:32:25 +00:00
mm arm64 fixes: 2023-03-02 14:57:53 -08:00
net bpf: Remove prog->active check for bpf_lsm and bpf_iter 2022-10-25 23:11:46 -07:00
tools ARM: 2023-02-25 11:30:21 -08:00
xen
Kbuild
Kconfig arm64 fixes: 2023-03-02 14:57:53 -08:00
Kconfig.debug
Kconfig.platforms arm64 updates for 6.3: 2023-02-21 15:27:48 -08:00
Makefile arm64 updates for 6.3: 2023-02-21 15:27:48 -08:00