From: Jakub Kicinski <kuba@kernel.org>
To: Allison Henderson <achender@kernel.org>
Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
pabeni@redhat.com, edumazet@google.com, horms@kernel.org
Subject: Re: [PATCH net 1/3] net/rds: don't use unpin_user_pages_dirty_lock() from atomic context
Date: Wed, 22 Jul 2026 09:43:30 -0700 [thread overview]
Message-ID: <20260722094330.0486c26c@kernel.org> (raw)
In-Reply-To: <20260711025118.2449428-2-achender@kernel.org>
On Fri, 10 Jul 2026 19:51:16 -0700 Allison Henderson wrote:
> rds_rdma_free_op() and rds_atomic_free_op() are reached from the IB
> send completion path via
>
> rds_ib_tasklet_fn_send()
> rds_ib_send_cqe_handler()
> rds_message_put()
> rds_message_purge()
> rds_rdma_free_op() / rds_atomic_free_op()
Sashiko points out that this just moves the problem to the filesystem,
which also may have mutexes:
Does calling set_page_dirty() from softirq context introduce a
potential deadlock?
If the user pages are file-backed, set_page_dirty() will route to filesystem
dirty callbacks like filemap_dirty_folio() or block_dirty_folio(). These
callbacks acquire non-irq-safe spinlocks, such as inode->i_lock or
mapping->i_private_lock. If the tasklet interrupts a process holding one of
these locks, could the softirq spin forever?
Additionally, does calling set_page_dirty() here without holding the folio
lock or an active file reference risk a use-after-free?
If a concurrent file truncation removes the page from the page cache and
frees its mapping, and set_page_dirty() reads folio->mapping just before
it is zeroed, could it dereference a freed pointer when calling the
dirty_folio callback or __mark_inode_dirty()? Should this work be
deferred to a process context workqueue instead?
Is this not true, or not true in most cases? Otherwise we should find a
better fix?
--
pw-bot: cr
next prev parent reply other threads:[~2026-07-22 16:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-11 2:51 [PATCH net 0/3] net/rds: Bug fix ports Allison Henderson
2026-07-11 2:51 ` [PATCH net 1/3] net/rds: don't use unpin_user_pages_dirty_lock() from atomic context Allison Henderson
2026-07-22 16:43 ` Jakub Kicinski [this message]
2026-07-11 2:51 ` [PATCH net 2/3] net/rds: hold the socket while an rds_mr references it Allison Henderson
2026-07-11 2:51 ` [PATCH net 3/3] net/rds: fix rds_message leak in the rds_send_xmit() drop path Allison Henderson
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=20260722094330.0486c26c@kernel.org \
--to=kuba@kernel.org \
--cc=achender@kernel.org \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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.