-
Notifications
You must be signed in to change notification settings - Fork 866
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SLL=>SLL2: regression on VLAN tagging #1105
Comments
Yes. The reason is "that annoying piece of software called the Linux kernel does special handling with VLANs, so that the VLAN tag gets extracted into skbuff metadata and, instead of reinserting the tags back into the packet before handing it to the socket filter and
Because the packet should appear as a VLAN packet, with the appropriate value in the Ethertype, i.e. 0x8100. |
Ok, I understand why the kernel sets the tag aside ; what I'm wondering about is why not hide that complexity from the SLLv[12] observers, by shuffling a few bytes around so that the frame is sent to them as it appeared on the wire ? |
To which observers are you referring? We can't do that for live capture filters except by submitting a kernel patch. We can do that once we receive a packet, before delivering it to the callback, and that's what our code is attempting to do. There's probably a bug in the code that does that for SLL2. |
Yes, I was referring to the callback side :) Note that for the single-VLAN case, the bug amounts to a mere permutation, no information is lost (I verified this by fixing it in post-processing of SLL2 output). But for the multiple-VLAN/QinQ case, things get murky, and the second VLAN is lost (and was in SLL1 too). Is there a deep reason, or is this fixable too ? |
The SLL2 code may still have some bits of SLL code in it, putting things in the wrong places.
The "any" device uses If it used With pcapng, the capture could include multiple Interface Description Blocks, with each packet having an interface ID referring to the interface on which they arrived, which would remove the "new link-layer type" problem. It would still require more complicated filtering when doing live captures, with BPF programs having to, for example, fetch the link-layer type before doing any link-layer checks such as MAC address checks, and either having to calculate the offset of the network-layer header from that or fetch it if supplied as metadata detachable with BPF (which I think it is). For pcapng files, there could be separate user-mode filter programs, one per interface (with an optimization being to allow interfaces sharing the same link-layer type to share the program). The current filter compiler probably can't be easily change to generate those "multiple link-layer" programs; something that compiles the filter into an abstract form that's independent of the link-layer type, and that can then either turn that into a "multiple-link-layer program" or into a program for a specific link-layer type, might make it easier. |
Thanks for giving the perspective for "any". However, when capturing a single device like "eth1", the whole frame is passed untouched, and indeed any BPF filter needing to "dig deep" must do so explicitly, without relying on some magical L2-stripping. For example, if we create eth1.24.68 with nested tags 24 and 68, an udp filter on the parent interface eth1 must look like "vlan 24 and vlan 68 and udp", while "udp" won't work. Similarly, we routinely filter across fixed-depth MPLS stacks, or even through other non-pcapfilter-supported encapsulations like GTP, by using hand-computed offsets and "ether[OFFSET]&MASK=VALUE". The generated BPF bytecode of JIT assembler works just as fast, it is only slightly uglier as a syntax :) My point is that it is perfectly acceptable for a single interface, so the "tricky BPF" argument doesn't hold there; is it different for "any" ? |
It's passed untouched from libpcap to the code using libpcap. If it's a VLAN-tagged frame, however, it is not passed untouched from the kernel to libpcap; the VLAN tagged are stripped, even when capturing on a
The "any" device is, currently, best thought of as a supplier of network-layer traffic, not link-layer traffic. You don't get the full link-layer header, so any filters at a lower-level aren't meaningful - there's nothing to "dig deep" through.
Support for which should probably be added to libpcap for filtering (there might even be a PR for it somewhere).
Because a single interface has a single link-layer type, whereas the "any" device provides packets from all network interfaces, and there's no guarantee that there is a single-link-layer type for all of the interfaces - and, even if it's true at the time the capture starts, it's not guaranteed to remain true. If, for example, a PPP session is initiated, a new PPP interface may pop up, and it's not guaranteed to have a link-layer type of "Ethernet" (Linux not being Windows :-)). That's why the "any" device is currently a supplier of "network-layer" traffic. Changing it to use And, in that case, |
I can't see anything in our current version of libpcap that would cause VLAN tag insertion for SLL2 at all; in Perhaps the version of libpcap you're using has an "improvement" to insert tags for SLL2, written by somebody who didn't understand the code well enough to realize that, unfortunately, the code was originally written for Ethernet (where the type field is at the end of the link-layer header, so you just move the last 2 bytes of the link-layer header down 4 bytes and drop in the VLAN header), and modified for SLL2 (where the type field is again at the end of the link-layer header), and therefore that, to handle SLL2 (where the type field is at the beginning of the link-layer header), you have to change the code to do the insertion differently. What version of what Linux distribution are you using? Perhaps they inserted a bug with an "improvement" such as that. |
Thanks, indeed seeing "any" as a provider of network-layer traffic is the key. Somehow that was not obvious from the name.
|
We are observing this on current Debian stable (11.3):
|
That's... odd, as I downloaded the libpcap source package's set of Debian files and couldn't find any patch that would cause it to insert VLAN tags for SLL2. I'll check again, and ignore the names of the patches, and also download the "unmodified source tarball" file. |
Either I've really missed something, or there's nothing in the Debian source package to cause it to try to insert VLAN tags for SLL2. Could you try it with the current 1.10.1 release (and tcpdump 4.99.1 release, built with that release) from www.tcpdump.org? |
some debian specific kernel patch?
|
Just done so, same results. Reproducing steps: $ ip link add link wlan0 wlan0.24 type vlan id 24
$ ifconfig wlan0.24 1.0.24.1/24
$ ping -n 1.0.24.3 > /dev/null 2>&1 &
$ tcpdump.4.99.1 -nn -i any -Q out not tcp and not udp
tcpdump.4.99.1: data link type LINUX_SLL2
tcpdump.4.99.1: verbose output suppressed, use -v[v]... for full protocol decode
listening on any, link-type LINUX_SLL2 (Linux cooked v2), snapshot length 262144 bytes
16:14:02.771986 wlan0.24 Out ARP, Request who-has 1.0.24.3 tell 1.0.24.1, length 28
16:14:02.771993 wlan0 Out ethertype IPv4, IP0 (invalid) #<==== THE ANNOYING ONES
16:14:03.795923 wlan0.24 Out ARP, Request who-has 1.0.24.3 tell 1.0.24.1, length 28
16:14:03.795931 wlan0 Out ethertype IPv4, IP0 (invalid) #<==== THE ANNOYING ONES
16:14:04.819719 wlan0.24 Out ARP, Request who-has 1.0.24.3 tell 1.0.24.1, length 28
16:14:04.819724 wlan0 Out ethertype IPv4, IP0 (invalid) #<==== THE ANNOYING ONES
^C Note tcpdump.4.99.1 is statically linked with just-compiled libpcap.a: $ ldd `which tcpdump.4.99.1`
linux-vdso.so.1 (0x00007ffec0711000)
libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007eff06245000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007eff06080000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007eff0605e000)
libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007eff05fb6000)
/lib64/ld-linux-x86-64.so.2 (0x00007eff0658a000)
libcap.so.2 => /lib/x86_64-linux-gnu/libcap.so.2 (0x00007eff05fab000)
Kernel details: ii linux-image-5.10.0-10-amd64 5.10.84-1 amd64 Linux 5.10 for 64-bit PCs (signed)
$ uname -a
Linux hpalex 5.10.0-10-amd64 #1 SMP Debian 5.10.84-1 (2021-12-08) x86_64 GNU/Linux
|
Unfortunately, I couldn't set up a VLAN on the bridge adapter that appears to implement communication between my VMware Fusion virtual machines and my Mac, so I couldn't test it myself. Please apply the attached patch to pcap-linux.c in the libpcap 1.10.1 source, recompile and rebuild tcpdump with the new library, and see what it prints to the standard error. |
DLT_LINUX_SLL: set vlan_offset to 14
tcpdump.4.99.1: data link type LINUX_SLL2
tcpdump.4.99.1: verbose output suppressed, use -v[v]... for full protocol decode
listening on any, link-type LINUX_SLL2 (Linux cooked v2), snapshot length 262144 bytes Re your setup: please note that you don't need a working end-to-end VLAN; just like I did with |
The change to the linktype might change the offset at which to insert VLAN tags (or change it to -1, meaning "don't insert VLAN tags"). This should fix issue #1105.
Thanks! That worked - with tcpdump built with a libpcap prior to 4bfca36, it got bogus packets on the VLAN interface, but with a tcpdump built with a libpcap after 4bfca36, it got normal packets. That fix should be in whatever release is the next libpcap release. |
OK, in the git log I see you've just committed this, so I cloned and compiled HEAD of both libpcap and tcpdump. static void
set_vlan_offset(pcap_t *handle)
{
...
switch (handle->linktype) {
case DLT_EN10MB:
...
case DLT_LINUX_SLL:
....
default:
...
} |
OK, try this patch to pcap-linux.c, which adds the same debugging printouts that the previous patch did, and which helped me find the problem in the first place:
Yes. To handle SLL2 would require significant changes to the tag inserting code in
so that you have:
Then make sure that all SLL2 dissectors support that. (It looks as if tcpdump's SLL2 dissector will. I haven't checked Wireshark, but if it assumes that, after the 0x8100, you have a TCI followed by the payload's Ethertype, it'll work.) However, given that if you have QinQ, the second tag will, I expect, not be provided by the kernel, a case could be made that SLL2 and SLL shouldn't provide tags. The SLL handling of VLAN tags came from this bug. My first fix was 4cc089d, which caused tags not to be inserted for SLL; I then committed 3f53c50, which "[Used] Jakub Zawadzki's changes for that, but put the VLAN tag offset into the pcap structure and [calculated] it at activation time." In retrospect, if additional tags aren't provided on cooked-mode sockets, perhaps they shouldn't be inserted on cooked-mode captures, even for SLL. |
Stderr from the patch: DLT_LINUX_SLL: set vlan_offset to 14
LINUX_SLL2: set vlan_offset to -1
tcpdump.HEAD.patch: data link type LINUX_SLL2
tcpdump.HEAD.patch: verbose output suppressed, use -v[v]... for full protocol decode
listening on any, link-type LINUX_SLL2 (Linux cooked v2), snapshot length 262144 bytes |
One side note: in case you want to try QinQ, the same "VM-side only" trick as before does the job: ip link add link wlan0.24 wlan0.24.68 type vlan id 68
ifconfig wlan0.24.68 1.0.68.1/24
ping -n 1.0.68.3 > /dev/null 2>&1 & In this case, each packet should come out thrice: once for |
OK, so that means that, after tcpdump changes the link-layer type to
So it's not reporting any messages that indicate that it's inserting VLAN tags. Are you sure it's still changing the packet contents? If so, could you attach a capturing using that code? |
Here you go: contents: 10:20:10.749051 wlan0.24 Out ARP, Request who-has 1.0.24.3 tell 1.0.24.1, length 28
10:20:10.749058 wlan0 Out ethertype IPv4, IP0 (invalid)
10:20:11.773037 wlan0.24 Out ARP, Request who-has 1.0.24.3 tell 1.0.24.1, length 28
10:20:11.773042 wlan0 Out ethertype IPv4, IP0 (invalid)
10:20:12.796985 wlan0.24 Out ARP, Request who-has 1.0.24.3 tell 1.0.24.1, length 28
10:20:12.796993 wlan0 Out ethertype IPv4, IP0 (invalid) Looking into the bytes, I see that the patch did change the layout, so there is no longer any tag insertion, but still the packets on the parent interface (even-numbered packets above) are invalid, because the "protocol" field is set to 0x8100, while the rest of the header and frame are identical (except for interface number of course) to those on the subinterface (odd-numbered packets above):
So what's missing is just the actual reinsertion of the tag (0018) +protocol (0806) : to become valid, that packet should be:
|
In today's episode of "I hate the Linux networking stack", I set up a Debian 11.3.0 VM, with a 5.10.0-13-amd64 kernel, built top-of-the-main branch libpcap and tcpdump, set up two layers of VLAN interface (boring packet statistics removed):
started up 4 tcpdumps:
and then ran According to Wireshark's reading of all four of those files, at around 2022-04-11 22:19.00.273149: In the SLL2 "any" capture, I see:
In the SLL "any" capture, I see The. Exact. Same. Thing. One ICMPv6 Router Solicitation, and what looks like mangled versions of the same thing - the Protocol field is obviously in a different location in the SLL header, and the SLL header has no interface ID, so the only difference is that the two mangled packets have 0x8100 rather than 0x86dd in the Protocol field. In the ens33.10.68 capture - which is raw, not cooked, so I get the "full" link-layer header, albeit without any VLAN tags as they were removed in the reception process - I get the ICMPv4 Router Solicitation, at 2022-04-11 22:19:00.273150. In the ens33 capture - again, raw, not cooked, and the VLAN tags should all be there, as that's not a VLAN interface - I get the ICMPv6 Router Solicitation, with two layers of VLAN tag, one for the ID 10 VLAN and one for the ID 68 VLAN, at 2022-04-11 22:19:00.273157. My brain wasn't fully engaged, so I didn't do an ens33.10 capture, but I will bet a silk pajama that I would have gotten an ICMPv6 Router Solicitation, with one layer of VLAN tag, for the ID 68 VLAN, at about that time, in such a capture. So, somehow, the 0x86ddness of that packet is getting lost somewhere between the adapter driver and tcpdump, whether it's in the networking stack below the |
A quick experiment found that, for at least one packet received on the "any" device, the protocol supplied in the recvfrom address and the protocol in the VLAN auxiliary data are both 0x8100. Either there's an 0x86dd, or some other real Ethertype value corresponding to IPv4 or ARP or IPv6 or... hidden somewhere that a |
Two comments about VLAN+cooked not working together: |
Prior to f4a26d7, pcap-linux.c did
That change removed support for The
stuff was also removed, but it shouldn't have been removed. The We no longer support kernels prior to 2.6.27; the 2.6.27 kernel defined |
However, it appears that the memory-mapped receive code path in the kernel doesn't test whether |
commit 79eecf631c14e7f4057186570ac20e2cfac3802e upstream. The issue initially stems from libpcap. The ethertype will be overwritten as the VLAN TPID if the network interface lacks hardware VLAN offloading. In the outbound packet path, if hardware VLAN offloading is unavailable, the VLAN tag is inserted into the payload but then cleared from the sk_buff struct. Consequently, this can lead to a false negative when checking for the presence of a VLAN tag, causing the packet sniffing outcome to lack VLAN tag information (i.e., TCI-TPID). As a result, the packet capturing tool may be unable to parse packets as expected. The TCI-TPID is missing because the prb_fill_vlan_info() function does not modify the tp_vlan_tci/tp_vlan_tpid values, as the information is in the payload and not in the sk_buff struct. The skb_vlan_tag_present() function only checks vlan_all in the sk_buff struct. In cooked mode, the L2 header is stripped, preventing the packet capturing tool from determining the correct TCI-TPID value. Additionally, the protocol in SLL is incorrect, which means the packet capturing tool cannot parse the L3 header correctly. Link: the-tcpdump-group/libpcap#1105 Link: https://lore.kernel.org/netdev/[email protected]/T/#u Fixes: 393e52e ("packet: deliver VLAN TCI to userspace") Cc: [email protected] Signed-off-by: Chengen Du <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit 3dfd84aa72fa7329ed4a257c8f40e0c9aff4dc8f) Signed-off-by: Vegard Nossum <[email protected]>
commit 79eecf631c14e7f4057186570ac20e2cfac3802e upstream. The issue initially stems from libpcap. The ethertype will be overwritten as the VLAN TPID if the network interface lacks hardware VLAN offloading. In the outbound packet path, if hardware VLAN offloading is unavailable, the VLAN tag is inserted into the payload but then cleared from the sk_buff struct. Consequently, this can lead to a false negative when checking for the presence of a VLAN tag, causing the packet sniffing outcome to lack VLAN tag information (i.e., TCI-TPID). As a result, the packet capturing tool may be unable to parse packets as expected. The TCI-TPID is missing because the prb_fill_vlan_info() function does not modify the tp_vlan_tci/tp_vlan_tpid values, as the information is in the payload and not in the sk_buff struct. The skb_vlan_tag_present() function only checks vlan_all in the sk_buff struct. In cooked mode, the L2 header is stripped, preventing the packet capturing tool from determining the correct TCI-TPID value. Additionally, the protocol in SLL is incorrect, which means the packet capturing tool cannot parse the L3 header correctly. Link: the-tcpdump-group/libpcap#1105 Link: https://lore.kernel.org/netdev/[email protected]/T/#u Fixes: 393e52e ("packet: deliver VLAN TCI to userspace") Cc: [email protected] Signed-off-by: Chengen Du <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
commit 79eecf631c14e7f4057186570ac20e2cfac3802e upstream. The issue initially stems from libpcap. The ethertype will be overwritten as the VLAN TPID if the network interface lacks hardware VLAN offloading. In the outbound packet path, if hardware VLAN offloading is unavailable, the VLAN tag is inserted into the payload but then cleared from the sk_buff struct. Consequently, this can lead to a false negative when checking for the presence of a VLAN tag, causing the packet sniffing outcome to lack VLAN tag information (i.e., TCI-TPID). As a result, the packet capturing tool may be unable to parse packets as expected. The TCI-TPID is missing because the prb_fill_vlan_info() function does not modify the tp_vlan_tci/tp_vlan_tpid values, as the information is in the payload and not in the sk_buff struct. The skb_vlan_tag_present() function only checks vlan_all in the sk_buff struct. In cooked mode, the L2 header is stripped, preventing the packet capturing tool from determining the correct TCI-TPID value. Additionally, the protocol in SLL is incorrect, which means the packet capturing tool cannot parse the L3 header correctly. Link: the-tcpdump-group/libpcap#1105 Link: https://lore.kernel.org/netdev/[email protected]/T/#u Fixes: 393e52e33c6c ("packet: deliver VLAN TCI to userspace") Cc: [email protected] Signed-off-by: Chengen Du <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit 3dfd84aa72fa7329ed4a257c8f40e0c9aff4dc8f) Signed-off-by: Vegard Nossum <[email protected]>
commit 79eecf631c14e7f4057186570ac20e2cfac3802e upstream. The issue initially stems from libpcap. The ethertype will be overwritten as the VLAN TPID if the network interface lacks hardware VLAN offloading. In the outbound packet path, if hardware VLAN offloading is unavailable, the VLAN tag is inserted into the payload but then cleared from the sk_buff struct. Consequently, this can lead to a false negative when checking for the presence of a VLAN tag, causing the packet sniffing outcome to lack VLAN tag information (i.e., TCI-TPID). As a result, the packet capturing tool may be unable to parse packets as expected. The TCI-TPID is missing because the prb_fill_vlan_info() function does not modify the tp_vlan_tci/tp_vlan_tpid values, as the information is in the payload and not in the sk_buff struct. The skb_vlan_tag_present() function only checks vlan_all in the sk_buff struct. In cooked mode, the L2 header is stripped, preventing the packet capturing tool from determining the correct TCI-TPID value. Additionally, the protocol in SLL is incorrect, which means the packet capturing tool cannot parse the L3 header correctly. Link: the-tcpdump-group/libpcap#1105 Link: https://lore.kernel.org/netdev/[email protected]/T/#u Fixes: 393e52e ("packet: deliver VLAN TCI to userspace") Cc: [email protected] Signed-off-by: Chengen Du <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit 3dfd84aa72fa7329ed4a257c8f40e0c9aff4dc8f) Signed-off-by: Vegard Nossum <[email protected]>
commit 79eecf631c14e7f4057186570ac20e2cfac3802e upstream. The issue initially stems from libpcap. The ethertype will be overwritten as the VLAN TPID if the network interface lacks hardware VLAN offloading. In the outbound packet path, if hardware VLAN offloading is unavailable, the VLAN tag is inserted into the payload but then cleared from the sk_buff struct. Consequently, this can lead to a false negative when checking for the presence of a VLAN tag, causing the packet sniffing outcome to lack VLAN tag information (i.e., TCI-TPID). As a result, the packet capturing tool may be unable to parse packets as expected. The TCI-TPID is missing because the prb_fill_vlan_info() function does not modify the tp_vlan_tci/tp_vlan_tpid values, as the information is in the payload and not in the sk_buff struct. The skb_vlan_tag_present() function only checks vlan_all in the sk_buff struct. In cooked mode, the L2 header is stripped, preventing the packet capturing tool from determining the correct TCI-TPID value. Additionally, the protocol in SLL is incorrect, which means the packet capturing tool cannot parse the L3 header correctly. Link: the-tcpdump-group/libpcap#1105 Link: https://lore.kernel.org/netdev/[email protected]/T/#u Fixes: 393e52e ("packet: deliver VLAN TCI to userspace") Cc: [email protected] Signed-off-by: Chengen Du <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit 3dfd84aa72fa7329ed4a257c8f40e0c9aff4dc8f) Signed-off-by: Vegard Nossum <[email protected]>
commit 79eecf631c14e7f4057186570ac20e2cfac3802e upstream. The issue initially stems from libpcap. The ethertype will be overwritten as the VLAN TPID if the network interface lacks hardware VLAN offloading. In the outbound packet path, if hardware VLAN offloading is unavailable, the VLAN tag is inserted into the payload but then cleared from the sk_buff struct. Consequently, this can lead to a false negative when checking for the presence of a VLAN tag, causing the packet sniffing outcome to lack VLAN tag information (i.e., TCI-TPID). As a result, the packet capturing tool may be unable to parse packets as expected. The TCI-TPID is missing because the prb_fill_vlan_info() function does not modify the tp_vlan_tci/tp_vlan_tpid values, as the information is in the payload and not in the sk_buff struct. The skb_vlan_tag_present() function only checks vlan_all in the sk_buff struct. In cooked mode, the L2 header is stripped, preventing the packet capturing tool from determining the correct TCI-TPID value. Additionally, the protocol in SLL is incorrect, which means the packet capturing tool cannot parse the L3 header correctly. Link: the-tcpdump-group/libpcap#1105 Link: https://lore.kernel.org/netdev/[email protected]/T/#u Fixes: 393e52e ("packet: deliver VLAN TCI to userspace") Cc: [email protected] Signed-off-by: Chengen Du <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit 3dfd84aa72fa7329ed4a257c8f40e0c9aff4dc8f) Signed-off-by: Vegard Nossum <[email protected]>
commit 79eecf631c14e7f4057186570ac20e2cfac3802e upstream. The issue initially stems from libpcap. The ethertype will be overwritten as the VLAN TPID if the network interface lacks hardware VLAN offloading. In the outbound packet path, if hardware VLAN offloading is unavailable, the VLAN tag is inserted into the payload but then cleared from the sk_buff struct. Consequently, this can lead to a false negative when checking for the presence of a VLAN tag, causing the packet sniffing outcome to lack VLAN tag information (i.e., TCI-TPID). As a result, the packet capturing tool may be unable to parse packets as expected. The TCI-TPID is missing because the prb_fill_vlan_info() function does not modify the tp_vlan_tci/tp_vlan_tpid values, as the information is in the payload and not in the sk_buff struct. The skb_vlan_tag_present() function only checks vlan_all in the sk_buff struct. In cooked mode, the L2 header is stripped, preventing the packet capturing tool from determining the correct TCI-TPID value. Additionally, the protocol in SLL is incorrect, which means the packet capturing tool cannot parse the L3 header correctly. Link: the-tcpdump-group/libpcap#1105 Link: https://lore.kernel.org/netdev/[email protected]/T/#u Fixes: 393e52e ("packet: deliver VLAN TCI to userspace") Cc: [email protected] Signed-off-by: Chengen Du <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit 3dfd84aa72fa7329ed4a257c8f40e0c9aff4dc8f) Signed-off-by: Vegard Nossum <[email protected]>
commit 79eecf631c14e7f4057186570ac20e2cfac3802e upstream. The issue initially stems from libpcap. The ethertype will be overwritten as the VLAN TPID if the network interface lacks hardware VLAN offloading. In the outbound packet path, if hardware VLAN offloading is unavailable, the VLAN tag is inserted into the payload but then cleared from the sk_buff struct. Consequently, this can lead to a false negative when checking for the presence of a VLAN tag, causing the packet sniffing outcome to lack VLAN tag information (i.e., TCI-TPID). As a result, the packet capturing tool may be unable to parse packets as expected. The TCI-TPID is missing because the prb_fill_vlan_info() function does not modify the tp_vlan_tci/tp_vlan_tpid values, as the information is in the payload and not in the sk_buff struct. The skb_vlan_tag_present() function only checks vlan_all in the sk_buff struct. In cooked mode, the L2 header is stripped, preventing the packet capturing tool from determining the correct TCI-TPID value. Additionally, the protocol in SLL is incorrect, which means the packet capturing tool cannot parse the L3 header correctly. Link: the-tcpdump-group/libpcap#1105 Link: https://lore.kernel.org/netdev/[email protected]/T/#u Fixes: 393e52e ("packet: deliver VLAN TCI to userspace") Cc: [email protected] Signed-off-by: Chengen Du <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit 3dfd84aa72fa7329ed4a257c8f40e0c9aff4dc8f) Signed-off-by: Vegard Nossum <[email protected]> Signed-off-by: build-13 <[email protected]>
commit 79eecf631c14e7f4057186570ac20e2cfac3802e upstream. The issue initially stems from libpcap. The ethertype will be overwritten as the VLAN TPID if the network interface lacks hardware VLAN offloading. In the outbound packet path, if hardware VLAN offloading is unavailable, the VLAN tag is inserted into the payload but then cleared from the sk_buff struct. Consequently, this can lead to a false negative when checking for the presence of a VLAN tag, causing the packet sniffing outcome to lack VLAN tag information (i.e., TCI-TPID). As a result, the packet capturing tool may be unable to parse packets as expected. The TCI-TPID is missing because the prb_fill_vlan_info() function does not modify the tp_vlan_tci/tp_vlan_tpid values, as the information is in the payload and not in the sk_buff struct. The skb_vlan_tag_present() function only checks vlan_all in the sk_buff struct. In cooked mode, the L2 header is stripped, preventing the packet capturing tool from determining the correct TCI-TPID value. Additionally, the protocol in SLL is incorrect, which means the packet capturing tool cannot parse the L3 header correctly. Link: the-tcpdump-group/libpcap#1105 Link: https://lore.kernel.org/netdev/[email protected]/T/#u Fixes: 393e52e ("packet: deliver VLAN TCI to userspace") Cc: [email protected] Signed-off-by: Chengen Du <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit 3dfd84aa72fa7329ed4a257c8f40e0c9aff4dc8f) Signed-off-by: Vegard Nossum <[email protected]>
commit 79eecf631c14e7f4057186570ac20e2cfac3802e upstream. The issue initially stems from libpcap. The ethertype will be overwritten as the VLAN TPID if the network interface lacks hardware VLAN offloading. In the outbound packet path, if hardware VLAN offloading is unavailable, the VLAN tag is inserted into the payload but then cleared from the sk_buff struct. Consequently, this can lead to a false negative when checking for the presence of a VLAN tag, causing the packet sniffing outcome to lack VLAN tag information (i.e., TCI-TPID). As a result, the packet capturing tool may be unable to parse packets as expected. The TCI-TPID is missing because the prb_fill_vlan_info() function does not modify the tp_vlan_tci/tp_vlan_tpid values, as the information is in the payload and not in the sk_buff struct. The skb_vlan_tag_present() function only checks vlan_all in the sk_buff struct. In cooked mode, the L2 header is stripped, preventing the packet capturing tool from determining the correct TCI-TPID value. Additionally, the protocol in SLL is incorrect, which means the packet capturing tool cannot parse the L3 header correctly. Link: the-tcpdump-group/libpcap#1105 Link: https://lore.kernel.org/netdev/[email protected]/T/#u Fixes: 393e52e ("packet: deliver VLAN TCI to userspace") Cc: [email protected] Signed-off-by: Chengen Du <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit 3dfd84aa72fa7329ed4a257c8f40e0c9aff4dc8f) Signed-off-by: Vegard Nossum <[email protected]>
commit 79eecf631c14e7f4057186570ac20e2cfac3802e upstream. The issue initially stems from libpcap. The ethertype will be overwritten as the VLAN TPID if the network interface lacks hardware VLAN offloading. In the outbound packet path, if hardware VLAN offloading is unavailable, the VLAN tag is inserted into the payload but then cleared from the sk_buff struct. Consequently, this can lead to a false negative when checking for the presence of a VLAN tag, causing the packet sniffing outcome to lack VLAN tag information (i.e., TCI-TPID). As a result, the packet capturing tool may be unable to parse packets as expected. The TCI-TPID is missing because the prb_fill_vlan_info() function does not modify the tp_vlan_tci/tp_vlan_tpid values, as the information is in the payload and not in the sk_buff struct. The skb_vlan_tag_present() function only checks vlan_all in the sk_buff struct. In cooked mode, the L2 header is stripped, preventing the packet capturing tool from determining the correct TCI-TPID value. Additionally, the protocol in SLL is incorrect, which means the packet capturing tool cannot parse the L3 header correctly. Link: the-tcpdump-group/libpcap#1105 Link: https://lore.kernel.org/netdev/[email protected]/T/#u Fixes: 393e52e ("packet: deliver VLAN TCI to userspace") Cc: [email protected] Signed-off-by: Chengen Du <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit 3dfd84aa72fa7329ed4a257c8f40e0c9aff4dc8f) Signed-off-by: Vegard Nossum <[email protected]>
commit 79eecf631c14e7f4057186570ac20e2cfac3802e upstream. The issue initially stems from libpcap. The ethertype will be overwritten as the VLAN TPID if the network interface lacks hardware VLAN offloading. In the outbound packet path, if hardware VLAN offloading is unavailable, the VLAN tag is inserted into the payload but then cleared from the sk_buff struct. Consequently, this can lead to a false negative when checking for the presence of a VLAN tag, causing the packet sniffing outcome to lack VLAN tag information (i.e., TCI-TPID). As a result, the packet capturing tool may be unable to parse packets as expected. The TCI-TPID is missing because the prb_fill_vlan_info() function does not modify the tp_vlan_tci/tp_vlan_tpid values, as the information is in the payload and not in the sk_buff struct. The skb_vlan_tag_present() function only checks vlan_all in the sk_buff struct. In cooked mode, the L2 header is stripped, preventing the packet capturing tool from determining the correct TCI-TPID value. Additionally, the protocol in SLL is incorrect, which means the packet capturing tool cannot parse the L3 header correctly. Link: the-tcpdump-group/libpcap#1105 Link: https://lore.kernel.org/netdev/[email protected]/T/#u Fixes: 393e52e ("packet: deliver VLAN TCI to userspace") Cc: [email protected] Signed-off-by: Chengen Du <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
commit 79eecf631c14e7f4057186570ac20e2cfac3802e upstream. The issue initially stems from libpcap. The ethertype will be overwritten as the VLAN TPID if the network interface lacks hardware VLAN offloading. In the outbound packet path, if hardware VLAN offloading is unavailable, the VLAN tag is inserted into the payload but then cleared from the sk_buff struct. Consequently, this can lead to a false negative when checking for the presence of a VLAN tag, causing the packet sniffing outcome to lack VLAN tag information (i.e., TCI-TPID). As a result, the packet capturing tool may be unable to parse packets as expected. The TCI-TPID is missing because the prb_fill_vlan_info() function does not modify the tp_vlan_tci/tp_vlan_tpid values, as the information is in the payload and not in the sk_buff struct. The skb_vlan_tag_present() function only checks vlan_all in the sk_buff struct. In cooked mode, the L2 header is stripped, preventing the packet capturing tool from determining the correct TCI-TPID value. Additionally, the protocol in SLL is incorrect, which means the packet capturing tool cannot parse the L3 header correctly. Link: the-tcpdump-group/libpcap#1105 Link: https://lore.kernel.org/netdev/[email protected]/T/#u Fixes: 393e52e ("packet: deliver VLAN TCI to userspace") Cc: [email protected] Signed-off-by: Chengen Du <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
commit 79eecf631c14e7f4057186570ac20e2cfac3802e upstream. The issue initially stems from libpcap. The ethertype will be overwritten as the VLAN TPID if the network interface lacks hardware VLAN offloading. In the outbound packet path, if hardware VLAN offloading is unavailable, the VLAN tag is inserted into the payload but then cleared from the sk_buff struct. Consequently, this can lead to a false negative when checking for the presence of a VLAN tag, causing the packet sniffing outcome to lack VLAN tag information (i.e., TCI-TPID). As a result, the packet capturing tool may be unable to parse packets as expected. The TCI-TPID is missing because the prb_fill_vlan_info() function does not modify the tp_vlan_tci/tp_vlan_tpid values, as the information is in the payload and not in the sk_buff struct. The skb_vlan_tag_present() function only checks vlan_all in the sk_buff struct. In cooked mode, the L2 header is stripped, preventing the packet capturing tool from determining the correct TCI-TPID value. Additionally, the protocol in SLL is incorrect, which means the packet capturing tool cannot parse the L3 header correctly. Link: the-tcpdump-group/libpcap#1105 Link: https://lore.kernel.org/netdev/[email protected]/T/#u Fixes: 393e52e ("packet: deliver VLAN TCI to userspace") Cc: [email protected] Signed-off-by: Chengen Du <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
commit 79eecf631c14e7f4057186570ac20e2cfac3802e upstream. The issue initially stems from libpcap. The ethertype will be overwritten as the VLAN TPID if the network interface lacks hardware VLAN offloading. In the outbound packet path, if hardware VLAN offloading is unavailable, the VLAN tag is inserted into the payload but then cleared from the sk_buff struct. Consequently, this can lead to a false negative when checking for the presence of a VLAN tag, causing the packet sniffing outcome to lack VLAN tag information (i.e., TCI-TPID). As a result, the packet capturing tool may be unable to parse packets as expected. The TCI-TPID is missing because the prb_fill_vlan_info() function does not modify the tp_vlan_tci/tp_vlan_tpid values, as the information is in the payload and not in the sk_buff struct. The skb_vlan_tag_present() function only checks vlan_all in the sk_buff struct. In cooked mode, the L2 header is stripped, preventing the packet capturing tool from determining the correct TCI-TPID value. Additionally, the protocol in SLL is incorrect, which means the packet capturing tool cannot parse the L3 header correctly. Link: the-tcpdump-group/libpcap#1105 Link: https://lore.kernel.org/netdev/[email protected]/T/#u Fixes: 393e52e ("packet: deliver VLAN TCI to userspace") Cc: [email protected] Signed-off-by: Chengen Du <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit 3dfd84aa72fa7329ed4a257c8f40e0c9aff4dc8f) Signed-off-by: Vegard Nossum <[email protected]>
commit 79eecf631c14e7f4057186570ac20e2cfac3802e upstream. The issue initially stems from libpcap. The ethertype will be overwritten as the VLAN TPID if the network interface lacks hardware VLAN offloading. In the outbound packet path, if hardware VLAN offloading is unavailable, the VLAN tag is inserted into the payload but then cleared from the sk_buff struct. Consequently, this can lead to a false negative when checking for the presence of a VLAN tag, causing the packet sniffing outcome to lack VLAN tag information (i.e., TCI-TPID). As a result, the packet capturing tool may be unable to parse packets as expected. The TCI-TPID is missing because the prb_fill_vlan_info() function does not modify the tp_vlan_tci/tp_vlan_tpid values, as the information is in the payload and not in the sk_buff struct. The skb_vlan_tag_present() function only checks vlan_all in the sk_buff struct. In cooked mode, the L2 header is stripped, preventing the packet capturing tool from determining the correct TCI-TPID value. Additionally, the protocol in SLL is incorrect, which means the packet capturing tool cannot parse the L3 header correctly. Link: the-tcpdump-group/libpcap#1105 Link: https://lore.kernel.org/netdev/[email protected]/T/#u Fixes: 393e52e33c6c ("packet: deliver VLAN TCI to userspace") Cc: [email protected] Signed-off-by: Chengen Du <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit 3dfd84aa72fa7329ed4a257c8f40e0c9aff4dc8f) Signed-off-by: Vegard Nossum <[email protected]>
commit 79eecf631c14e7f4057186570ac20e2cfac3802e upstream. The issue initially stems from libpcap. The ethertype will be overwritten as the VLAN TPID if the network interface lacks hardware VLAN offloading. In the outbound packet path, if hardware VLAN offloading is unavailable, the VLAN tag is inserted into the payload but then cleared from the sk_buff struct. Consequently, this can lead to a false negative when checking for the presence of a VLAN tag, causing the packet sniffing outcome to lack VLAN tag information (i.e., TCI-TPID). As a result, the packet capturing tool may be unable to parse packets as expected. The TCI-TPID is missing because the prb_fill_vlan_info() function does not modify the tp_vlan_tci/tp_vlan_tpid values, as the information is in the payload and not in the sk_buff struct. The skb_vlan_tag_present() function only checks vlan_all in the sk_buff struct. In cooked mode, the L2 header is stripped, preventing the packet capturing tool from determining the correct TCI-TPID value. Additionally, the protocol in SLL is incorrect, which means the packet capturing tool cannot parse the L3 header correctly. Link: the-tcpdump-group/libpcap#1105 Link: https://lore.kernel.org/netdev/[email protected]/T/#u Fixes: 393e52e ("packet: deliver VLAN TCI to userspace") Cc: [email protected] Signed-off-by: Chengen Du <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
commit 79eecf631c14e7f4057186570ac20e2cfac3802e upstream. The issue initially stems from libpcap. The ethertype will be overwritten as the VLAN TPID if the network interface lacks hardware VLAN offloading. In the outbound packet path, if hardware VLAN offloading is unavailable, the VLAN tag is inserted into the payload but then cleared from the sk_buff struct. Consequently, this can lead to a false negative when checking for the presence of a VLAN tag, causing the packet sniffing outcome to lack VLAN tag information (i.e., TCI-TPID). As a result, the packet capturing tool may be unable to parse packets as expected. The TCI-TPID is missing because the prb_fill_vlan_info() function does not modify the tp_vlan_tci/tp_vlan_tpid values, as the information is in the payload and not in the sk_buff struct. The skb_vlan_tag_present() function only checks vlan_all in the sk_buff struct. In cooked mode, the L2 header is stripped, preventing the packet capturing tool from determining the correct TCI-TPID value. Additionally, the protocol in SLL is incorrect, which means the packet capturing tool cannot parse the L3 header correctly. Link: the-tcpdump-group/libpcap#1105 Link: https://lore.kernel.org/netdev/[email protected]/T/#u Fixes: 393e52e ("packet: deliver VLAN TCI to userspace") Cc: [email protected] Signed-off-by: Chengen Du <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
commit 79eecf631c14e7f4057186570ac20e2cfac3802e upstream. The issue initially stems from libpcap. The ethertype will be overwritten as the VLAN TPID if the network interface lacks hardware VLAN offloading. In the outbound packet path, if hardware VLAN offloading is unavailable, the VLAN tag is inserted into the payload but then cleared from the sk_buff struct. Consequently, this can lead to a false negative when checking for the presence of a VLAN tag, causing the packet sniffing outcome to lack VLAN tag information (i.e., TCI-TPID). As a result, the packet capturing tool may be unable to parse packets as expected. The TCI-TPID is missing because the prb_fill_vlan_info() function does not modify the tp_vlan_tci/tp_vlan_tpid values, as the information is in the payload and not in the sk_buff struct. The skb_vlan_tag_present() function only checks vlan_all in the sk_buff struct. In cooked mode, the L2 header is stripped, preventing the packet capturing tool from determining the correct TCI-TPID value. Additionally, the protocol in SLL is incorrect, which means the packet capturing tool cannot parse the L3 header correctly. Link: the-tcpdump-group/libpcap#1105 Link: https://lore.kernel.org/netdev/[email protected]/T/#u Fixes: 393e52e ("packet: deliver VLAN TCI to userspace") Cc: [email protected] Signed-off-by: Chengen Du <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
commit 79eecf631c14e7f4057186570ac20e2cfac3802e upstream. The issue initially stems from libpcap. The ethertype will be overwritten as the VLAN TPID if the network interface lacks hardware VLAN offloading. In the outbound packet path, if hardware VLAN offloading is unavailable, the VLAN tag is inserted into the payload but then cleared from the sk_buff struct. Consequently, this can lead to a false negative when checking for the presence of a VLAN tag, causing the packet sniffing outcome to lack VLAN tag information (i.e., TCI-TPID). As a result, the packet capturing tool may be unable to parse packets as expected. The TCI-TPID is missing because the prb_fill_vlan_info() function does not modify the tp_vlan_tci/tp_vlan_tpid values, as the information is in the payload and not in the sk_buff struct. The skb_vlan_tag_present() function only checks vlan_all in the sk_buff struct. In cooked mode, the L2 header is stripped, preventing the packet capturing tool from determining the correct TCI-TPID value. Additionally, the protocol in SLL is incorrect, which means the packet capturing tool cannot parse the L3 header correctly. Link: the-tcpdump-group/libpcap#1105 Link: https://lore.kernel.org/netdev/[email protected]/T/#u Fixes: 393e52e ("packet: deliver VLAN TCI to userspace") Cc: [email protected] Signed-off-by: Chengen Du <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit 3dfd84aa72fa7329ed4a257c8f40e0c9aff4dc8f) Signed-off-by: Vegard Nossum <[email protected]>
commit 79eecf631c14e7f4057186570ac20e2cfac3802e upstream. The issue initially stems from libpcap. The ethertype will be overwritten as the VLAN TPID if the network interface lacks hardware VLAN offloading. In the outbound packet path, if hardware VLAN offloading is unavailable, the VLAN tag is inserted into the payload but then cleared from the sk_buff struct. Consequently, this can lead to a false negative when checking for the presence of a VLAN tag, causing the packet sniffing outcome to lack VLAN tag information (i.e., TCI-TPID). As a result, the packet capturing tool may be unable to parse packets as expected. The TCI-TPID is missing because the prb_fill_vlan_info() function does not modify the tp_vlan_tci/tp_vlan_tpid values, as the information is in the payload and not in the sk_buff struct. The skb_vlan_tag_present() function only checks vlan_all in the sk_buff struct. In cooked mode, the L2 header is stripped, preventing the packet capturing tool from determining the correct TCI-TPID value. Additionally, the protocol in SLL is incorrect, which means the packet capturing tool cannot parse the L3 header correctly. Link: the-tcpdump-group/libpcap#1105 Link: https://lore.kernel.org/netdev/[email protected]/T/#u Fixes: 393e52e ("packet: deliver VLAN TCI to userspace") Cc: [email protected] Signed-off-by: Chengen Du <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
commit 79eecf631c14e7f4057186570ac20e2cfac3802e upstream. The issue initially stems from libpcap. The ethertype will be overwritten as the VLAN TPID if the network interface lacks hardware VLAN offloading. In the outbound packet path, if hardware VLAN offloading is unavailable, the VLAN tag is inserted into the payload but then cleared from the sk_buff struct. Consequently, this can lead to a false negative when checking for the presence of a VLAN tag, causing the packet sniffing outcome to lack VLAN tag information (i.e., TCI-TPID). As a result, the packet capturing tool may be unable to parse packets as expected. The TCI-TPID is missing because the prb_fill_vlan_info() function does not modify the tp_vlan_tci/tp_vlan_tpid values, as the information is in the payload and not in the sk_buff struct. The skb_vlan_tag_present() function only checks vlan_all in the sk_buff struct. In cooked mode, the L2 header is stripped, preventing the packet capturing tool from determining the correct TCI-TPID value. Additionally, the protocol in SLL is incorrect, which means the packet capturing tool cannot parse the L3 header correctly. Link: the-tcpdump-group/libpcap#1105 Link: https://lore.kernel.org/netdev/[email protected]/T/#u Fixes: 393e52e ("packet: deliver VLAN TCI to userspace") Cc: [email protected] Signed-off-by: Chengen Du <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit 3dfd84aa72fa7329ed4a257c8f40e0c9aff4dc8f) Signed-off-by: Vegard Nossum <[email protected]>
commit 79eecf631c14e7f4057186570ac20e2cfac3802e upstream. The issue initially stems from libpcap. The ethertype will be overwritten as the VLAN TPID if the network interface lacks hardware VLAN offloading. In the outbound packet path, if hardware VLAN offloading is unavailable, the VLAN tag is inserted into the payload but then cleared from the sk_buff struct. Consequently, this can lead to a false negative when checking for the presence of a VLAN tag, causing the packet sniffing outcome to lack VLAN tag information (i.e., TCI-TPID). As a result, the packet capturing tool may be unable to parse packets as expected. The TCI-TPID is missing because the prb_fill_vlan_info() function does not modify the tp_vlan_tci/tp_vlan_tpid values, as the information is in the payload and not in the sk_buff struct. The skb_vlan_tag_present() function only checks vlan_all in the sk_buff struct. In cooked mode, the L2 header is stripped, preventing the packet capturing tool from determining the correct TCI-TPID value. Additionally, the protocol in SLL is incorrect, which means the packet capturing tool cannot parse the L3 header correctly. Link: the-tcpdump-group/libpcap#1105 Link: https://lore.kernel.org/netdev/[email protected]/T/#u Fixes: 393e52e ("packet: deliver VLAN TCI to userspace") Cc: [email protected] Signed-off-by: Chengen Du <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit 3dfd84aa72fa7329ed4a257c8f40e0c9aff4dc8f) Signed-off-by: Vegard Nossum <[email protected]>
commit 79eecf631c14e7f4057186570ac20e2cfac3802e upstream. The issue initially stems from libpcap. The ethertype will be overwritten as the VLAN TPID if the network interface lacks hardware VLAN offloading. In the outbound packet path, if hardware VLAN offloading is unavailable, the VLAN tag is inserted into the payload but then cleared from the sk_buff struct. Consequently, this can lead to a false negative when checking for the presence of a VLAN tag, causing the packet sniffing outcome to lack VLAN tag information (i.e., TCI-TPID). As a result, the packet capturing tool may be unable to parse packets as expected. The TCI-TPID is missing because the prb_fill_vlan_info() function does not modify the tp_vlan_tci/tp_vlan_tpid values, as the information is in the payload and not in the sk_buff struct. The skb_vlan_tag_present() function only checks vlan_all in the sk_buff struct. In cooked mode, the L2 header is stripped, preventing the packet capturing tool from determining the correct TCI-TPID value. Additionally, the protocol in SLL is incorrect, which means the packet capturing tool cannot parse the L3 header correctly. Link: the-tcpdump-group/libpcap#1105 Link: https://lore.kernel.org/netdev/[email protected]/T/#u Fixes: 393e52e ("packet: deliver VLAN TCI to userspace") Cc: [email protected] Signed-off-by: Chengen Du <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
commit 79eecf631c14e7f4057186570ac20e2cfac3802e upstream. The issue initially stems from libpcap. The ethertype will be overwritten as the VLAN TPID if the network interface lacks hardware VLAN offloading. In the outbound packet path, if hardware VLAN offloading is unavailable, the VLAN tag is inserted into the payload but then cleared from the sk_buff struct. Consequently, this can lead to a false negative when checking for the presence of a VLAN tag, causing the packet sniffing outcome to lack VLAN tag information (i.e., TCI-TPID). As a result, the packet capturing tool may be unable to parse packets as expected. The TCI-TPID is missing because the prb_fill_vlan_info() function does not modify the tp_vlan_tci/tp_vlan_tpid values, as the information is in the payload and not in the sk_buff struct. The skb_vlan_tag_present() function only checks vlan_all in the sk_buff struct. In cooked mode, the L2 header is stripped, preventing the packet capturing tool from determining the correct TCI-TPID value. Additionally, the protocol in SLL is incorrect, which means the packet capturing tool cannot parse the L3 header correctly. Link: the-tcpdump-group/libpcap#1105 Link: https://lore.kernel.org/netdev/[email protected]/T/#u Fixes: 393e52e ("packet: deliver VLAN TCI to userspace") Cc: [email protected] Signed-off-by: Chengen Du <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
commit 79eecf631c14e7f4057186570ac20e2cfac3802e upstream. The issue initially stems from libpcap. The ethertype will be overwritten as the VLAN TPID if the network interface lacks hardware VLAN offloading. In the outbound packet path, if hardware VLAN offloading is unavailable, the VLAN tag is inserted into the payload but then cleared from the sk_buff struct. Consequently, this can lead to a false negative when checking for the presence of a VLAN tag, causing the packet sniffing outcome to lack VLAN tag information (i.e., TCI-TPID). As a result, the packet capturing tool may be unable to parse packets as expected. The TCI-TPID is missing because the prb_fill_vlan_info() function does not modify the tp_vlan_tci/tp_vlan_tpid values, as the information is in the payload and not in the sk_buff struct. The skb_vlan_tag_present() function only checks vlan_all in the sk_buff struct. In cooked mode, the L2 header is stripped, preventing the packet capturing tool from determining the correct TCI-TPID value. Additionally, the protocol in SLL is incorrect, which means the packet capturing tool cannot parse the L3 header correctly. Link: the-tcpdump-group/libpcap#1105 Link: https://lore.kernel.org/netdev/[email protected]/T/#u Fixes: 393e52e ("packet: deliver VLAN TCI to userspace") Cc: [email protected] Signed-off-by: Chengen Du <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit 3dfd84aa72fa7329ed4a257c8f40e0c9aff4dc8f) Signed-off-by: Vegard Nossum <[email protected]>
VLAN support in SLL was acceptable, if not perfect: single tags were properly handled, while multiple (nested) tags weren't.
In SLL2, even single tags are completely botched: for the parent (non-tagged) interface, the 802.1Q header lands in the middle of the link-layer src addr, and the payload is shifted by 4 bytes, making its further decoding impossible:
For example: here is an ARP packet going out on VLAN 252 of eth10. The first packet, being on the sub-interface, is okay. The second, being on the parent interface, is broken:
This can be traced down to the hex contents, extracted from "tcpdump -i any" into a pcap file:
Below "address" and "padd" give the position of the proper ll address (6-bytes) padded to a 8-byte field:
Here in the second packet we can see the "********" showing the inserted "810000FC" which is the 802.1Q header "VLAN 252", and the way it is somehow "inserted" in the middle of the address (after its first two bytes). This insertion pushes the actual payload 4 bytes to the right.
Is there any reason to do special handling with VLANs ? Why not just copy the ethertype into the first two bytes of the SLL2 header and stick all the rest in the payload ?
The text was updated successfully, but these errors were encountered: