Skip to content

Commit a3c4a12

Browse files
q2venkuba-moo
authored andcommitted
netlink: Fix rmem check in netlink_broadcast_deliver().
We need to allow queuing at least one skb even when skb is larger than sk->sk_rcvbuf. The cited commit made a mistake while converting a condition in netlink_broadcast_deliver(). Let's correct the rmem check for the allow-one-skb rule. Fixes: ae8f160 ("netlink: Fix wraparounds of sk->sk_rmem_alloc.") Signed-off-by: Kuniyuki Iwashima <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 52c14ea commit a3c4a12

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/netlink/af_netlink.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1395,7 +1395,7 @@ static int netlink_broadcast_deliver(struct sock *sk, struct sk_buff *skb)
13951395
rmem = atomic_add_return(skb->truesize, &sk->sk_rmem_alloc);
13961396
rcvbuf = READ_ONCE(sk->sk_rcvbuf);
13971397

1398-
if ((rmem != skb->truesize || rmem <= rcvbuf) &&
1398+
if ((rmem == skb->truesize || rmem <= rcvbuf) &&
13991399
!test_bit(NETLINK_S_CONGESTED, &nlk->state)) {
14001400
netlink_skb_set_owner_r(skb, sk);
14011401
__netlink_sendskb(sk, skb);

0 commit comments

Comments
 (0)