Linux-RISC-V Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Mikhalitsyn <alex@amutable.com>
To: Christian Brauner <brauner@kernel.org>, linux-fsdevel@vger.kernel.org
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Breno Leitao <leitao@debian.org>, Chris Mason <mason@kernel.org>,
	Thomas Gleixner <tglx@kernel.org>,
	x86@kernel.org, kexec@lists.infradead.org,
	 linuxppc-dev@lists.ozlabs.org,
	linux-arm-kernel@lists.infradead.org,
	 linux-riscv@lists.infradead.org, loongarch@lists.linux.dev,
	 linux-mips@vger.kernel.org, linux-sh@vger.kernel.org,
	 linux-kernel@vger.kernel.org,
	David Hildenbrand <david@kernel.org>,
	 stable@vger.kernel.org
Subject: Re: [PATCH RFC 2/4] sh/crash_dump: check ioremap() in copy_oldmem_page()
Date: Mon, 16 Nov 2026 08:58:46 +0100	[thread overview]
Message-ID: <aa32167cd3865049bfe0281b8b651c47f5e1c05d.camel@amutable.com> (raw)
In-Reply-To: <20261112-work-procfs-oldmem-v1-2-ecdcafd99265@kernel.org>

On Thu, 2026-11-12 at 17:37 +0100, Christian Brauner wrote:
> copy_oldmem_page() maps a page of the old kernel with ioremap() and
> copies from it without checking whether the mapping worked. If it
> didn't, the copy reads from an offset into the NULL page.
> 
> Return -ENOMEM like the other architectures do. read_from_oldmem()
> turns
> that into -EFAULT like any other short copy.
> 
> Fixes: 4d5ade5b29c6 ("sh: kdump support.")
> Cc: stable@vger.kernel.org
> Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>

Reviewed-by: Alexander Mikhalitsyn <alex@amutable.com>

> ---
>  arch/sh/kernel/crash_dump.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/arch/sh/kernel/crash_dump.c
> b/arch/sh/kernel/crash_dump.c
> index 19ce6a950aaca..85c0e58f1a59f 100644
> --- a/arch/sh/kernel/crash_dump.c
> +++ b/arch/sh/kernel/crash_dump.c
> @@ -20,6 +20,9 @@ ssize_t copy_oldmem_page(struct iov_iter *iter,
> unsigned long pfn,
>  		return 0;
>  
>  	vaddr = ioremap(pfn << PAGE_SHIFT, PAGE_SIZE);
> +	if (!vaddr)
> +		return -ENOMEM;
> +
>  	csize = copy_to_iter(vaddr + offset, csize, iter);
>  	iounmap(vaddr);
>  

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  parent reply	other threads:[~2026-11-16  7:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-12 16:37 [PATCH RFC 0/4] crash_dump: recover from machine checks in copy_oldmem_page() Christian Brauner
2026-11-12 16:37 ` [PATCH RFC 1/4] powerpc/crash_dump: check ioremap_cache() " Christian Brauner
2026-11-12 19:10   ` Geert Uytterhoeven
2026-11-16  7:58   ` Alexander Mikhalitsyn
2026-11-12 16:37 ` [PATCH RFC 2/4] sh/crash_dump: check ioremap() " Christian Brauner
2026-11-12 19:07   ` Geert Uytterhoeven
2026-11-16  7:58   ` Alexander Mikhalitsyn [this message]
2026-11-12 16:37 ` [PATCH RFC 3/4] crash_dump: recover from a machine check " Christian Brauner
2026-11-13  9:38   ` Breno Leitao
2026-11-16  7:59   ` Alexander Mikhalitsyn
2026-11-12 16:37 ` [PATCH RFC 4/4] crash_dump: use copy_oldmem_to_iter() everywhere Christian Brauner
2026-11-16  8:01   ` Alexander Mikhalitsyn
2026-11-12 16:40 ` [PATCH RFC 0/4] crash_dump: recover from machine checks in copy_oldmem_page() Christian Brauner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aa32167cd3865049bfe0281b8b651c47f5e1c05d.camel@amutable.com \
    --to=alex@amutable.com \
    --cc=brauner@kernel.org \
    --cc=david@kernel.org \
    --cc=kexec@lists.infradead.org \
    --cc=leitao@debian.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=loongarch@lists.linux.dev \
    --cc=mason@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tglx@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox