Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1302682
| From | Luis Henriques <luis.henriques@canonical.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 3.16.y-ckt 029/126] packet: do skb_probe_transport_header when we actually have data |
| Date | 2016-01-06 12:20 +0100 |
| Message-ID | <qNUig-nA-67@gated-at.bofh.it> (permalink) |
| References | <qNTFw-8jf-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
3.16.7-ckt22 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Borkmann <daniel@iogearbox.net>
commit efdfa2f7848f64517008136fb41f53c4a1faf93a upstream.
In tpacket_fill_skb() commit c1aad275b029 ("packet: set transport
header before doing xmit") and later on 40893fd0fd4e ("net: switch
to use skb_probe_transport_header()") was probing for a transport
header on the skb from a ring buffer slot, but at a time, where
the skb has _not even_ been filled with data yet. So that call into
the flow dissector is pretty useless. Lets do it after we've set
up the skb frags.
Fixes: c1aad275b029 ("packet: set transport header before doing xmit")
Reported-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
net/packet/af_packet.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 1f618bbce0ac..fc94622f755c 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -2127,8 +2127,6 @@ static int tpacket_fill_skb(struct packet_sock *po, struct sk_buff *skb,
skb_reserve(skb, hlen);
skb_reset_network_header(skb);
- if (!packet_use_direct_xmit(po))
- skb_probe_transport_header(skb, 0);
if (unlikely(po->tp_tx_has_off)) {
int off_min, off_max, off;
off_min = po->tp_hdrlen - sizeof(struct sockaddr_ll);
@@ -2212,6 +2210,9 @@ static int tpacket_fill_skb(struct packet_sock *po, struct sk_buff *skb,
len = ((to_write > len_max) ? len_max : to_write);
}
+ if (!packet_use_direct_xmit(po))
+ skb_probe_transport_header(skb, 0);
+
return tp_len;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[3.16.y-ckt stable] Linux 3.16.7-ckt22 stable review Luis Henriques <luis.henriques@canonical.com> - 2016-01-06 12:20 +0100 [PATCH 3.16.y-ckt 009/126] USB: serial: option: add support for Novatel MiFi USB620L Luis Henriques <luis.henriques@canonical.com> - 2016-01-06 12:20 +0100 [PATCH 3.16.y-ckt 015/126] usb: dwc3: gadget: let us set lower max_speed Luis Henriques <luis.henriques@canonical.com> - 2016-01-06 12:20 +0100 [PATCH 3.16.y-ckt 007/126] drm/i915: quirk backlight present on Macbook 4, 1 Luis Henriques <luis.henriques@canonical.com> - 2016-01-06 12:20 +0100 [PATCH 3.16.y-ckt 032/126] sctp: translate host order to network order when setting a hmacid Luis Henriques <luis.henriques@canonical.com> - 2016-01-06 12:20 +0100 [PATCH 3.16.y-ckt 001/126] iio: lpc32xx_adc: fix warnings caused by enabling unprepared clock Luis Henriques <luis.henriques@canonical.com> - 2016-01-06 12:20 +0100 [PATCH 3.16.y-ckt 038/126] unix: avoid use-after-free in ep_remove_wait_queue Luis Henriques <luis.henriques@canonical.com> - 2016-01-06 12:20 +0100 [PATCH 3.16.y-ckt 034/126] usb: musb: core: fix order of arguments to ulpi write callback Luis Henriques <luis.henriques@canonical.com> - 2016-01-06 12:20 +0100 [PATCH 3.16.y-ckt 027/126] mmc: remove bondage between REQ_META and reliable write Luis Henriques <luis.henriques@canonical.com> - 2016-01-06 12:20 +0100 [PATCH 3.16.y-ckt 006/126] iio: adc: xilinx: Fix VREFN scale Luis Henriques <luis.henriques@canonical.com> - 2016-01-06 12:20 +0100 [PATCH 3.16.y-ckt 035/126] FS-Cache: Add missing initialization of ret in cachefiles_write_page() Luis Henriques <luis.henriques@canonical.com> - 2016-01-06 12:20 +0100 [PATCH 3.16.y-ckt 013/126] USB: qcserial: Fix support for HP lt4112 LTE/HSPA+ Gobi 4G Modem Luis Henriques <luis.henriques@canonical.com> - 2016-01-06 12:20 +0100 [PATCH 3.16.y-ckt 004/126] iio:ad7793: Fix ad7785 product ID Luis Henriques <luis.henriques@canonical.com> - 2016-01-06 12:20 +0100 [PATCH 3.16.y-ckt 023/126] fat: fix fake_offset handling on error path Luis Henriques <luis.henriques@canonical.com> - 2016-01-06 12:20 +0100 [PATCH 3.16.y-ckt 019/126] x86/cpu: Fix SMAP check in PVOPS environments Luis Henriques <luis.henriques@canonical.com> - 2016-01-06 12:20 +0100 [PATCH 3.16.y-ckt 003/126] iio: ad5064: Fix ad5629/ad5669 shift Luis Henriques <luis.henriques@canonical.com> - 2016-01-06 12:20 +0100 [PATCH 3.16.y-ckt 010/126] USB: ti_usb_3410_5052: Add Honeywell HGI80 ID Luis Henriques <luis.henriques@canonical.com> - 2016-01-06 12:20 +0100 [PATCH 3.16.y-ckt 016/126] usb: chipidea: debug: disable usb irq while role switch Luis Henriques <luis.henriques@canonical.com> - 2016-01-06 12:20 +0100 [PATCH 3.16.y-ckt 029/126] packet: do skb_probe_transport_header when we actually have data Luis Henriques <luis.henriques@canonical.com> - 2016-01-06 12:20 +0100 [PATCH 3.16.y-ckt 030/126] packet: only allow extra vlan len on ethernet devices Luis Henriques <luis.henriques@canonical.com> - 2016-01-06 12:20 +0100 [PATCH 3.16.y-ckt 018/126] xhci: Fix a race in usb2 LPM resume, blocking U3 for usb2 devices Luis Henriques <luis.henriques@canonical.com> - 2016-01-06 12:20 +0100 [PATCH 3.16.y-ckt 005/126] x86/fpu: Fix 32-bit signal frame handling Luis Henriques <luis.henriques@canonical.com> - 2016-01-06 12:20 +0100 [PATCH 3.16.y-ckt 011/126] drm/i915: get runtime PM reference around GEM set_caching IOCTL Luis Henriques <luis.henriques@canonical.com> - 2016-01-06 12:20 +0100 [PATCH 3.16.y-ckt 020/126] arm64: restore bogomips information in /proc/cpuinfo Luis Henriques <luis.henriques@canonical.com> - 2016-01-06 12:20 +0100 [PATCH 3.16.y-ckt 002/126] iio:ad5064: Make sure ad5064_i2c_write() returns 0 on success Luis Henriques <luis.henriques@canonical.com> - 2016-01-06 12:30 +0100
csiph-web