b43: Poison RX buffers
commit46da7a503eaadb0daf7a56c4f8ced1a3d4e57ec2
authorMichael Buesch <mb@bu3sch.de>
Fri, 24 Apr 2009 16:05:31 +0000 (24 16:05 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 8 May 2009 22:44:58 +0000 (8 15:44 -0700)
treea54a907979d4d3e4b23da19d1f19cefafcf49fdc
parented7c3d0616251fbabe8c0b63713235b881312eb0
b43: Poison RX buffers

upstream commit: ec9a1d8c13e36440eda0f3c79b8149080e3ab5ba

This patch adds poisoning and sanity checking to the RX DMA buffers.
This is used for protection against buggy hardware/firmware that raises
RX interrupts without doing an actual DMA transfer.

This mechanism protects against rare "bad packets" (due to uninitialized skb data)
and rare kernel crashes due to uninitialized RX headers.

The poison is selected to not match on valid frames and to be cheap for checking.

The poison check mechanism _might_ trigger incorrectly, if we are voluntarily
receiving frames with bad PLCP headers. However, this is nonfatal, because the
chance of such a match is basically zero and in case it happens it just results
in dropping the packet.
Bad-PLCP RX defaults to off, and you should leave it off unless you want to listen
to the latest news broadcasted by your microwave oven.

This patch also moves the initialization of the RX-header "length" field in front of
the mapping of the DMA buffer. The CPU should not touch the buffer after we mapped it.

Cc: stable@kernel.org
Reported-by: Francesco Gringoli <francesco.gringoli@ing.unibs.it>
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
drivers/net/wireless/b43/dma.c