Skip to content

Commit 088f294

Browse files
olsajiribrauner
authored andcommitted
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: [email protected] Cc: Alexander Gordeev <[email protected]> Fixes: 3d5854d ("fs/proc/kcore.c: allow translation of physical memory addresses") Signed-off-by: Jiri Olsa <[email protected]> Link: https://lore.kernel.org/r/[email protected] Acked-by: Alexander Gordeev <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent 3e53601 commit 088f294

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)