mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 21:40:54 +07:00
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>
This commit is contained in:
parent
4dbedf43d2
commit
78f857f265
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user