Skip to content

Commit

Permalink
solos: Check for rogue received packets
Browse files Browse the repository at this point in the history
Sometimes there can be received packets with the size field set to 0xFFFF.
This seems to only occur after an FPGA or firmware upgrade.
This patch discards packets with an invalid size.

Signed-off-by: Nathan Williams <nathan@traverse.com.au>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
Nathan Williams authored and David Woodhouse committed Mar 25, 2009
1 parent 4dbedf4 commit 78f857f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/atm/solos-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,10 @@ void solos_bh(unsigned long card_arg)
memcpy_fromio(header, RX_BUF(card, port), sizeof(*header));

size = le16_to_cpu(header->size);
if (size > (card->buffer_size - sizeof(*header))){
dev_warn(&card->dev->dev, "Invalid buffer size\n");
continue;
}

skb = alloc_skb(size + 1, GFP_ATOMIC);
if (!skb) {
Expand Down

0 comments on commit 78f857f

Please sign in to comment.