linux/include/uapi
Vincent Bernat d59577b6ff sk-filter: Add ability to lock a socket filter program
While a privileged program can open a raw socket, attach some
restrictive filter and drop its privileges (or send the socket to an
unprivileged program through some Unix socket), the filter can still
be removed or modified by the unprivileged program. This commit adds a
socket option to lock the filter (SO_LOCK_FILTER) preventing any
modification of a socket filter program.

This is similar to OpenBSD BIOCLOCK ioctl on bpf sockets, except even
root is not allowed change/drop the filter.

The state of the lock can be read with getsockopt(). No error is
triggered if the state is not changed. -EPERM is returned when a user
tries to remove the lock or to change/remove the filter while the lock
is active. The check is done directly in sk_attach_filter() and
sk_detach_filter() and does not affect only setsockopt() syscall.

Signed-off-by: Vincent Bernat <bernat@luffy.cx>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-17 03:21:25 -05:00
..
asm-generic sk-filter: Add ability to lock a socket filter program 2013-01-17 03:21:25 -05:00
drm drm/exynos: consider both case of vflip and hflip. 2013-01-04 15:54:33 +09:00
linux Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-01-15 15:05:59 -05:00
mtd
rdma UAPI: (Scripted) Disintegrate include/rdma 2012-11-22 00:43:10 -08:00
scsi
sound ALSA: Extend chmap definitions for UAC2 2012-11-26 16:18:59 +01:00
video
xen
Kbuild