Skip to content

Commit 4e085e7

Browse files
committed
econet: Fix crash in aun_incoming().
Unconditional use of skb->dev won't work here, try to fetch the econet device via skb_dst()->dev instead. Suggested by Eric Dumazet. Reported-by: Nelson Elhage <[email protected]> Tested-by: Nelson Elhage <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f198725 commit 4e085e7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

net/econet/af_econet.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -851,9 +851,13 @@ static void aun_incoming(struct sk_buff *skb, struct aunhdr *ah, size_t len)
851851
{
852852
struct iphdr *ip = ip_hdr(skb);
853853
unsigned char stn = ntohl(ip->saddr) & 0xff;
854+
struct dst_entry *dst = skb_dst(skb);
855+
struct ec_device *edev = NULL;
854856
struct sock *sk = NULL;
855857
struct sk_buff *newskb;
856-
struct ec_device *edev = skb->dev->ec_ptr;
858+
859+
if (dst)
860+
edev = dst->dev->ec_ptr;
857861

858862
if (! edev)
859863
goto bad;

0 commit comments

Comments
 (0)