Thread (12 messages) flat view 12 messages, 3 authors, 2021-06-22

Re: [PATCH net-next] ip: avoid OOM kills with large UDP sends over loopback

From: Eric Dumazet <hidden>
Date: 2021-06-22 17:50:01


On 6/22/21 7:19 PM, Jakub Kicinski wrote:
On Tue, 22 Jun 2021 09:54:22 -0700 Jakub Kicinski wrote:
quoted
quoted
quoted
+static inline void sk_allocation_push(struct sock *sk, gfp_t flag, gfp_t *old)
+{
+	*old = sk->sk_allocation;
+	sk->sk_allocation |= flag;
+}
+    
This is not thread safe.

Remember UDP sendmsg() does not lock the socket for non-corking sends.  
Ugh, you're right :(
Hm, isn't it buggy to call sock_alloc_send_[p]skb() without holding the
lock in the first place, then? The knee jerk fix would be to add another 
layer of specialization to the helpers:
It is not buggy. Please elaborate if you found it is.

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help