linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: <robin.kuo@mediatek.com>
Cc: Chris Li <chrisl@kernel.org>, Kairui Song <kasong@tencent.com>,
	Kemeng Shi <shikemeng@huaweicloud.com>,
	Nhat Pham <nphamcs@gmail.com>, Baoquan He <bhe@redhat.com>,
	Barry Song <baohua@kernel.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	<wsd_upstream@mediatek.com>, <casper.li@mediatek.com>,
	<chinwen.chang@mediatek.com>, <Andrew.Yang@mediatek.com>,
	<Qun-wei.Lin@mediatek.com>, <oliver.sang@intel.com>,
	<linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-mediatek@lists.infradead.org>
Subject: Re: [PATCH 1/1] Restore swap_space attr aviod krn panic
Date: Wed, 14 Jan 2026 17:27:41 -0800	[thread overview]
Message-ID: <20260114172741.b8b6cb9aae39a5ae7a199eed@linux-foundation.org> (raw)
In-Reply-To: <20260115001405.3513440-1-robin.kuo@mediatek.com>

On Thu, 15 Jan 2026 08:13:43 +0800 <robin.kuo@mediatek.com> wrote:

> From: "robin.kuo" <robin.kuo@mediatek.com>
> 
> Restore swap_space attr avoid krn panic

Thanks, and welcome to Linux ;)

> Commit 8b47299a411a ('mm, swap: mark swap address space ro and add
> context debug check') made the swap address space read-only.
> It may lead to kernel panic if arch_prepare_to_swap returns a failure 
> under heavy memory pressure as follows,
> 
> el1_abort+0x40/0x64
> el1h_64_sync_handler+0x48/0xcc
> el1h_64_sync+0x84/0x88
> errseq_set+0x4c/0xb8 (P)
> __filemap_set_wb_err+0x20/0xd0
> shrink_folio_list+0xc20/0x11cc
> evict_folios+0x1520/0x1be4
> try_to_shrink_lruvec+0x27c/0x3dc
> shrink_one+0x9c/0x228
> shrink_node+0xb3c/0xeac
> do_try_to_free_pages+0x170/0x4f0
> try_to_free_pages+0x334/0x534
> __alloc_pages_direct_reclaim+0x90/0x158
> __alloc_pages_slowpath+0x334/0x588
> __alloc_frozen_pages_noprof+0x224/0x2fc
> __folio_alloc_noprof+0x14/0x64
> vma_alloc_zeroed_movable_folio+0x34/0x44
> do_pte_missing+0xad4/0x1040
> handle_mm_fault+0x4a4/0x790
> do_page_fault+0x288/0x5f8
> do_translation_fault+0x38/0x54
> do_mem_abort+0x54/0xa8
> 
> Restore swap address space as not ro to avoid the panic.

Well damn.  We have checking tools which should be able to detect this:
we referenced something which was dropped from kernel memory in the
calling function's context.  i don't know who I should report this to.

I shall add cc:stable to this patch, to help ensure that it is
backported into 6.18.x.




      reply	other threads:[~2026-01-15  1:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-15  0:13 robin.kuo
2026-01-15  1:27 ` Andrew Morton [this message]

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=20260114172741.b8b6cb9aae39a5ae7a199eed@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=Andrew.Yang@mediatek.com \
    --cc=Qun-wei.Lin@mediatek.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=baohua@kernel.org \
    --cc=bhe@redhat.com \
    --cc=casper.li@mediatek.com \
    --cc=chinwen.chang@mediatek.com \
    --cc=chrisl@kernel.org \
    --cc=kasong@tencent.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-mm@kvack.org \
    --cc=matthias.bgg@gmail.com \
    --cc=nphamcs@gmail.com \
    --cc=oliver.sang@intel.com \
    --cc=robin.kuo@mediatek.com \
    --cc=shikemeng@huaweicloud.com \
    --cc=wsd_upstream@mediatek.com \
    /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