]> git.baikalelectronics.ru Git - kernel.git/commit
packet: fix panic in __packet_set_timestamp on tpacket_v3 in tx mode
authorDaniel Borkmann <daniel@iogearbox.net>
Thu, 5 Jan 2017 01:34:28 +0000 (02:34 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 5 Jan 2017 04:55:42 +0000 (23:55 -0500)
commitc88b059823fae1aaf047b2c30ffab2dfe96b2f85
tree3903d94507481ffceb4514f46233141f4fc82ded
parent5f2684f5b73a2ec9fb8797863afa193371c377c9
packet: fix panic in __packet_set_timestamp on tpacket_v3 in tx mode

When TX timestamping is in use with TPACKET_V3's TX ring, then we'll
hit the BUG() in __packet_set_timestamp() when ring buffer slot is
returned to user space via tpacket_destruct_skb(). This is due to v3
being assumed as unreachable here, but since e51da4d6d3ed ("af_packet:
TX_RING support for TPACKET_V3") it's not anymore. Fix it by filling
the timestamp back into the ring slot.

Fixes: e51da4d6d3ed ("af_packet: TX_RING support for TPACKET_V3")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/packet/af_packet.c