Name

bpf_check_classic — verify socket filter code

Synopsis

int bpf_check_classic (const struct sock_filter * filter,
 unsigned int flen);
 

Arguments

filter

filter to verify

flen

length of filter

Description

Check the user's filter code. If we let some ugly filter code slip through kaboom! The filter must contain no references or jumps that are out of range, no illegal instructions, and must end with a RET instruction.

All jumps are forward as they are not signed.

Returns 0 if the rule set is legal or -EINVAL if not.