linux/arch/powerpc
Ritesh Harjani (IBM) d48654bd8b pseries/papr-hvpipe: Fix the usage of copy_to_user()
copy_to_user() return bytes_not_copied to the user buffer. If there was
an error writing bytes into the user buffer, i.e. if copy_to_user
returns a non-zero value, then we should simply return -EFAULT from the
->read() call.

Otherwise, in the non-patched version, we may end up mixing
"bytes_not_copied + bytes_copied (HVPIPE_HDR_LEN)" as the return value
to the user in ->read() call

Also let's make sure we clear the hvpipe_status flag, if we have
consumed the hvpipe msg by making the rtas call. ret = -EFAULT means
copy_to_user has failed but that still means that the msg was read from
the hvpipe, hence for both cases, success & -EFAULT, we should clear the
HVPIPE_MSG_AVAILABLE flag in hvpipe_status.

Cc: stable@vger.kernel.org
Fixes: cebdb522fd ("powerpc/pseries: Receive payload with ibm,receive-hvpipe-msg RTAS")
Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/8fda3212a1ad48879c174e92f67472d9b9f1c3b7.1777606826.git.ritesh.list@gmail.com
History 2026-05-06 07:30:24 +05:30
..
boot powerpc updates for 7.1 2026-04-14 17:10:15 -07:00
configs Delete some obsolete networking code 2026-04-24 09:41:58 -07:00
crypto lib/crypto: powerpc/ghash: Migrate optimized code into library 2026-03-23 16:44:29 -07:00
include s390 updates for 7.1 merge window 2026-04-22 11:13:45 -07:00
kernel memblock: updates for 7.0-rc1 2026-04-18 11:29:14 -07:00
kexec mm.git review status for linus..mm-nonmm-stable 2026-04-16 20:11:56 -07:00
kvm KVM: PPC: remove hugetlb.h inclusion 2026-04-05 13:53:23 -07:00
lib mm.git review status for linus..mm-nonmm-stable 2026-04-16 20:11:56 -07:00
math-emu powerpc/math-emu: Inhibit W=1 warnings 2022-09-08 11:11:18 +10:00
mm mm.git review status for linus..mm-stable 2026-04-15 12:59:16 -07:00
net bpf: Pass bpf_verifier_env to JIT 2026-04-16 07:03:40 -07:00
perf powerpc, perf: Check that current->mm is alive before getting user callchain 2026-03-12 11:02:55 +05:30
platforms pseries/papr-hvpipe: Fix the usage of copy_to_user() 2026-05-06 07:30:24 +05:30
purgatory Makefile: remove redundant tool coverage variables 2024-05-14 23:35:48 +09:00
sysdev powerpc updates for 7.1 2026-04-14 17:10:15 -07:00
tools powerpc64/ftrace: fix OOL stub count with clang 2026-03-07 16:02:25 +05:30
xmon powerpc/xmon: replace sizeof calculations with ARRAY_SIZE macro 2025-09-01 13:40:46 +05:30
Kbuild powerpc64/ftrace: Move ftrace sequence out of line 2024-10-31 11:00:54 +11:00
Kconfig integrity-v7.1 2026-04-17 15:42:01 -07:00
Kconfig.debug powerpc: Remove UDBG_RTAS_CONSOLE 2025-02-26 21:15:09 +05:30
Makefile kbuild: Add missing $(objtree) prefix to powerpc crtsavres.o artifact 2025-09-01 13:41:57 +05:30
Makefile.postlink powerpc/ftrace: Add a postlink script to validate function tracer 2024-10-31 11:00:54 +11:00