diff options
| author | Jiri Olsa <jolsa@kernel.org> | 2024-11-22 02:11:18 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-12-09 12:33:07 +0300 |
| commit | 6868deee4a6bb8d324e883e2f540aaa33499a0f9 (patch) | |
| tree | aa5ce9dc1d4480da12bcecc762f7f2ff176f8537 /fs/proc | |
| parent | b50b631d8fceb9221e3b1dde51efc35e9cd52a94 (diff) | |
| download | linux-6868deee4a6bb8d324e883e2f540aaa33499a0f9.tar.xz | |
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: stable@vger.kernel.org
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Fixes: 3d5854d75e31 ("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>
Diffstat (limited to 'fs/proc')
| -rw-r--r-- | fs/proc/kcore.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c index 0a91f3538459..1127457d0fcb 100644 --- a/fs/proc/kcore.c +++ b/fs/proc/kcore.c @@ -599,6 +599,7 @@ static ssize_t 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. |
