Skip to content

Commit 14c28b1

Browse files
olsajiritamaralyne
authored andcommitted
fs/proc/kcore.c: Clear ret value in read_kcore_iter after successful iov_iter_zero
commit 088f294609d8f8816dc316681aef2eb61982e0da 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: [email protected] Cc: Alexander Gordeev <[email protected]> Fixes: 3d5854d75e31 ("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]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 559dd03 commit 14c28b1

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
@@ -585,6 +585,7 @@ read_kcore_iter(struct kiocb *iocb, struct iov_iter *iter)
585585
ret = -EFAULT;
586586
goto out;
587587
}
588+
ret = 0;
588589
/*
589590
* We know the bounce buffer is safe to copy from, so
590591
* use _copy_to_iter() directly.

0 commit comments

Comments
 (0)