linux/arch/powerpc
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 Merge remote-tracking branch 'agust/next' into next 2012-12-18 10:22:27 +11:00
configs powerpc/pseries: Double NR_CPUS in defconfig 2012-11-15 12:59:17 +11:00
include sk-filter: Add ability to lock a socket filter program 2013-01-17 03:21:25 -05:00
kernel Driver core __dev* removal patches 2013-01-03 16:17:50 -08:00
kvm KVM: PPC: Book3S HV: Fix compilation without CONFIG_PPC_POWERNV 2013-01-06 14:02:00 +01:00
lib powerpc: Fix VMX fix for memcpy case 2012-10-04 18:02:43 +10:00
math-emu
mm POWERPC: drivers: remove __dev* attributes. 2013-01-03 15:57:04 -08:00
net PPC: net: bpf_jit_comp: add VLAN instructions for BPF JIT 2012-11-17 22:12:47 -05:00
oprofile mm: use mm->exe_file instead of first VM_EXECUTABLE vma->vm_file 2012-10-09 16:22:18 +09:00
perf powerpc/perf: Add missing L2 constraint handling in Power7 PMU 2012-11-15 13:00:36 +11:00
platforms Driver core __dev* removal patches 2013-01-03 16:17:50 -08:00
sysdev POWERPC: drivers: remove __dev* attributes. 2013-01-03 15:57:04 -08:00
xmon powerpc/xmon: Fallback to printk() in xmon_printf() if udbg is not setup 2012-11-15 13:00:02 +11:00
Kconfig Bury the conditionals from kernel_thread/kernel_execve series 2012-12-19 18:07:38 -05:00
Kconfig.debug powerpc: IOMMU fault injection 2012-07-10 19:18:59 +10:00
Makefile powerpc: dtc is required to build dtb files 2012-11-15 12:59:21 +11:00
relocs_check.pl powerpc: Process dynamic relocations for kernel 2011-12-20 10:21:08 -05:00