aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/atm
diff options
context:
space:
mode:
authorNathan Williams <nathan@traverse.com.au>2009-03-25 05:33:42 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2009-03-25 07:17:49 -0400
commit78f857f265241dfa6f343d75b45e8b30935f71df (patch)
tree03795e32b4fdc4b484d17abd14d2ba736510c979 /drivers/atm
parent4dbedf43d26276f6d7c8c3146d0a5b2f0309d968 (diff)
solos: Check for rogue received packets
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>
Diffstat (limited to 'drivers/atm')
-rw-r--r--drivers/atm/solos-pci.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c
index bfef8d255811..6c828347c9cc 100644
--- a/drivers/atm/solos-pci.c
+++ b/drivers/atm/solos-pci.c
@@ -671,6 +671,10 @@ void solos_bh(unsigned long card_arg)
671 memcpy_fromio(header, RX_BUF(card, port), sizeof(*header)); 671 memcpy_fromio(header, RX_BUF(card, port), sizeof(*header));
672 672
673 size = le16_to_cpu(header->size); 673 size = le16_to_cpu(header->size);
674 if (size > (card->buffer_size - sizeof(*header))){
675 dev_warn(&card->dev->dev, "Invalid buffer size\n");
676 continue;
677 }
674 678
675 skb = alloc_skb(size + 1, GFP_ATOMIC); 679 skb = alloc_skb(size + 1, GFP_ATOMIC);
676 if (!skb) { 680 if (!skb) {