]> git.baikalelectronics.ru Git - kernel.git/commit
net: filter: seccomp: fix wrong decoding of BPF_S_ANC_SECCOMP_LD_W
authorDaniel Borkmann <dborkman@redhat.com>
Mon, 14 Apr 2014 19:20:12 +0000 (21:20 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 14 Apr 2014 20:26:47 +0000 (16:26 -0400)
commitc5d7fc40f489304e6b95ec990aebdf1e3577db79
tree1739a3a15955927dd2a0c649d9b44a17ab6982b2
parentfe5f7682d871f91c6a41cad0a9199a170c702add
net: filter: seccomp: fix wrong decoding of BPF_S_ANC_SECCOMP_LD_W

While reviewing seccomp code, we found that BPF_S_ANC_SECCOMP_LD_W has
been wrongly decoded by commit 2b1b05f8fa ("sk-filter: Add ability to
get socket filter program (v2)") into the opcode BPF_LD|BPF_B|BPF_ABS
although it should have been decoded as BPF_LD|BPF_W|BPF_ABS.

In practice, this should not have much side-effect though, as such
conversion is/was being done through prctl(2) PR_SET_SECCOMP. Reverse
operation PR_GET_SECCOMP will only return the current seccomp mode, but
not the filter itself. Since the transition to the new BPF infrastructure,
it's also not used anymore, so we can simply remove this as it's
unreachable.

Fixes: 2b1b05f8fa ("sk-filter: Add ability to get socket filter program (v2)")
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
Cc: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/filter.h
net/core/filter.c