[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z0BDcVpUjtbWmYTv@li-008a6a4c-3549-11b2-a85c-c5cc2836eea2.ibm.com>
Date: Fri, 22 Nov 2024 09:40:17 +0100
From: Alexander Gordeev <agordeev@...ux.ibm.com>
To: Jiri Olsa <jolsa@...nel.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Christian Brauner <brauner@...nel.org>, stable@...r.kernel.org,
linux-kernel@...r.kernel.org, Heiko Carstens <hca@...ux.ibm.com>,
linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH] fs/proc/kcore.c: Clear ret value in read_kcore_iter
after successful iov_iter_zero
On Fri, Nov 22, 2024 at 12:11:18AM +0100, Jiri Olsa wrote:
> 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@...r.kernel.org
> Cc: Alexander Gordeev <agordeev@...ux.ibm.com>
> Fixes: 3d5854d75e31 ("fs/proc/kcore.c: allow translation of physical memory addresses")
> Signed-off-by: Jiri Olsa <jolsa@...nel.org>
> ---
> fs/proc/kcore.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c
> index 51446c59388f..c82c408e573e 100644
> --- a/fs/proc/kcore.c
> +++ b/fs/proc/kcore.c
> @@ -600,6 +600,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.
Acked-by: Alexander Gordeev <agordeev@...ux.ibm.com>
Thank you, Jiri!
Powered by blists - more mailing lists