• Michael Buesch's avatar
    b43: Poison RX buffers · ec9a1d8c
    Michael Buesch authored
    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: default avatarFrancesco Gringoli <francesco.gringoli@ing.unibs.it>
    Signed-off-by: default avatarMichael Buesch <mb@bu3sch.de>
    Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
    ec9a1d8c
dma.c 42.4 KB