linux-sg2042/arch/s390
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
..
appldata s390/vtimer: rework virtual timer interface 2012-07-20 11:15:08 +02:00
boot s390: fix linker script for 31 bit builds 2012-10-18 17:50:10 +02:00
crypto s390/crypto: Don't panic after crypto instruction failures 2012-11-23 11:14:27 +01:00
hypfs Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2012-10-02 20:25:04 -07:00
include sk-filter: Add ability to lock a socket filter program 2013-01-17 03:21:25 -05:00
kernel s390/topology: export cpu_topology 2013-01-08 10:57:10 +01:00
kvm Merge tag 'kvm-3.8-1' of git://git.kernel.org/pub/scm/virt/kvm/kvm 2012-12-13 15:31:08 -08:00
lib s390/mm: use pmd_large() instead of pmd_huge() 2012-10-26 16:44:23 +02:00
math-emu s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
mm s390/irq: remove split irq fields from /proc/stat 2013-01-08 10:57:07 +01:00
net s390/bpf,jit: add support for XOR instruction 2012-12-03 10:44:05 -05:00
oprofile s390/irq: remove split irq fields from /proc/stat 2013-01-08 10:57:07 +01:00
pci s390/irq: remove split irq fields from /proc/stat 2013-01-08 10:57:07 +01:00
Kbuild s390/pci: base support 2012-11-30 15:40:45 +01:00
Kconfig Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal 2012-12-20 18:05:28 -08:00
Kconfig.debug s390/mm: add page table dumper 2012-10-09 14:16:58 +02:00
Makefile s390: add zEC12 code generation support 2012-11-23 11:14:31 +01:00
defconfig s390: update defconfig 2012-09-26 15:45:29 +02:00