public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Pavel Begunkov <asml.silence@gmail.com>, io-uring@vger.kernel.org
Subject: Re: [PATCH v1 1/3] io_uring/rsrc: fix folio unpinning
Date: Tue, 24 Jun 2025 13:57:24 +0200	[thread overview]
Message-ID: <731f7ada-2544-483f-b33e-84c19d62d6e6@redhat.com> (raw)
In-Reply-To: <380d4fed5a9c49448f7ae030c54a6c0c5ec514c0.1750760501.git.asml.silence@gmail.com>

On 24.06.25 12:35, Pavel Begunkov wrote:
> [  108.070381][   T14] kernel BUG at mm/gup.c:71!
> [  108.070502][   T14] Internal error: Oops - BUG: 00000000f2000800 [#1]  SMP
> [  108.123672][   T14] Hardware name: QEMU KVM Virtual Machine, BIOS edk2-20250221-8.fc42 02/21/2025
> [  108.127458][   T14] Workqueue: iou_exit io_ring_exit_work
> [  108.174205][   T14] Call trace:
> [  108.175649][   T14]  sanity_check_pinned_pages+0x7cc/0x7d0 (P)
> [  108.178138][   T14]  unpin_user_page+0x80/0x10c
> [  108.180189][   T14]  io_release_ubuf+0x84/0xf8
> [  108.182196][   T14]  io_free_rsrc_node+0x250/0x57c
> [  108.184345][   T14]  io_rsrc_data_free+0x148/0x298
> [  108.186493][   T14]  io_sqe_buffers_unregister+0x84/0xa0
> [  108.188991][   T14]  io_ring_ctx_free+0x48/0x480
> [  108.191057][   T14]  io_ring_exit_work+0x764/0x7d8
> [  108.193207][   T14]  process_one_work+0x7e8/0x155c
> [  108.195431][   T14]  worker_thread+0x958/0xed8
> [  108.197561][   T14]  kthread+0x5fc/0x75c
> [  108.199362][   T14]  ret_from_fork+0x10/0x20
> 
> We can pin a tail page of a folio, but then io_uring will try to unpin
> the the head page of the folio. While it should be fine in terms of
> keeping the page actually alive, but mm folks say it's wrong and
> triggers a debug warning. Use unpin_user_folio() instead of
> unpin_user_page*.

Right, unpin_user_pages() expects that you unpin the exact pages you pinned,
not some other pages of the same folio.

> 
> Cc: stable@vger.kernel.org
> Reported-by: David Hildenbrand <david@redhat.com>

Probably should be:

Debugged-by: David Hildenbrand <david@redhat.com>
Reported-by: syzbot+1d335893772467199ab6@syzkaller.appspotmail.com
Closes: https://lkml.kernel.org/r/683f1551.050a0220.55ceb.0017.GAE@google.com


> Fixes: a8edbb424b139 ("io_uring/rsrc: enable multi-hugepage buffer coalescing")
> Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>

-- 
Cheers,

David / dhildenb


  reply	other threads:[~2025-06-24 11:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-24 10:35 [PATCH v1 0/3] io_uring mm related abuses Pavel Begunkov
2025-06-24 10:35 ` [PATCH v1 1/3] io_uring/rsrc: fix folio unpinning Pavel Begunkov
2025-06-24 11:57   ` David Hildenbrand [this message]
2025-06-24 12:08     ` Pavel Begunkov
2025-06-24 10:35 ` [PATCH v1 2/3] io_uring/rsrc: don't rely on user vaddr alignment Pavel Begunkov
2025-06-24 11:53   ` David Hildenbrand
2025-06-24 12:20     ` Pavel Begunkov
2025-06-24 12:26       ` David Hildenbrand
2025-06-24 12:37         ` Pavel Begunkov
2025-06-24 12:30       ` Pavel Begunkov
2025-06-24 12:42   ` David Hildenbrand
2025-06-24 12:54     ` Pavel Begunkov
2025-06-24 10:35 ` [PATCH v1 3/3] io_uring: don't assume uaddr alignment in io_vec_fill_bvec Pavel Begunkov
2025-06-24 10:38 ` [PATCH v1 0/3] io_uring mm related abuses Pavel Begunkov

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=731f7ada-2544-483f-b33e-84c19d62d6e6@redhat.com \
    --to=david@redhat.com \
    --cc=asml.silence@gmail.com \
    --cc=io-uring@vger.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