linux_dsm_epyc7002/arch/cris
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
..
arch-v10 flagday: don't pass regs to copy_thread() 2012-11-28 23:43:42 -05:00
arch-v32 ARCH: drivers remove __dev* attributes. 2013-01-03 15:57:13 -08:00
boot Fix common misspellings 2011-03-31 11:26:23 -03:00
configs kconfig: rename CONFIG_EMBEDDED to CONFIG_EXPERT 2011-01-20 17:02:05 -08:00
include sk-filter: Add ability to lock a socket filter program 2013-01-17 03:21:25 -05:00
kernel CRIS: use kbuild.h instead of defining macros in asm-offset.c 2012-12-20 12:45:40 +01:00
mm readahead: fault retry breaks mmap file read random detection 2012-10-09 16:22:47 +09:00
Kconfig Bury the conditionals from kernel_thread/kernel_execve series 2012-12-19 18:07:38 -05:00
Kconfig.debug Kconfig: remove a few puzzling comments 2011-10-31 10:58:48 +01:00
Makefile UAPI: Partition the header include path sets and add uapi/ header directories 2012-10-02 18:01:26 +01:00