From: Eugeniu Rosca <erosca@de.adit-jv.com>
To: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Cc: <davem@davemloft.net>, <horms+renesas@verge.net.au>,
<kazuya.mizuguchi.ks@renesas.com>, <netdev@vger.kernel.org>,
<linux-renesas-soc@vger.kernel.org>
Subject: Re: [PATCH] ravb: Fix use-after-free on `ifconfig eth0 down`
Date: Wed, 7 Jun 2017 01:27:34 +0200 [thread overview]
Message-ID: <20170606232734.GA8581@vmlxhi-014.adit-jv.com> (raw)
In-Reply-To: <eaf9aa22-9087-977b-b048-3d1906176d1a@cogentembedded.com>
On Tue, Jun 06, 2017 at 12:35:30PM +0300, Sergei Shtylyov wrote:
> Hello!
>
> On 6/6/2017 1:08 AM, Eugeniu Rosca wrote:
>
> >Commit a47b70ea86bd ("ravb: unmap descriptors when freeing rings") has
> >introduced the issue seen in [1] reproduced on H3ULCB board.
> >
> >Fix this by relocating the RX skb ringbuffer free operation, so that
> >swiotlb page unmapping can be done first. Freeing of aligned TX buffers
> >is not relevant to the issue seen in [1]. Still, reposition TX free
> >calls as well, to have all kfree() operations performed consistently
> >_after_ dma_unmap_*()/dma_free_*().
>
> Perhaps it's a material of a separate cleanup patch?
Many thanks for feedback. For the moment, with a number of sanitizers
and debugging options enabled (UBSAN, KASAN, KMEMLEAK, DMA_API_DEBUG), I
couldn't find any other obvious ravb driver failures in basic usecases
(didn't stress-test it though).
Regarding the reordering of kfree vs dma_* API calls, which might be
needed in other parts of the driver, this possibly will be highlighted
by special usecases like repetitive suspend/resume or the like. I will
happily share any other fixes, if such are developed on our side.
Best regards,
Eugeniu.
next prev parent reply other threads:[~2017-06-06 23:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-05 22:08 [PATCH] ravb: Fix use-after-free on `ifconfig eth0 down` Eugeniu Rosca
2017-06-06 9:35 ` Sergei Shtylyov
2017-06-06 23:27 ` Eugeniu Rosca [this message]
2017-06-06 20:03 ` David Miller
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=20170606232734.GA8581@vmlxhi-014.adit-jv.com \
--to=erosca@de.adit-jv.com \
--cc=davem@davemloft.net \
--cc=horms+renesas@verge.net.au \
--cc=kazuya.mizuguchi.ks@renesas.com \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sergei.shtylyov@cogentembedded.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox