Skip to content

Commit a97b72c

Browse files
jrfastabNobody
authored andcommitted
bpf, sockmap: zap ingress queues after stopping strparser
We don't want strparser to run and pass skbs into skmsg handlers when the psock is null. We just sk_drop them in this case. When removing a live socket from map it means extra drops that we do not need to incur. Move the zap below strparser close to avoid this condition. This way we stop the stream parser first stopping it from processing packets and then delete the psock. Fixes: a136678 ("bpf: sk_msg, zap ingress queue on psock down") Acked-by: Jakub Sitnicki <jakub@cloudflare.com> Signed-off-by: John Fastabend <john.fastabend@gmail.com>
1 parent 5df4a89 commit a97b72c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/core/skmsg.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -773,8 +773,6 @@ static void sk_psock_destroy(struct work_struct *work)
773773

774774
void sk_psock_drop(struct sock *sk, struct sk_psock *psock)
775775
{
776-
sk_psock_stop(psock, false);
777-
778776
write_lock_bh(&sk->sk_callback_lock);
779777
sk_psock_restore_proto(sk, psock);
780778
rcu_assign_sk_user_data(sk, NULL);
@@ -784,6 +782,8 @@ void sk_psock_drop(struct sock *sk, struct sk_psock *psock)
784782
sk_psock_stop_verdict(sk, psock);
785783
write_unlock_bh(&sk->sk_callback_lock);
786784

785+
sk_psock_stop(psock, false);
786+
787787
INIT_RCU_WORK(&psock->rwork, sk_psock_destroy);
788788
queue_rcu_work(system_wq, &psock->rwork);
789789
}

0 commit comments

Comments
 (0)