netfilter: do not assume skb->sk is inet sk
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | netfilter: add nf_skb_sk helper and use itinclude/ net/ net/ | +43 | 0 replies | |
| 2/2 | netfilter: add nf_sk_to_full_sk helper and use itinclude/ net/ net/ | +19 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH nf-next 0/2] netfilter: do not assume skb->sk is inet sk
LLM reported that packet socket could be handed off to an ip tunnel, where the now tunneled skb retains skb->sk as packet socket.
There are spots where we assume skb->sk is inet socket. Add helpers for this and use them where needed. Not reproducible (no crash / out of bound access, nft_socket just provides a 'random' result instead of 'no match').
There are more skb->sk users but I could not find bad-access scenarios for those, they fetch valid sk fields or are restricted to input hooks.
Florian Westphal (2):
netfilter: add nf_skb_sk helper and use it
netfilter: add nf_sk_to_full_sk helper and use it
include/net/netfilter/nf_socket.h | 35 +++++++++++++++++++++++++++++++ net/ipv4/netfilter.c | 3 ++- net/ipv6/netfilter.c | 3 ++- net/netfilter/nft_socket.c | 16 +++++++------- net/netfilter/xt_socket.c | 26 ++++++++++++----------- 5 files changed, 62 insertions(+), 21 deletions(-)
Signature · 1 line
2.55.0