В ядре Linux устранена следующая уязвимость: net: отклонить отрицательное смещение заголовка TCP в qdisc_pkt_len_segs_init() qdisc_pkt_len_segs_init(), хранит skb_transport_offset(), или внутреннее смещение, в неподписанном hdr_len. Заголовок перед skb->data дает отрицательное смещение. Для смещения чуть ниже нуля pskb_may_pull () получает небольшую длину и преуспевает.
Затем 64-битное ядро считывает заголовок TCP далеко после skb и может выйти из строя. Далее ниже нуля pskb_may_pull() терпит неудачу. Commit 28a57fb2c5df ("net: iptunnel: fix stale transport header during tunnel decapsulation") fixed one source of such offsets.
Другой код, который удаляет байты с передней части пакета, может оставить тот же устаревший заголовок. Возвращаем SKB_DROP_REASON_SKB_BAD_GSO для отрицательного смещения в ветке TCP. SKB_GSO_UDP_L4 и другие типы GSO не читают заголовок и все еще получают неправильный qdisc_pkt_len ().
На 64-битном ядре только пакеты, которые вызывают чтение после skb, сегодня получают новый результат. Затем __dev_queue_xmit() роняет их и возвращает -EINVAL, но sch_handle_ingress() игнорирует результат. Их содержание может быть действительным.
Таким образом, код, который оставляет заголовок устаревшим, нуждается в своем собственном исправлении.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: net: reject a negative TCP header offset in qdisc_pkt_len_segs_init() qdisc_pkt_len_segs_init() stores skb_transport_offset(), or the inner offset, in the unsigned hdr_len. A header in front of skb->data gives a negative offset. For an offset a little below zero, pskb_may_pull() gets a small length and succeeds. Then a 64-bit kernel reads the TCP header far after the skb and can crash. Further below zero pskb_may_pull() fails. Commit 28a57fb2c5df ("net: iptunnel: fix stale transport header during tunnel decapsulation") fixed one source of such offsets. Other code that removes bytes from the front of a packet can leave the same stale header. Return SKB_DROP_REASON_SKB_BAD_GSO for a negative offset in the TCP branch. SKB_GSO_UDP_L4 and the other GSO types read no header and still get a wrong qdisc_pkt_len(). On a 64-bit kernel only packets that cause the read after the skb today get a new result. Then __dev_queue_xmit() drops them and returns -EINVAL, but sch_handle_ingress() ignores the result. Their content can be valid. Thus the code that leaves the header stale needs its own fix.