lkml.org 
[lkml]   [2012]   [Oct]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] aoe: avoid using skb member after dev_queue_xmit
On Wed, 24 Oct 2012 14:26:13 -0400
Ed Cashin <ecashin@coraid.com> wrote:

> After calling dev_queue_xmit it is no longer safe to access the
> members of the skb.
>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

hm, that was clever. How did Dan detect this bug?

> --- a/drivers/block/aoe/aoenet.c
> +++ b/drivers/block/aoe/aoenet.c
> @@ -55,12 +55,14 @@ static int
> tx(void) __must_hold(&txlock)
> {
> struct sk_buff *skb;
> + struct net_device *ifp;
>
> while ((skb = skb_dequeue(&skbtxq))) {
> spin_unlock_irq(&txlock);
> + ifp = skb->dev;
> if (dev_queue_xmit(skb) == NET_XMIT_DROP && net_ratelimit())
> pr_warn("aoe: packet could not be sent on %s. %s\n",
> - skb->dev ? skb->dev->name : "netif",
> + ifp ? ifp->name : "netif",
> "consider increasing tx_queue_len");
> spin_lock_irq(&txlock);
> }

Queued as a fix against the not-yet-upstream
aoe-print-warning-regarding-a-common-reason-for-dropped-transmits.patch,
thanks.



\
 
 \ /
  Last update: 2012-10-25 01:01    [W:0.263 / U:0.528 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site