mirror of
https://github.com/the-tcpdump-group/tcpdump.git
synced 2024-11-23 01:53:55 +08:00
RT6: Add a bounds check for the PadN TLV in Segment Routing Header
Define ND_LONGJMP_FROM_TCHECK. Add a test file.
This commit is contained in:
parent
f60ddc5b3e
commit
3b2df87bc6
@ -25,6 +25,7 @@
|
||||
|
||||
#include "netdissect-stdinc.h"
|
||||
|
||||
#define ND_LONGJMP_FROM_TCHECK
|
||||
#include "netdissect.h"
|
||||
#include "addrtoname.h"
|
||||
#include "extract.h"
|
||||
@ -65,6 +66,7 @@ srh_tlv_print(netdissect_options *ndo, const u_char *p, u_int bytes_left)
|
||||
case IPV6_SRH_TLV_PADN:
|
||||
ND_ICHECKMSG_U("PadN length", tlv_len, >, 5); /* RFC 8754 */
|
||||
ND_ICHECKMSG_U("remaining length", bytes_left, <, tlv_len);
|
||||
ND_TCHECK_LEN(p, tlv_len);
|
||||
p += tlv_len;
|
||||
bytes_left -= tlv_len;
|
||||
break;
|
||||
|
@ -392,6 +392,7 @@ ipv6-srh-tlv-hmac ipv6-srh-tlv-hmac.pcap ipv6-srh-tlv-hmac.out
|
||||
ipv6-srh-tlv-hmac-v ipv6-srh-tlv-hmac.pcap ipv6-srh-tlv-hmac-v.out -v
|
||||
ipv6-srh-tlv-pad1-padn-5 ipv6-srh-tlv-pad1-padn-5.pcap ipv6-srh-tlv-pad1-padn-5.out
|
||||
ipv6-srh-tlv-pad1-padn-5-v ipv6-srh-tlv-pad1-padn-5.pcap ipv6-srh-tlv-pad1-padn-5-v.out -v
|
||||
ipv6-srh-tlv-pad1-padn-5-trunc ipv6-srh-tlv-pad1-padn-5-trunc.pcap ipv6-srh-tlv-pad1-padn-5-trunc.out
|
||||
ipv6_invalid_length ipv6_invalid_length.pcap ipv6_invalid_length.out
|
||||
ipv6_invalid_length_2 ipv6_invalid_length_2.pcap ipv6_invalid_length_2.out -v
|
||||
ipv6_jumbogram_invalid_length ipv6_jumbogram_invalid_length.pcap ipv6_jumbogram_invalid_length.out -v
|
||||
|
1
tests/ipv6-srh-tlv-pad1-padn-5-trunc.out
Normal file
1
tests/ipv6-srh-tlv-pad1-padn-5-trunc.out
Normal file
@ -0,0 +1 @@
|
||||
1 2022-11-11 17:47:55.4294964993 IP6 2001:db8:1::1 > cafe:1::2: RT6 (len=3, type=4, segleft=0, last-entry=0, tag=0, [0]cafe:1::2, TLV-type=Pad1(0), TLV-type=PadN(4), TLV-len=5 [|rt6]
|
BIN
tests/ipv6-srh-tlv-pad1-padn-5-trunc.pcap
Normal file
BIN
tests/ipv6-srh-tlv-pad1-padn-5-trunc.pcap
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user