WSL2-Linux-Kernel/arch/frv
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
..
boot FRV: Don't objcopy the GNU build_id note 2012-11-02 13:20:42 +00:00
include sk-filter: Add ability to lock a socket filter program 2013-01-17 03:21:25 -05:00
kernel ARCH: drivers remove __dev* attributes. 2013-01-03 15:57:13 -08:00
lib irq_work: Add generic hardirq context callbacks 2010-10-18 19:58:50 +02:00
mb93090-mb00 ARCH: drivers remove __dev* attributes. 2013-01-03 15:57:13 -08:00
mm frv: fix use of extinct _sbss and _ebss in debug code 2012-12-17 17:15:12 -08:00
Kconfig Bury the conditionals from kernel_thread/kernel_execve series 2012-12-19 18:07:38 -05:00
Kconfig.debug [PATCH] frv: drop unsupported debugging features 2006-01-08 20:13:36 -08:00
Makefile frv: Use generic init_task 2012-05-05 13:00:23 +02:00
defconfig kconfig: rename CONFIG_EMBEDDED to CONFIG_EXPERT 2011-01-20 17:02:05 -08:00