'\" t .\" Title: sk_chk_filter .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: May 2018 .\" Manual: Linux Networking .\" Source: Kernel Hackers Manual 3.16.56 .\" Language: English .\" .TH "SK_CHK_FILTER" "9" "May 2018" "Kernel Hackers Manual 3\&.16\&" "Linux Networking" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" sk_chk_filter \- verify socket filter code .SH "SYNOPSIS" .HP \w'int\ sk_chk_filter('u .BI "int sk_chk_filter(struct\ sock_filter\ *\ " "filter" ", unsigned\ int\ " "flen" ");" .SH "ARGUMENTS" .PP \fIfilter\fR .RS 4 filter to verify .RE .PP \fIflen\fR .RS 4 length of filter .RE .SH "DESCRIPTION" .PP Check the user\*(Aqs 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\&. .PP All jumps are forward as they are not signed\&. .PP Returns 0 if the rule set is legal or \-EINVAL if not\&. .SH "COPYRIGHT" .br