Skip to content

Commit

Permalink
appletalk: Fix socket referencing in skb
Browse files Browse the repository at this point in the history
Setting just skb->sk without taking its reference and setting a
destructor is invalid. However, in the places where this was done, skb
is used in a way not requiring skb->sk setting. So dropping the setting
of skb->sk.
Thanks to Eric Dumazet <eric.dumazet@gmail.com> for correct solution.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=79441
Reported-by: Ed Martin <edman007@edman007.com>
Signed-off-by: Andrey Utkin <andrey.krieger.utkin@gmail.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Andrey Utkin authored and davem330 committed Jul 9, 2014
1 parent e005659 commit 36beddc
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions net/appletalk/ddp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1489,8 +1489,6 @@ static int atalk_rcv(struct sk_buff *skb, struct net_device *dev,
goto drop;

/* Queue packet (standard) */
skb->sk = sock;

if (sock_queue_rcv_skb(sock, skb) < 0)
goto drop;

Expand Down Expand Up @@ -1644,7 +1642,6 @@ static int atalk_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr
if (!skb)
goto out;

skb->sk = sk;
skb_reserve(skb, ddp_dl->header_length);
skb_reserve(skb, dev->hard_header_len);
skb->dev = dev;
Expand Down

0 comments on commit 36beddc

Please sign in to comment.