提交 78f857f2 编写于 作者: N Nathan Williams 提交者: David Woodhouse

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: NNathan Williams <nathan@traverse.com.au>
Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
上级 4dbedf43
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册