All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Yasushi SHOJI <yashi@atmark-techno.com>, netdev@vger.kernel.org
Subject: Re: sh_eth.c::sh_eth_rx(): mdp->rx_skbuff[entry] can be NULL
Date: Tue, 20 Oct 2015 23:48:01 +0300	[thread overview]
Message-ID: <5626A881.2080701@cogentembedded.com> (raw)
In-Reply-To: <87oafusy11.wl@dns1.atmark-techno.com>

Hello.

On 10/19/2015 06:01 PM, Yasushi SHOJI wrote:

> In a low memory situation with netdev_alloc_skb() failure,
> mdp->rx_skbuff[entry] can be left NULL, however, sh_eth_rx() seems to
> access it without checking NULL or not in the following code:
>
> 			skb = mdp->rx_skbuff[entry];
> 			mdp->rx_skbuff[entry] = NULL;
> 			if (mdp->cd->rpadir)
> 				skb_reserve(skb, NET_IP_ALIGN);
> 			dma_unmap_single(&ndev->dev, rxdesc->addr,
> 					 ALIGN(mdp->rx_buf_sz, 16),
> 					 DMA_FROM_DEVICE);
>
> I've put BUG_ON() to test skb and got the following backtrace.  I can
> also enable slub poisoning to see some bad access.
>
> I'm not that familiar with this code base so I'm note including any
> patch yet.  I appreciate if someone with insight in this code give a
> quick look and tell me that it's a real one or not.  if this is a real
> case, I can take a deep look.

    If you got the oops, it's real. Thanks for the reporting. I guess I should 
check the new ravb driver as well...
    Do you want to try fixing the bug yourself?

> BTW, the backtrace is from old 3.4.74+ kernel but the current tip is
> very close.

     Yeah, this part didn't change in a long time...

> Thanks,

MBR, Sergei

  reply	other threads:[~2015-10-20 20:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-19 15:01 sh_eth.c::sh_eth_rx(): mdp->rx_skbuff[entry] can be NULL Yasushi SHOJI
2015-10-20 20:48 ` Sergei Shtylyov [this message]
2015-10-21  7:26   ` Yasushi SHOJI
2015-10-22 21:17     ` Sergei Shtylyov
2015-10-23 11:05       ` Sergei Shtylyov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5626A881.2080701@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=netdev@vger.kernel.org \
    --cc=yashi@atmark-techno.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.