linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Muchun Song <songmuchun@bytedance.com>
To: zhenwei pi <pizhenwei@bytedance.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	 Linux Memory Management List <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>,
	 Matthew Wilcox <willy@infradead.org>
Subject: Re: [PATCH] mm: fix kernel NULL pointer dereference in page_vma_mapped_walk
Date: Thu, 7 Apr 2022 17:31:52 +0800	[thread overview]
Message-ID: <CAMZfGtXr6rnjb4QR8Tce-WcTEWTDTwOjnCGDYV2NFooXDGxzyA@mail.gmail.com> (raw)
In-Reply-To: <20220407064008.71869-1-pizhenwei@bytedance.com>

On Thu, Apr 7, 2022 at 2:43 PM zhenwei pi <pizhenwei@bytedance.com> wrote:
>
> size_to_hstate(4K) returns NULL pointer, this leads kernel BUG in
> function page_vma_mapped_walk.
>
>  BUG: kernel NULL pointer dereference, address: 0000000000000028
>  #PF: supervisor read access in kernel mode
>  #PF: error_code(0x0000) - not-present page
>  PGD 102a8b067 P4D 102a8b067 PUD 102a88067 PMD 0
>  Oops: 0000 [#1] PREEMPT SMP NOPTI
>  CPU: 0 PID: 16 Comm: kworker/0:1 Kdump: loaded Tainted: G   M        E     5.18.0-rc1.bm.1-amd64 #3
>  Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 04/01/2014
>  Workqueue: events mce_gen_pool_process
>  RIP: 0010:page_vma_mapped_walk+0x4aa/0x850
>  Code: 8b 77 20 48 89 c2 4c 89 ef e8 b2 c4 02 00 49 89 c4 48 89 43 30 48 85 c0 0f 84 a7 fd ff ff 48 89 ef e8 fa 9c 02 00 49 8d 7d 74 <83> 78 28 09 0f 84 1e 03 00 00 48 89 7b 38 e8 a3 cc 60 00 48 89 df
>  RSP: 0018:ffffc9000008bc58 EFLAGS: 00010246
>  RAX: 0000000000000000 RBX: ffffc9000008bca0 RCX: 0000000000000009
>  RDX: 0000000000200000 RSI: ffffffff82b4a460 RDI: ffff88810ac5c3f4
>  RBP: 0000000000001000 R08: 0000000000001000 R09: 0000000000000000
>  R10: 0000000000000000 R11: 0000000000000007 R12: ffff888072cafd10
>  R13: ffff88810ac5c380 R14: ffff888101afc440 R15: 0000000000000000
>  FS:  0000000000000000(0000) GS:ffff88823fc00000(0000) knlGS:0000000000000000
>  CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
>  CR2: 0000000000000028 CR3: 0000000106ca2002 CR4: 0000000000772ef0
>  PKRU: 55555554
>  Call Trace:
>   <TASK>
>   ? preempt_count_add+0x68/0xa0
>   page_mapped_in_vma+0xb4/0x230
>   collect_procs.part.35+0x11b/0x440
>   hwpoison_user_mappings+0x165/0x5b0
>   ? zone_pcp_enable+0x16/0x30
>   memory_failure+0xbea/0xd90
>   ? _printk+0x58/0x6f
>   uc_decode_notifier+0x4b/0xd0
>   blocking_notifier_call_chain+0x60/0x90
>   mce_gen_pool_process+0x3c/0x60
>   process_one_work+0x1c2/0x390
>   ? process_one_work+0x390/0x390
>   worker_thread+0x30/0x360
>   ? process_one_work+0x390/0x390
>   kthread+0xe6/0x110
>   ? kthread_complete_and_exit+0x20/0x20
>   ret_from_fork+0x1f/0x30
>   </TASK>
>
> Fixes: 2aff7a4755bed ("mm: Convert page_vma_mapped_walk to work on PFNs")
> Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>

Good catch.

Reviewed-by: Muchun Song <songmuchun@bytedance.com>

Thanks.


  reply	other threads:[~2022-04-07  9:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-07  6:40 zhenwei pi
2022-04-07  9:31 ` Muchun Song [this message]
2022-04-07 13:54 ` Matthew Wilcox
2022-04-07 14:17   ` Matthew Wilcox
2022-04-08  1:17     ` zhenwei pi

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=CAMZfGtXr6rnjb4QR8Tce-WcTEWTDTwOjnCGDYV2NFooXDGxzyA@mail.gmail.com \
    --to=songmuchun@bytedance.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=pizhenwei@bytedance.com \
    --cc=willy@infradead.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