All of lore.kernel.org
 help / color / mirror / Atom feed
From: SeongJae Park <sj@kernel.org>
To: Liam Howlett <liam.howlett@oracle.com>
Cc: "maple-tree@lists.infradead.org" <maple-tree@lists.infradead.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH v2 22/44] mmap: Pass through vmi iterator to __split_vma()
Date: Sat,  7 Jan 2023 02:01:26 +0000	[thread overview]
Message-ID: <20230107020126.1627-1-sj@kernel.org> (raw)
In-Reply-To: <20230105191517.3099082-23-Liam.Howlett@oracle.com>

Hello Liam,


I found 'make install' mm-unstable kernel fails from initramfs stage with
'not a dynamic executable' message.  I confirmed the issue is not reproducible
before your patchset[1] but after the series[2].

I tried to bisect, but on a commit[3] middle of mm-unstable tree which this
patch is applied, I get below error while booting.  Do you have an idea?

[    2.118502] BUG: kernel NULL pointer dereference, address: 0000000000000078
[    2.121516] #PF: supervisor read access in kernel mode
[    2.121576] #PF: error_code(0x0000) - not-present page
[    2.121576] PGD 0 P4D 0
[    2.121576] Oops: 0000 [#1] PREEMPT SMP PTI
[    2.121576] CPU: 2 PID: 237 Comm: modprobe Not tainted 6.2.0-rc1+ #18
[    2.121576] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.0-0-gd239552ce722-pr4
[    2.121576] RIP: 0010:mas_wr_walk (lib/maple_tree.c:1401 lib/maple_tree.c:2259 lib/maple_tree.c:3732 lib/maple_tree.c:3757)
[ 2.121576] Code: 00 48 8b 51 18 30 d2 48 89 53 08 83 f8 02 0f 87 64 01 00 00 4c 8d 42 08 0f b6 80 e68

Code starting with the faulting instruction
===========================================
   0:   00 48 8b                add    %cl,-0x75(%rax)
   3:   51                      push   %rcx
   4:   18 30                   sbb    %dh,(%rax)
   6:   d2 48 89                rorb   %cl,-0x77(%rax)
   9:   53                      push   %rbx
   a:   08 83 f8 02 0f 87       or     %al,-0x78f0fd08(%rbx)
  10:   64 01 00                add    %eax,%fs:(%rax)
  13:   00 4c 8d 42             add    %cl,0x42(%rbp,%rcx,4)
  17:   08 0f                   or     %cl,(%rdi)
  19:   b6 80                   mov    $0x80,%dh
  1b:   68                      .byte 0x68
[    2.121576] RSP: 0018:ffffa5190119fc28 EFLAGS: 00010246
[    2.121576] RAX: 000000000000000f RBX: ffffa5190119fc78 RCX: ffffa5190119fd60
[    2.121576] RDX: 0000000000000000 RSI: 000000000000000e RDI: 000000000000000e
[    2.121576] RBP: ffffa5190119fc38 R08: 0000000000000008 R09: 0000000000000001
[    2.121576] R10: ffff95f5c3435300 R11: ffff95f5c3434c48 R12: ffffa5190119fd60
[    2.121576] R13: ffff95f5c9a26880 R14: ffff95f5c3433690 R15: 0000000000100073
[    2.121576] FS:  0000000000000000(0000) GS:ffff9613fd480000(0000) knlGS:0000000000000000
[    2.121576] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    2.121576] CR2: 0000000000000078 CR3: 0000000103430000 CR4: 00000000000006e0
[    2.121576] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[    2.121576] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[    2.121576] Call Trace:
[    2.121576]  <TASK>
[    2.121576] mas_wr_store_entry (lib/maple_tree.c:4382)
[    2.121576] mas_store_prealloc (lib/maple_tree.c:249 lib/maple_tree.c:5706)
[    2.121576] mmap_region (mm/mmap.c:2808)
[    2.121576] do_mmap (mm/mmap.c:1506)
[    2.121576] ? security_mmap_file (security/security.c:1670)
[    2.121576] vm_mmap_pgoff (mm/util.c:542)
[    2.121576] ksys_mmap_pgoff (mm/mmap.c:1552)
[    2.121576] __x64_sys_mmap (arch/x86/kernel/sys_x86_64.c:86)
[    2.121576] do_syscall_64 (arch/x86/entry/common.c:50 arch/x86/entry/common.c:80)
[    2.121576] entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:120)
[    2.121576] RIP: 0033:0x7ff228f7a186
[ 2.121576] Code: 1f 44 00 00 f3 0f 1e fa 41 f7 c1 ff 0f 00 00 75 2b 55 48 89 fd 53 89 cb 48 85 ff 74f

