diff options
author | Daniel Borkmann <dborkman@redhat.com> | 2013-05-03 02:57:00 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-05-03 16:10:33 -0400 |
commit | 8da3056c04bfc5f69f840ab038a38389e2de8189 (patch) | |
tree | 46686ea6065471491e4cc052ab85c8cb29a9d146 /net/packet/Kconfig | |
parent | c5060cec6ba27ad3f0e7facfdf05d2f18e3e3010 (diff) | |
download | op-kernel-dev-8da3056c04bfc5f69f840ab038a38389e2de8189.zip op-kernel-dev-8da3056c04bfc5f69f840ab038a38389e2de8189.tar.gz |
packet: tpacket_v3: do not trigger bug() on wrong header status
Jakub reported that it is fairly easy to trigger the BUG() macro
from user space with TPACKET_V3's RX_RING by just giving a wrong
header status flag. We already had a similar situation in commit
7f5c3e3a80e6654 (``af_packet: remove BUG statement in
tpacket_destruct_skb'') where this was the case in the TX_RING
side that could be triggered from user space. So really, don't use
BUG() or BUG_ON() unless there's really no way out, and i.e.
don't use it for consistency checking when there's user space
involved, no excuses, especially not if you're slapping the user
with WARN + dump_stack + BUG all at once. The two functions are
of concern:
prb_retire_current_block() [when block status != TP_STATUS_KERNEL]
prb_open_block() [when block_status != TP_STATUS_KERNEL]
Calls to prb_open_block() are guarded by ealier checks if block_status
is really TP_STATUS_KERNEL (racy!), but the first one BUG() is easily
triggable from user space. System behaves still stable after they are
removed. Also remove that yoda condition entirely, since it's already
guarded.
Reported-by: Jakub Zawadzki <darkjames-ws@darkjames.pl>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/packet/Kconfig')
0 files changed, 0 insertions, 0 deletions