Skip to content

proto: correct 802.1Q length check in is_ipv_X#1044

Open
rootvector2 wants to merge 1 commit into
OpenVPN:masterfrom
rootvector2:proto-8021q-length-check
Open

proto: correct 802.1Q length check in is_ipv_X#1044
rootvector2 wants to merge 1 commit into
OpenVPN:masterfrom
rootvector2:proto-8021q-length-check

Conversation

@rootvector2
Copy link
Copy Markdown

In TAP mode is_ipv_X() checks an 802.1Q frame against the untagged Ethernet header size but then advances past the larger 18-byte 802.1Q header. A tagged frame of 34 to 37 bytes passes the check yet leaves fewer than sizeof(struct openvpn_iphdr) bytes at the new buffer head, so callers such as client_nat_transform that trust the return value access bytes past the IP header. Use sizeof(struct openvpn_8021qhdr) for the check instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant