Please sign in to comment.
tcp: fix SCM_TIMESTAMPING_OPT_STATS for normal skbs
__sock_recv_timestamp can be called for both normal skbs (for receive timestamps) and for skbs on the error queue (for transmit timestamps). Commit 1c88580 (tcp: SOF_TIMESTAMPING_OPT_STATS option for SO_TIMESTAMPING) assumes any skb passed to __sock_recv_timestamp are from the error queue, containing OPT_STATS in the content of the skb. This results in accessing invalid memory or generating junk data. To fix this, set skb->pkt_type to PACKET_OUTGOING for packets on the error queue. This is safe because on the receive path on local sockets skb->pkt_type is never set to PACKET_OUTGOING. With that, copy OPT_STATS from a packet, only if its pkt_type is PACKET_OUTGOING. Fixes: 1c88580 ("tcp: SOF_TIMESTAMPING_OPT_STATS option for SO_TIMESTAMPING") Reported-by: JongHwan Kim <firstname.lastname@example.org> Signed-off-by: Soheil Hassas Yeganeh <email@example.com> Signed-off-by: Eric Dumazet <firstname.lastname@example.org> Signed-off-by: Willem de Bruijn <email@example.com> Signed-off-by: David S. Miller <firstname.lastname@example.org>
- Loading branch information...
Showing with 22 additions and 1 deletion.