]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
b43: Poison RX buffers
authorMichael Buesch <mb@bu3sch.de>
Fri, 27 Mar 2009 21:51:58 +0000 (22:51 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 16 Apr 2009 14:39:03 +0000 (10:39 -0400)
commitec9a1d8c13e36440eda0f3c79b8149080e3ab5ba
tree1161df766e28187c41ed527d7a7334a9e74f0304
parentb3631286aca3f54427ca0eb950981e9753866f6c
b43: Poison RX buffers

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>
drivers/net/wireless/b43/dma.c