if (length < 2 * sizeof(*dp))
goto trunc;
len = GET_BE_U_4(dp + 1);
+ if (len > length) {
+ ND_PRINT(" [credentials length %u > %u]", len, length);
+ nd_print_invalid(ndo);
+ return NULL;
+ }
rounded_len = roundup2(len, 4);
ND_TCHECK_LEN(dp + 2, rounded_len);
if (2 * sizeof(*dp) + rounded_len <= length) {
if (length < 2 * sizeof(*dp))
goto trunc;
len = GET_BE_U_4(dp + 1);
+ if (len > length) {
+ ND_PRINT(" [verifier length %u > %u]", len, length);
+ nd_print_invalid(ndo);
+ return NULL;
+ }
rounded_len = roundup2(len, 4);
ND_TCHECK_LEN(dp + 2, rounded_len);
if (2 * sizeof(*dp) + rounded_len < length) {
# NFS tests
# fuzzed pcap
nfs-write-verf-cookie nfs-write-verf-cookie.pcapng nfs-write-verf-cookie.out -vv
+nfs_large_credentials_length nfs_large_credentials_length.pcap nfs_large_credentials_length.out
# NFS fuzzed
nfs-seg-fault-1 nfs-seg-fault-1.pcapng nfs-seg-fault-1.out
0x0030: 3030 3030 3030 3030 3030 3030 3030 3030 0000000000000000
0x0040: 3030 3030 3030 3030 3030 3030 3030 3030 0000000000000000
0x0050: 3030 00
- 47 1995-08-15 05:27:12.808464432 IP 48.48.48.48.12336 > 48.48.48.48.2049: NFS request xid 3056611558 12308 access [|nfs]
+ 47 1995-08-15 05:27:12.808464432 IP 48.48.48.48.12336 > 48.48.48.48.2049: NFS request xid 3056611558 12308 access [credentials length 808464432 > 12308] (invalid) [|nfs]
48 1995-08-15 05:27:12.808464432 IP 48.48.48.48.2049 > 48.48.48.48.12336: NFS reply xid 3056611558 reply ok 12308 access [|nfs]