]> git.baikalelectronics.ru Git - kernel.git/commit
appletalk: Fix skb allocation size in loopback case
authorDoug Brown <doug@schmorgal.com>
Fri, 12 Feb 2021 05:27:54 +0000 (21:27 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 13 Feb 2021 00:40:28 +0000 (16:40 -0800)
commit28ece4594ee756e3de76e38e3b5ab622be1b117c
treef5d35c8866e35ee381f40b5ce47bb9c79fb80b68
parent37a78286ac862616c1e42d37198b3900ac696bdd
appletalk: Fix skb allocation size in loopback case

If a DDP broadcast packet is sent out to a non-gateway target, it is
also looped back. There is a potential for the loopback device to have a
longer hardware header length than the original target route's device,
which can result in the skb not being created with enough room for the
loopback device's hardware header. This patch fixes the issue by
determining that a loopback will be necessary prior to allocating the
skb, and if so, ensuring the skb has enough room.

This was discovered while testing a new driver that creates a LocalTalk
network interface (LTALK_HLEN = 1). It caused an skb_under_panic.

Signed-off-by: Doug Brown <doug@schmorgal.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/appletalk/ddp.c