Re: [PATCH] mm: Decline to manipulate the refcount on a slab page

From
Christoph Hellwig <hch@infradead.org>
Date
2025-03-13 09:15:59
Also in
linux-mm
Reply to
Hannes Reinecke, 2025-03-13
On Thu, Mar 13, 2025 at 09:52:18AM +0100, Hannes Reinecke wrote:
quoted
It doesn't.  It just doesn't want you to use ->sendpage.
But we don't; we call 'sendpage_ok()' and disabling the MSG_SPLICE_PAGES
flag.
MSG_SPLICE_PAGES really just is the new name for the old ->sendpage.
Sorry for being stuck in the old naming.
Actual issue is that tls_sw() is calling iov_iter_alloc_pages(),
which is taking a page reference.
It probably should be calling iov_iter_extract_pages() (which does not
take a reference), but then one would need to review the entire network
stack as taking and releasing page references are littered throughout
the stack.
Yes, it needs to use the proper pinning helpers, if only to not
corrupt out of place write file systems when receiving from a TLS
socket.  But for the network stack below it that doesn't matter,
it expects to be able to grab and release references, and for that
you need page backing.  If that page was pinned or referenced
when resolving the user address does not matter at all.
Thread (14 messages) 14 messages, 5 authors, last reply 2025-03-13
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help