sock_fprog::len is a u16, so a program can have at most 65535 instructions, which is more than plenty. Nevertheless the apply_filter() should return an error if someone calls it with &[sock_filter {...}; 0x10_000] instead of installing an empty filter (0x10000 % 0x10000 == 0).
Requirements
Before submitting your PR, please make sure you addressed the following
requirements:
[x] All commits in this PR are signed (with git commit -s), and the commit
message has max 60 characters for the summary and max 75 characters for each
description line.
[x] All added/changed functionality has a corresponding unit/integration
test.
[x] All added/changed public-facing functionality has entries in the "Upcoming
Release" section of CHANGELOG.md (if no such section exists, please create one).
[ ] Any newly added unsafe code is properly documented.
Summary of the PR
sock_fprog::len
is a u16, so a program can have at most 65535 instructions, which is more than plenty. Nevertheless theapply_filter()
should return an error if someone calls it with&[sock_filter {...}; 0x10_000]
instead of installing an empty filter (0x10000 % 0x10000 == 0).Requirements
Before submitting your PR, please make sure you addressed the following requirements:
git commit -s
), and the commit message has max 60 characters for the summary and max 75 characters for each description line.Any newly addedunsafe
code is properly documented.