Code starting with the faulting instruction
===========================================
   0:   1f                      (bad)
   1:   44 00 00                add    %r8b,(%rax)
   4:   f3 0f 1e fa             endbr64
   8:   41 f7 c1 ff 0f 00 00    test   $0xfff,%r9d
   f:   75 2b                   jne    0x3c
  11:   55                      push   %rbp
  12:   48 89 fd                mov    %rdi,%rbp
  15:   53                      push   %rbx
  16:   89 cb                   mov    %ecx,%ebx
  18:   48 85 ff                test   %rdi,%rdi
  1b:   4f                      rex.WRXB
[    2.121576] RSP: 002b:00007ffcbc695148 EFLAGS: 00000246 ORIG_RAX: 0000000000000009
[    2.121576] RAX: ffffffffffffffda RBX: 0000000000000022 RCX: 00007ff228f7a186
[    2.121576] RDX: 0000000000000003 RSI: 0000000000002000 RDI: 0000000000000000
[    2.121576] RBP: 0000000000000000 R08: 00000000ffffffff R09: 0000000000000000
[    2.121576] R10: 0000000000000022 R11: 0000000000000246 R12: 00007ff228f8a190
[    2.121576] R13: 000000000000000c R14: 00007ff228f89060 R15: 0000000000000000
[    2.121576]  </TASK>
[    2.174098] ata2: found unknown device (class 0)
[    2.121576] Modules linked in:
[    2.121576] Dumping ftrace buffer:
[    2.121576]    (ftrace buffer empty)
[    2.121576] CR2: 0000000000000078
[    2.179450] ata2.00: ATAPI: QEMU DVD-ROM, 2.5+, max UDMA/100
[    2.179774] ---[ end trace 0000000000000000 ]---
[    2.183410] RIP: 0010:mas_wr_walk (lib/maple_tree.c:1401 lib/maple_tree.c:2259 lib/maple_tree.c:3732 lib/maple_tree.c:3757)
[ 2.184545] Code: 00 48 8b 51 18 30 d2 48 89 53 08 83 f8 02 0f 87 64 01 00 00 4c 8d 42 08 0f b6 80 e68

Code starting with the faulting instruction
===========================================
   0:   00 48 8b                add    %cl,-0x75(%rax)
   3:   51                      push   %rcx
   4:   18 30                   sbb    %dh,(%rax)
   6:   d2 48 89                rorb   %cl,-0x77(%rax)
   9:   53                      push   %rbx
   a:   08 83 f8 02 0f 87       or     %al,-0x78f0fd08(%rbx)
  10:   64 01 00                add    %eax,%fs:(%rax)
  13:   00 4c 8d 42             add    %cl,0x42(%rbp,%rcx,4)
  17:   08 0f                   or     %cl,(%rdi)
  19:   b6 80                   mov    $0x80,%dh
  1b:   68                      .byte 0x68
[    2.185835] scsi 1:0:0:0: CD-ROM            QEMU     QEMU DVD-ROM     2.5+ PQ: 0 ANSI: 5
[    2.188543] RSP: 0018:ffffa5190119fc28 EFLAGS: 00010246
[    2.188546] RAX: 000000000000000f RBX: ffffa5190119fc78 RCX: ffffa5190119fd60
[    2.188547] RDX: 0000000000000000 RSI: 000000000000000e RDI: 000000000000000e
[    2.188548] RBP: ffffa5190119fc38 R08: 0000000000000008 R09: 0000000000000001
[    2.188550] R10: ffff95f5c3435300 R11: ffff95f5c3434c48 R12: ffffa5190119fd60
[    2.188551] R13: ffff95f5c9a26880 R14: ffff95f5c3433690 R15: 0000000000100073
[    2.188552] FS:  0000000000000000(0000) GS:ffff9613fd480000(0000) knlGS:0000000000000000
[    2.188554] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    2.188556] CR2: 0000000000000078 CR3: 0000000103430000 CR4: 00000000000006e0
[    2.188559] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[    2.206738] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

[1] https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git/commit/?h=mm-unstable&id=a13d6f0ec9b80674195d74ddfb6dfd94d352d2bb
[2] https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git/commit/?h=mm-unstable&id=1329c351b42e20fcd195829357f0eda607f3de09
[3] https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git/commit/?h=mm-unstable&id=f569105c34815dee1751a00bc9ca5154cc96dd6a


