]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Fix potential 1-byte overread in TCP option parsing.
authorGert Doering <gert@greenie.muc.de>
Sun, 18 Jun 2017 19:41:04 +0000 (21:41 +0200)
committerGert Doering <gert@greenie.muc.de>
Sun, 18 Jun 2017 20:01:06 +0000 (22:01 +0200)
commit529de430ce07d0c3210a4636b1cb4c89cc6c8fc1
treebb2216575fd291367c52f013fa04dc35b722e85c
parent2bf4aee4b043151bd2abe7101421fd74763f1230
Fix potential 1-byte overread in TCP option parsing.

A malformed TCP header could lead to a one-byte overread when
searching for the MSS option (but as far as we know, with no
adverse consequences).

Change outer loop to always ensure there's one extra byte available
in the buffer examined.

Technically, this would cause OpenVPN to ignore the only single-byte
TCP option available, 'NOP', if it ends up being the very last
option in the buffer - so what, it's a NOP anyway, and all we
are interested is MSS, which needs 4 bytes.
(https://www.iana.org/assignments/tcp-parameters/tcp-parameters.xhtml)

Found and reported by Guido Vranken <guidovranken@gmail.com>.

Trac: #745

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <20170618194104.25179-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg14874.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
(cherry picked from commit 22046a88342878cf43a9a553c83470eeaf97f000)
src/openvpn/mss.c