mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-12-29 17:25:38 +00:00
fs/proc/kcore.c: Clear ret value in read_kcore_iter after successful iov_iter_zero
commit088f294609
upstream. If iov_iter_zero succeeds after failed copy_from_kernel_nofault, we need to reset the ret value to zero otherwise it will be returned as final return value of read_kcore_iter. This fixes objdump -d dump over /proc/kcore for me. Cc: stable@vger.kernel.org Cc: Alexander Gordeev <agordeev@linux.ibm.com> Fixes:3d5854d75e
("fs/proc/kcore.c: allow translation of physical memory addresses") Signed-off-by: Jiri Olsa <jolsa@kernel.org> Link: https://lore.kernel.org/r/20241121231118.3212000-1-jolsa@kernel.org Acked-by: Alexander Gordeev <agordeev@linux.ibm.com> Signed-off-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
d0c2cb03ab
commit
e8ceff4995
@ -585,6 +585,7 @@ read_kcore_iter(struct kiocb *iocb, struct iov_iter *iter)
|
||||
ret = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
ret = 0;
|
||||
/*
|
||||
* We know the bounce buffer is safe to copy from, so
|
||||
* use _copy_to_iter() directly.
|
||||
|
Loading…
Reference in New Issue
Block a user