All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rustam Kovhaev <rkovhaev@gmail.com>
To: syzbot <syzbot+013715179d3f910d4c86@syzkaller.appspotmail.com>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [mm?] WARNING in page_counter_cancel (5)
Date: Sat, 5 Oct 2024 10:12:46 -0700	[thread overview]
Message-ID: <20241005171246.GA2236@nuc10> (raw)
In-Reply-To: <67000a50.050a0220.49194.048d.GAE@google.com>

On Fri, Oct 04, 2024 at 08:31:28AM -0700, syzbot wrote:
> ------------[ cut here ]------------
> page_counter underflow: -512 nr_pages=512
> WARNING: CPU: 1 PID: 5225 at mm/page_counter.c:60 page_counter_cancel+0x110/0x170 mm/page_counter.c:60
> Modules linked in:
> CPU: 1 UID: 0 PID: 5225 Comm: syz-executor334 Not tainted 6.12.0-rc1-syzkaller #0
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
> RIP: 0010:page_counter_cancel+0x110/0x170 mm/page_counter.c:60
> Code: e8 55 23 98 ff 45 84 ed 75 24 e8 6b 21 98 ff c6 05 1a ef 10 0e 01 90 48 c7 c7 c0 9d 5c 8b 4c 89 e2 48 89 ee e8 91 9a 59 ff 90 <0f> 0b 90 90 e8 47 21 98 ff be 08 00 00 00 48 89 df e8 9a 71 f9 ff
> RSP: 0018:ffffc900032dfae8 EFLAGS: 00010282
> RAX: 0000000000000000 RBX: ffff8881404a9440 RCX: ffffffff814e2a49
> RDX: ffff88801df38000 RSI: ffffffff814e2a56 RDI: 0000000000000001
> RBP: fffffffffffffe00 R08: 0000000000000001 R09: 0000000000000000
> R10: 0000000000000001 R11: 0000000000000001 R12: 0000000000000200
> R13: 0000000000000000 R14: 0000000000000001 R15: ffff888077bbdc18
> FS:  0000000000000000(0000) GS:ffff8880b8700000(0000) knlGS:0000000000000000
> CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> CR2: 00007f6b788f5243 CR3: 000000007ec10000 CR4: 00000000003526f0
> DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
> Call Trace:
>  <TASK>
>  page_counter_uncharge+0x32/0x70 mm/page_counter.c:182
>  hugetlb_cgroup_uncharge_counter+0xd6/0x410 mm/hugetlb_cgroup.c:431
>  hugetlb_vm_op_close+0x3fe/0x5b0 mm/hugetlb.c:5065
>  remove_vma+0xa8/0x1a0 mm/vma.c:330
>  exit_mmap+0x4e0/0xb30 mm/mmap.c:1888
>  __mmput+0x12a/0x480 kernel/fork.c:1347
>  mmput+0x62/0x70 kernel/fork.c:1369
>  exit_mm kernel/exit.c:571 [inline]
>  do_exit+0x9bf/0x2d70 kernel/exit.c:926
>  do_group_exit+0xd3/0x2a0 kernel/exit.c:1088
>  __do_sys_exit_group kernel/exit.c:1099 [inline]
>  __se_sys_exit_group kernel/exit.c:1097 [inline]
>  __x64_sys_exit_group+0x3e/0x50 kernel/exit.c:1097
>  x64_sys_call+0x14a9/0x16a0 arch/x86/include/generated/asm/syscalls_64.h:232
>  do_syscall_x64 arch/x86/entry/common.c:52 [inline]
>  do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83
>  entry_SYSCALL_64_after_hwframe+0x77/0x7f
> RIP: 0033:0x7f6b7889d879
> Code: Unable to access opcode bytes at 0x7f6b7889d84f.
> RSP: 002b:00007ffcea637828 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
> RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f6b7889d879
> RDX: 000000000000003c RSI: 00000000000000e7 RDI: 0000000000000000
> RBP: 00007f6b78911350 R08: ffffffffffffffb8 R09: 0000000000000000
> R10: 0000000000000003 R11: 0000000000000246 R12: 00007f6b78911350
> R13: 0000000000000000 R14: 00007f6b78911da0 R15: 00007f6b78866f40
>  </TASK>
> 
Hello,
Reproduced the same issue in my lab. I'll try to take my chances and fix
this one, unless someone is already working on it.
In copy_vma() we go to out_vma_link and execute hugetlb_vm_op_close()
which uncharges the counter to 0.
Then, when the process terminates we execute hugetlb_vm_op_close() again
against the same vma and the counter goes negative.



      reply	other threads:[~2024-10-05 17:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-04 15:31 [syzbot] [mm?] WARNING in page_counter_cancel (5) syzbot
2024-10-05 17:12 ` Rustam Kovhaev [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=20241005171246.GA2236@nuc10 \
    --to=rkovhaev@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=syzbot+013715179d3f910d4c86@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.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 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.