1SK_CHK_FILTER(9) Linux Networking SK_CHK_FILTER(9)
2
3
4
6 sk_chk_filter - verify socket filter code
7
9 int sk_chk_filter(struct sock_filter * filter, unsigned int flen);
10
12 filter
13 filter to verify
14
15 flen
16 length of filter
17
19 Check the user's filter code. If we let some ugly filter code slip
20 through kaboom! The filter must contain no references or jumps that are
21 out of range, no illegal instructions, and must end with a RET
22 instruction.
23
24 All jumps are forward as they are not signed.
25
26 Returns 0 if the rule set is legal or -EINVAL if not.
27
29Kernel Hackers Manual 3.10 June 2019 SK_CHK_FILTER(9)