Skip to content

Commit ef76358

Browse files
philmdjasowang
authored andcommitted
net/eth: Check iovec has enough data earlier
We want to check fields from ip6_ext_hdr_routing structure and if correct read the full in6_address. Let's directly check if our iovec contains enough data for everything, else return early. Suggested-by: Stefano Garzarella <sgarzare@redhat.com> Reviewed-by: Miroslav Rezanina <mrezanin@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
1 parent 6f10f77 commit ef76358

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/eth.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ _eth_get_rss_ex_dst_addr(const struct iovec *pkt, int pkt_frags,
409409
size_t input_size = iov_size(pkt, pkt_frags);
410410
size_t bytes_read;
411411

412-
if (input_size < ext_hdr_offset + sizeof(*ext_hdr)) {
412+
if (input_size < ext_hdr_offset + sizeof(*rthdr) + sizeof(*dst_addr)) {
413413
return false;
414414
}
415415

0 commit comments

Comments
 (0)