Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Created attachment 1867603[details]
Reproducer
Description of problem:
The kernel drops GSO tagged packets while untagged packets are forwarded.
The reproducer only requires a veth pair, one side in the host and another in a another netns.
ip netns add test
ip link add veth1 type veth peer name veth2
ip link set veth2 netns test
ip netns exec test ip link add veth2.10 link veth2 type vlan id 10
ip netns exec test ip link set veth2 up
ip netns exec test ip link set veth2.10 up
ip netns exec test ip address add 192.168.200.31/24 dev veth2.10
ip link set veth1 up
On one terminal run tcpdump:
ip netns exec test tcpdump -n -nn -e -v -i veth2
On another terminal run the reproducer:
# gcc -o repro sock-gso.c
#./repro veth1 untag gso
The above should show the packet being forwarded ok:
20:21:48.533856 52:54:00:40:f8:92 > 56:16:b4:8a:ca:12, ethertype IPv4 (0x0800), length 2048: (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto TCP (6), length 2024)
192.168.200.11.3320 > 192.168.200.31.8080: Flags [P], cksum 0xe6a8 (incorrect -> 0x5d97), seq 666:2650, win 1536, length 1984: HTTP
Now running with VLAN tag:
# ./repro veth1 tag gso
This doesn't show any packet. Not even in veth1 interface.
Disabling GSO without VLAN tag:
# ./repro veth1 untag n
The above shows the packet below being forwarded ok:
20:23:55.307572 52:54:00:40:f8:92 > 56:16:b4:8a:ca:12, ethertype IPv4 (0x0800), length 400: (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto TCP (6), length 376)
192.168.200.11.3320 > 192.168.200.31.8080: Flags [P], cksum 0xed18 (incorrect -> 0x6407), seq 666:1002, win 1536, length 336: HTTP
Disabling GSO with tagged VLAN:
# ./repro veth1 tag n
20:25:04.375593 52:54:00:40:f8:92 > 56:16:b4:8a:ca:12, ethertype 802.1Q (0x8100), length 400: vlan 10, p 0, ethertype IPv4 (0x0800), (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto TCP (6), length 376)
192.168.200.11.3320 > 192.168.200.31.8080: Flags [P], cksum 0xed18 (incorrect -> 0x6407), seq 666:1002, win 1536, length 336: HTTP
That works too, so forwarding fails only with the GSO + VLAN tag.
The TX drop increases in veth1 interface in that case.
A quick look at the kernel sources indicates the issue might be in inet_gso_segment().
Version-Release number of selected component (if applicable):
The issue happens with 5.17.0-rc7+ as well.
How reproducible:
Always
Actual results:
The GSO tagged packet is dropped.
Expected results:
The GSO tagged packet should be forwarded.
> A quick look at the kernel sources indicates the issue might be in inet_gso_segment().
skb_reset_network_header(skb);
nhoff = skb_network_header(skb) - skb_mac_header(skb);
if (unlikely(!pskb_may_pull(skb, sizeof(*iph))))
goto out;
iph = ip_hdr(skb);
ihl = iph->ihl * 4;
if (ihl < sizeof(*iph))
goto out;
Looks it doesn't check if there is a VLAN header. Need to see how to fix it, as there may also has QinQ header.
OK, since we don't support VLAN in inet_gso_segment, we should return error to userspace.
But the packet_snd() didn't do it as it only checks if error > 0, while it sometime may return error < 0.
```
static int packet_snd()
[...]
err = po->xmit(skb);
if (err > 0 && (err = net_xmit_errno(err)) != 0)
goto out_unlock;
[...]
}
```
So a simple fix is to also check if error < 0. But in a long time, we'd better try to implement VLAN GSO.
We are actually implementing TSO/GSO support in OVS user space and that is how I found out about this problem.
If the kernel doesn't support that, it means user space needs to segment the packet and lose performance.
fbl
(In reply to Flavio Leitner from comment #4)
> We are actually implementing TSO/GSO support in OVS user space and that is
> how I found out about this problem.
> If the kernel doesn't support that, it means user space needs to segment the
> packet and lose performance.
I'm still investing the reason. There may have a bug as in skb_mac_gso_segment() it should deal with the VLANs, but actually not.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory (Moderate: kernel security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHSA-2022:7683
Created attachment 1867603 [details] Reproducer Description of problem: The kernel drops GSO tagged packets while untagged packets are forwarded. The reproducer only requires a veth pair, one side in the host and another in a another netns. ip netns add test ip link add veth1 type veth peer name veth2 ip link set veth2 netns test ip netns exec test ip link add veth2.10 link veth2 type vlan id 10 ip netns exec test ip link set veth2 up ip netns exec test ip link set veth2.10 up ip netns exec test ip address add 192.168.200.31/24 dev veth2.10 ip link set veth1 up On one terminal run tcpdump: ip netns exec test tcpdump -n -nn -e -v -i veth2 On another terminal run the reproducer: # gcc -o repro sock-gso.c #./repro veth1 untag gso The above should show the packet being forwarded ok: 20:21:48.533856 52:54:00:40:f8:92 > 56:16:b4:8a:ca:12, ethertype IPv4 (0x0800), length 2048: (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto TCP (6), length 2024) 192.168.200.11.3320 > 192.168.200.31.8080: Flags [P], cksum 0xe6a8 (incorrect -> 0x5d97), seq 666:2650, win 1536, length 1984: HTTP Now running with VLAN tag: # ./repro veth1 tag gso This doesn't show any packet. Not even in veth1 interface. Disabling GSO without VLAN tag: # ./repro veth1 untag n The above shows the packet below being forwarded ok: 20:23:55.307572 52:54:00:40:f8:92 > 56:16:b4:8a:ca:12, ethertype IPv4 (0x0800), length 400: (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto TCP (6), length 376) 192.168.200.11.3320 > 192.168.200.31.8080: Flags [P], cksum 0xed18 (incorrect -> 0x6407), seq 666:1002, win 1536, length 336: HTTP Disabling GSO with tagged VLAN: # ./repro veth1 tag n 20:25:04.375593 52:54:00:40:f8:92 > 56:16:b4:8a:ca:12, ethertype 802.1Q (0x8100), length 400: vlan 10, p 0, ethertype IPv4 (0x0800), (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto TCP (6), length 376) 192.168.200.11.3320 > 192.168.200.31.8080: Flags [P], cksum 0xed18 (incorrect -> 0x6407), seq 666:1002, win 1536, length 336: HTTP That works too, so forwarding fails only with the GSO + VLAN tag. The TX drop increases in veth1 interface in that case. A quick look at the kernel sources indicates the issue might be in inet_gso_segment(). Version-Release number of selected component (if applicable): The issue happens with 5.17.0-rc7+ as well. How reproducible: Always Actual results: The GSO tagged packet is dropped. Expected results: The GSO tagged packet should be forwarded.