Skip to content

Commit b1ddf39

Browse files
licliuBarathrum-Liu
authored andcommitted
fs/proc/kcore.c: Clear ret value in read_kcore_iter after successful iov_iter_zero
JIRA: https://issues.redhat.com/browse/RHEL-83630 commit 088f294 Author: Jiri Olsa <jolsa@kernel.org> Date: Fri Nov 22 00:11:18 2024 +0100 fs/proc/kcore.c: Clear ret value in read_kcore_iter after successful iov_iter_zero 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: 3d5854d ("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: Lichen Liu <lichliu@redhat.com>
1 parent 36e9c0b commit b1ddf39

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/proc/kcore.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,7 @@ static ssize_t read_kcore_iter(struct kiocb *iocb, struct iov_iter *iter)
600600
ret = -EFAULT;
601601
goto out;
602602
}
603+
ret = 0;
603604
/*
604605
* We know the bounce buffer is safe to copy from, so
605606
* use _copy_to_iter() directly.

0 commit comments

Comments
 (0)