[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20150308.230211.1441656915237102392.davem@davemloft.net>
Date: Sun, 08 Mar 2015 23:02:11 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: willemb@...gle.com
Cc: netdev@...r.kernel.org, jan@...dor.com, richardcochran@...il.com
Subject: Re: [PATCH net v2] ip: fix error queue empty skb handling
From: Willem de Bruijn <willemb@...gle.com>
Date: Sat, 7 Mar 2015 20:33:22 -0500
> From: Willem de Bruijn <willemb@...gle.com>
>
> 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: 49ca0d8bfaf3 ("net-timestamp: no-payload option")
>
> Reported-by: Jan Niehusmann <jan@...dor.com>
> Signed-off-by: Willem de Bruijn <willemb@...gle.com>
Applied, thanks for fixing this Willem.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists