entry(pkt->data, size=pkt->len)
→ line 245: CHECK len <= 65535 (IP length)
→ line 248: cast to (uint16_t) — TRUNCATION from uint32
→ line 260: call parse_options(data, len)
→ line 312: CHECK opt_len >= 2
→ line 340: memcpy(buf, data + offset, opt_len) ← DANGEROUS OP
{
"file": "src/net/tcp_sack.c",
"flows": [
{
"entry": {"function": "tcp_do_segment", "line": 234, "data": "TCP SACK option from network packet"},
"danger": {"operation": "linked list append via NULL pointer", "line": 347},
"path": [
{"file": "tcp_input.c", "line": 234, "action": "receive TCP segment", "data_var": "th"},
{"file": "tcp_input.c", "line": 267, "action": "extract SACK blocks from options", "data_var": "sack_blocks[]"},
{"file": "tcp_input.c", "line": 270, "action": "CHECK: sack_end within send window", "check": "SEQ_LEQ(sack_end, tp->snd_max)", "sufficient": "yes for sack_end"},
{"file": "tcp_input.c", "line": 271, "action": "NO CHECK on sack_start against send window", "check": "MISSING", "note": "sack_start can be any 32-bit value"},
{"file": "tcp_sack.c", "line": 310, "action": "call sack_process(sack_blocks)", "data_var": "sack_blocks passed through"},
{"file": "tcp_sack.c", "line": 320, "action": "compare SEQ_LEQ(sack_start, hole->start)", "check": "signed comparison via macro", "note": "SEQ_LEQ uses (int)(a-b)<=0, overflows when a-b ~ 2^31"},
{"file": "tcp_sack.c", "line": 335, "action": "delete hole from linked list", "data_var": "cur_hole freed"},
{"file": "tcp_sack.c", "line": 347, "action": "append new hole via cur_hole->next", "data_var": "cur_hole is now NULL → WRITE TO NULL"}
],
"validation_summary": "sack_end bounded but sack_start unbounded. Signed comparison overflow makes impossible condition satisfiable.",
"rating": "hot",
"cross_file": true
}
]
}