From: Sagi Grimberg <sagi@grimberg.me>
To: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] net/mlx5: Fix possible NULL deref in RX path
Date: Tue, 2 Aug 2016 12:31:35 +0300 [thread overview]
Message-ID: <0e002bcc-017b-8d5e-f820-111f5c3a7b46@grimberg.me> (raw)
In-Reply-To: <20160801164342.GL9044@6wind.com>
On 01/08/16 19:43, Adrien Mazarguil wrote:
> Hi Sagi,
>
> On Mon, Aug 01, 2016 at 11:44:21AM +0300, Sagi Grimberg wrote:
>> The user is allowed to call ->rx_pkt_burst() even without free
>> mbufs in the pool. In this scenario we'll fail allocating a rep mbuf
>> on the first iteration (where pkt is still NULL). This would cause us
>> to deref a NULL pkt (reset refcount and free).
>>
>> Fix this by checking the pkt before freeing it.
>
> Just to be sure, did you get an actual NULL deref crash here or is that an
> assumed possibility?
>
> I'm asking because this problem was supposed to be addressed by:
>
> a1bdb71a32da ("net/mlx5: fix crash in Rx")
I actually got the NULL deref. This happens when the application doesn't
restore mbufs to the pool correctly. In the case rte_mbuf_raw_alloc
will fail on the first iteration (pkt wasn't assigned) unlike the
condition handled in a1bdb71a32da.
With this applied, I didn't see the crash.
next prev parent reply other threads:[~2016-08-02 9:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1470041061-8059-1-git-send-email-sagi@grimberg.me>
2016-08-01 16:43 ` Adrien Mazarguil
2016-08-02 9:31 ` Sagi Grimberg [this message]
2016-08-02 9:58 ` Adrien Mazarguil
2016-08-02 10:47 ` Sagi Grimberg
2016-08-02 11:31 ` Adrien Mazarguil
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=0e002bcc-017b-8d5e-f820-111f5c3a7b46@grimberg.me \
--to=sagi@grimberg.me \
--cc=adrien.mazarguil@6wind.com \
--cc=dev@dpdk.org \
/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;
as well as URLs for NNTP newsgroup(s).