Skip to content

Commit ba78e2d

Browse files
Dmitry Popovdavem330
authored andcommitted
tcp: no md5sig option size check bug
tcp_parse_md5sig_option doesn't check md5sig option (TCPOPT_MD5SIG) length, but tcp_v[46]_inbound_md5_hash assume that it's at least 16 bytes long. Signed-off-by: Dmitry Popov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent e225567 commit ba78e2d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ipv4/tcp_input.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3930,7 +3930,7 @@ u8 *tcp_parse_md5sig_option(struct tcphdr *th)
39303930
if (opsize < 2 || opsize > length)
39313931
return NULL;
39323932
if (opcode == TCPOPT_MD5SIG)
3933-
return ptr;
3933+
return opsize == TCPOLEN_MD5SIG ? ptr : NULL;
39343934
}
39353935
ptr += opsize - 2;
39363936
length -= opsize;

0 commit comments

Comments
 (0)