diff options
| author | Jiayuan Chen <jiayuan.chen@linux.dev> | 2026-11-04 19:57:26 +0800 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-11-09 16:23:40 -0800 |
| commit | 45441a94d50200f1478c52857725e6df624bf2ad (patch) | |
| tree | a2fa4c6ef9328578117994cb1b3f298d4f931b90 /scripts/const_structs.checkpatch | |
| parent | be9587c47db16faaca5415f533637755c65a4eb0 (diff) | |
net: raw: fix ICMP unreachable sent when receive queue is full
It's found in a raw socket application. When the application doesn't
read packets in time, the client receives ICMP Protocol Unreachable,
which makes the client abort the session.
The reason is that the server hits the sk_rcvbuf limit, and
raw_v4_input() skips the socket before setting 'delivered', so it
returns 0. Then ip_protocol_deliver_rcu() sees 'raw' is 0, thinks no one
handles this protocol and calls icmp_send() to send ICMP Protocol
Unreachable.
IPv6 has the same issue, ip6_protocol_deliver_rcu() sends ICMPv6
Parameter Problem instead.
Also, we'd better run icmp_filter() and ip_mc_sf_allow() (icmpv6_filter()
for IPv6) before we check sk_rcvbuf, otherwise packets rejected by
ICMP_FILTER/ICMPV6_FILTER or the multicast filter are counted in
sk_drops. So move the check right before skb_clone().
Fixes: d721812aa875 ("ipv4: raw: check sk->sk_rcvbuf earlier")
Fixes: 026763ece881 ("ipv6: raw: check sk->sk_rcvbuf earlier")
Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Link: https://patch.msgid.link/20261104115732.322151-1-jiayuan.chen@linux.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'scripts/const_structs.checkpatch')
0 files changed, 0 insertions, 0 deletions
