Thread (21 messages) 21 messages, 8 authors, 2025-03-13

Re: Kernel oops with 6.14 when enabling TLS

From: Vlastimil Babka <hidden>
Date: 2025-03-05 08:58:51
Also in: linux-block, linux-mm, linux-nvme
Subsystem: bpf [l7 framework] (sockmap), networking [general], the rest · Maintainers: John Fastabend, Jakub Sitnicki, Jiayuan Chen, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

On 3/5/25 09:20, Hannes Reinecke wrote:
On 3/4/25 20:44, Vlastimil Babka wrote:
quoted
On 3/4/25 20:39, Hannes Reinecke wrote:
[ .. ]
quoted
quoted
Good news and bad news ...
Good news: TLS works again!
Bad news: no errors.
Wait, did you add a WARN_ON_ONCE() to the put_page() as I suggested? If yes
and there was no error, it would have to be leaking the page. Or the path
uses folio_put() and we'd need to put the warning there.
That triggers:
...
Not surprisingly, though, as the original code did a get_page(), so
there had to be a corresponding put_page() somewhere.
Is is this one? If there's no more warning afterwards, that should be it.
diff --git a/net/core/skmsg.c b/net/core/skmsg.c
index 61f3f3d4e528..b37d99cec069 100644
--- a/net/core/skmsg.c
+++ b/net/core/skmsg.c
@@ -182,9 +182,14 @@ static int sk_msg_free_elem(struct sock *sk, struct sk_msg *msg, u32 i,
 
        /* When the skb owns the memory we free it from consume_skb path. */
        if (!msg->skb) {
+               struct folio *folio;
+
                if (charge)
                        sk_mem_uncharge(sk, len);
-               put_page(sg_page(sge));
+
+               folio = page_folio(sg_page(sge));
+               if (!folio_test_slab(folio))
+                       folio_put(folio);
        }
        memset(sge, 0, sizeof(*sge));
        return len;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help