Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 78f857f2 authored by Nathan Williams's avatar Nathan Williams Committed by David Woodhouse
Browse files

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: default avatarNathan Williams <nathan@traverse.com.au>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent 4dbedf43
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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) {