mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
c247f0534c
When reading from the error queue, msg_name and msg_control are only
populated for some errors. A new exception for empty timestamp skbs
added a false positive on icmp errors without payload.
`traceroute -M udpconn` only displayed gateways that return payload
with the icmp error: the embedded network headers are pulled before
sock_queue_err_skb, leaving an skb with skb->len == 0 otherwise.
Fix this regression by refining when msg_name and msg_control
branches are taken. The solutions for the two fields are independent.
msg_name only makes sense for errors that configure serr->port and
serr->addr_offset. Test the first instead of skb->len. This also fixes
another issue. saddr could hold the wrong data, as serr->addr_offset
is not initialized in some code paths, pointing to the start of the
network header. It is only valid when serr->port is set (non-zero).
msg_control support differs between IPv4 and IPv6. IPv4 only honors
requests for ICMP and timestamps with SOF_TIMESTAMPING_OPT_CMSG. The
skb->len test can simply be removed, because skb->dev is also tested
and never true for empty skbs. IPv6 honors requests for all errors
aside from local errors and timestamps on empty skbs.
In both cases, make the policy more explicit by moving this logic to
a new function that decides whether to process msg_control and that
optionally prepares the necessary fields in skb->cb[]. After this
change, the IPv4 and IPv6 paths are more similar.
The last case is rxrpc. Here, simply refine to only match timestamps.
Fixes:
|
||
---|---|---|
.. | ||
af_rxrpc.c | ||
ar-accept.c | ||
ar-ack.c | ||
ar-call.c | ||
ar-connection.c | ||
ar-connevent.c | ||
ar-error.c | ||
ar-input.c | ||
ar-internal.h | ||
ar-key.c | ||
ar-local.c | ||
ar-output.c | ||
ar-peer.c | ||
ar-proc.c | ||
ar-recvmsg.c | ||
ar-security.c | ||
ar-skbuff.c | ||
ar-transport.c | ||
Kconfig | ||
Makefile | ||
rxkad.c | ||
sysctl.c |