Commit 5513c3c9 authored by Jeremy Harris's avatar Jeremy Harris

Harden RPC tracking against possibly misidentified packets

parent 2c8a1401
......@@ -2142,7 +2142,8 @@ nextrpc:
&& seg_end-seg_start >= sizeof(*rpchdr_min)/* hdr fits in seg */
&& ntohl(rpchdr_min->len) & (1<<31) /* last frag */
&& (ntohl(rpchdr_min->len) & ~(1<<31)) <= 1<<24
&& (ntohl(rpchdr_min->type) != 0 || ntohl(rpchdr->ver) == 2)) {
&& (ntohl(rpchdr_min->type) != 0 || ntohl(rpchdr->ver) == 2)
&& (ntohl(rpchdr_min->type) == 0 || (ntohl(rpchdr_min->type) == 1))) {
/* u_int32_t xid = ntohl(rpchdr_min->xid); */
u_int32_t xid = rpchdr_min->xid;
......@@ -2283,7 +2284,7 @@ nextrpc:
thisdir->rpc_size = (u_int) -1;
if ( SEQ_GREATERTHAN(thisdir->rpc_seq_hi, seg_start)
&& SEQ_GREATERTHAN(seg_end, thisdir->rpc_seq_hi + sizeof(*rpchdr_min))) {
&& SEQ_GREATERTHAN(seg_end, thisdir->rpc_seq_hi + sizeof(*rpchdr_min))) {
/* Room for another RPC-header in this seg */
seg_start = thisdir->rpc_seq_hi;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment