Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'address-miscellaneous-issues-with-psp_sk_get_assoc_rcu'

Daniel Zahka says:

====================
address miscellaneous issues with psp_sk_get_assoc_rcu()

There were a few minor issues with psp_sk_get_assoc_rcu() identified
by Eric in his review of the initial psp series. This series addresses
them.
====================

Link: https://patch.msgid.link/20250918155205.2197603-1-daniel.zahka@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+6 -7
+6 -7
include/net/psp/functions.h
··· 124 124 return __psp_sk_rx_policy_check(skb, rcu_dereference(tw->psp_assoc)); 125 125 } 126 126 127 - static inline struct psp_assoc *psp_sk_get_assoc_rcu(struct sock *sk) 127 + static inline struct psp_assoc *psp_sk_get_assoc_rcu(const struct sock *sk) 128 128 { 129 - struct inet_timewait_sock *tw; 130 129 struct psp_assoc *pas; 131 130 int state; 132 131 133 - state = 1 << READ_ONCE(sk->sk_state); 134 - if (!sk_is_inet(sk) || state & TCPF_NEW_SYN_RECV) 132 + state = READ_ONCE(sk->sk_state); 133 + if (!sk_is_inet(sk) || state == TCP_NEW_SYN_RECV) 135 134 return NULL; 136 135 137 - tw = inet_twsk(sk); 138 - pas = state & TCPF_TIME_WAIT ? rcu_dereference(tw->psp_assoc) : 139 - rcu_dereference(sk->psp_assoc); 136 + pas = state == TCP_TIME_WAIT ? 137 + rcu_dereference(inet_twsk(sk)->psp_assoc) : 138 + rcu_dereference(sk->psp_assoc); 140 139 return pas; 141 140 } 142 141