Thanks,
SJ


On Thu, 5 Jan 2023 19:15:58 +0000 Liam Howlett <liam.howlett@oracle.com> wrote:

> From: "Liam R. Howlett" <Liam.Howlett@Oracle.com>
> 
> Use the vma iterator so that the iterator can be invalidated or updated
> to avoid each caller doing so.
> 
> Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
> ---
>  mm/mmap.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/mmap.c b/mm/mmap.c
> index 4dd7e48a312f..80f12fcf158c 100644
> --- a/mm/mmap.c
> +++ b/mm/mmap.c
> @@ -2446,7 +2446,7 @@ do_vmi_align_munmap(struct vma_iterator *vmi, struct vm_area_struct *vma,
>  		if (end < vma->vm_end && mm->map_count >= sysctl_max_map_count)
>  			goto map_count_exceeded;
>  
> -		error = __split_vma(mm, vma, start, 0);
> +		error = vmi__split_vma(vmi, mm, vma, start, 0);
>  		if (error)
>  			goto start_split_failed;
>  
> @@ -2467,7 +2467,7 @@ do_vmi_align_munmap(struct vma_iterator *vmi, struct vm_area_struct *vma,
>  		if (next->vm_end > end) {
>  			struct vm_area_struct *split;
>  
> -			error = __split_vma(mm, next, end, 1);
> +			error = vmi__split_vma(vmi, mm, next, end, 1);
>  			if (error)
>  				goto end_split_failed;
>  
> -- 
> 2.35.1
> 
> 


  reply	other threads:[~2023-01-07  2:01 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-05 19:15 [PATCH v2 00/44] VMA tree type safety and remove __vma_adjust() Liam Howlett
2023-01-05 19:15 ` [PATCH v2 02/44] maple_tree: Fix potential rcu issue Liam Howlett
2023-01-05 19:15 ` [PATCH v2 01/44] maple_tree: Add mas_init() function Liam Howlett
2023-01-05 19:15 ` [PATCH v2 05/44] mm: Expand vma iterator interface Liam Howlett
2023-01-05 19:15 ` [PATCH v2 04/44] test_maple_tree: Test modifications while iterating Liam Howlett
2023-01-05 19:15 ` [PATCH v2 03/44] maple_tree: Reduce user error potential Liam Howlett
2023-01-05 19:15 ` [PATCH v2 07/44] kernel/fork: Convert forking to using the vmi iterator Liam Howlett
2023-01-05 19:15 ` [PATCH v2 06/44] mm/mmap: convert brk to use vma iterator Liam Howlett
2023-01-09 15:10   ` Vernon Yang
2023-01-09 16:38     ` Liam Howlett
2023-01-05 19:15 ` [PATCH v2 08/44] mmap: Convert vma_link() " Liam Howlett
2023-01-05 19:15 ` [PATCH v2 09/44] mm/mmap: Remove preallocation from do_mas_align_munmap() Liam Howlett
2023-01-05 19:15 ` [PATCH v2 10/44] mmap: Change do_mas_munmap and do_mas_aligned_munmap() to use vma iterator Liam Howlett
2023-01-10 14:53   ` Sven Schnelle
2023-01-10 17:26     ` Liam Howlett
2023-01-11  6:55       ` Sven Schnelle
2023-01-05 19:15 ` [PATCH v2 11/44] mmap: Convert vma_expand() " Liam Howlett
2023-01-05 19:15 ` [PATCH v2 12/44] mm: Add temporary vma iterator versions of vma_merge(), split_vma(), and __split_vma() Liam Howlett
2023-01-05 19:15 ` [PATCH v2 14/44] userfaultfd: Use vma iterator Liam Howlett
2023-01-05 19:15 ` [PATCH v2 13/44] ipc/shm: Use the vma iterator for munmap calls Liam Howlett
2023-01-05 19:15 ` [PATCH v2 15/44] mm: Change mprotect_fixup to vma iterator Liam Howlett
2023-01-05 19:15 ` [PATCH v2 18/44] mempolicy: Convert " Liam Howlett
2023-01-05 19:15 ` [PATCH v2 16/44] mlock: Convert mlock " Liam Howlett
2023-01-05 19:15 ` [PATCH v2 17/44] coredump: Convert " Liam Howlett
2023-01-05 19:15 ` [PATCH v2 21/44] madvise: Use vmi iterator for __split_vma() and vma_merge() Liam Howlett
2023-01-05 19:15 ` [PATCH v2 20/44] sched: Convert to vma iterator Liam Howlett
2023-01-05 19:15 ` [PATCH v2 19/44] task_mmu: " Liam Howlett
2023-01-05 19:15 ` [PATCH v2 22/44] mmap: Pass through vmi iterator to __split_vma() Liam Howlett
2023-01-07  2:01   ` SeongJae Park [this message]
2023-01-07  2:39     ` SeongJae Park
2023-01-09 16:45       ` Liam Howlett
2023-01-09 19:28         ` SeongJae Park
2023-01-09 20:30           ` Liam Howlett
2023-01-09 23:07             ` SeongJae Park
2023-01-05 19:15 ` [PATCH v2 24/44] mm/mremap: Use vmi version of vma_merge() Liam Howlett
2023-01-05 19:15 ` [PATCH v2 25/44] mm: Switch vma_merge(), split_vma(), and __split_vma to vma iterator Liam Howlett
2023-01-06 17:23   ` SeongJae Park
2023-01-06 19:20     ` Liam Howlett
2023-01-05 19:15 ` [PATCH v2 23/44] mmap: Use vmi version of vma_merge() Liam Howlett
2023-01-05 19:16 ` [PATCH v2 27/44] mmap: Convert __vma_adjust() to use vma iterator Liam Howlett
2023-01-05 19:16 ` [PATCH v2 26/44] mm/damon: Stop using vma_mas_store() for maple tree store Liam Howlett
2023-01-05 19:32   ` SeongJae Park
2023-01-05 19:52     ` Liam Howlett
2023-01-05 20:16       ` SeongJae Park
2023-01-05 19:16 ` [PATCH v2 29/44] madvise: Use split_vma() instead of __split_vma() Liam Howlett
2023-01-05 19:16 ` [PATCH v2 28/44] mm: Pass through vma iterator to __vma_adjust() Liam Howlett
2023-01-05 19:16 ` [PATCH v2 30/44] mm: Remove unnecessary write to vma iterator in __vma_adjust() Liam Howlett
2023-01-05 19:16 ` [PATCH v2 32/44] mm: Add vma iterator to vma_adjust() arguments Liam Howlett
2023-01-05 19:16 ` [PATCH v2 33/44] mmap: Clean up mmap_region() unrolling Liam Howlett
2023-01-05 19:16 ` [PATCH v2 31/44] mm: Pass vma iterator through to __vma_adjust() Liam Howlett
2023-01-05 19:16 ` [PATCH v2 34/44] mm: Change munmap splitting order and move_vma() Liam Howlett
2023-01-05 19:16 ` [PATCH v2 37/44] mm/mmap: Use vma_prepare() and vma_complete() in vma_expand() Liam Howlett
2023-01-05 19:16 ` [PATCH v2 36/44] mm/mmap: Refactor locking out of __vma_adjust() Liam Howlett
2023-01-05 19:16 ` [PATCH v2 35/44] mm/mmap: move anon_vma setting in __vma_adjust() Liam Howlett
2023-01-05 19:16 ` [PATCH v2 39/44] mm: Don't use __vma_adjust() in __split_vma() Liam Howlett
2023-01-05 19:16 ` [PATCH v2 40/44] mm/mmap: Don't use __vma_adjust() in shift_arg_pages() Liam Howlett
2023-01-05 19:16 ` [PATCH v2 38/44] mm/mmap: Introduce init_vma_prep() and init_multi_vma_prep() Liam Howlett
2023-01-05 19:16 ` [PATCH v2 42/44] mm/mmap: Convert do_brk_flags() to use vma_prepare() and vma_complete() Liam Howlett
2023-01-05 19:16 ` [PATCH v2 43/44] mm/mmap: Remove __vma_adjust() Liam Howlett
2023-01-05 19:16 ` [PATCH v2 41/44] mm/mmap: Introduce dup_vma_anon() helper Liam Howlett
2023-01-05 19:16 ` [PATCH v2 44/44] vma_merge: Set vma iterator to correct position Liam Howlett
2023-01-10 22:51 ` [PATCH v2 00/44] VMA tree type safety and remove __vma_adjust() Mark Brown
2023-01-11  2:22   ` Liam Howlett

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=20230107020126.1627-1-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=liam.howlett@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=maple-tree@lists.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.