DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@amd.com>
To: "Morten Brørup" <mb@smartsharesystems.com>,
	"Roger B Melton" <rmelton@cisco.com>,
	"Jochen Behrens" <jochen.behrens@broadcom.com>
Cc: dev@dpdk.org, Ronak Doshi <ronak.doshi@broadcom.com>
Subject: Re: [PATCH] net/vmxnet3: Fix vmxnet3 NULL pointer deref after configuration failure
Date: Thu, 31 Oct 2024 05:38:34 +0000	[thread overview]
Message-ID: <ced22999-fcf3-4746-894d-1c87183d77d9@amd.com> (raw)
In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35E9F82B@smartserver.smartshare.dk>

On 10/27/2024 8:43 AM, Morten Brørup wrote:
>> From: Roger B Melton [mailto:rmelton@cisco.com]
>> Sent: Saturday, 26 October 2024 16.34
>>
>> Problem:
>>
>> If vxmnet3_dev_configure() fails, applications may call
>> vmxnet3_dev_close(). If the failure occurs before the vmxnet3
>> hw->shared structure is allocated the close will lead to a segv.
>>
>> Root Cause:
>>
>> This crash is due to incorrect adapter_stopped state in the
>> vmxnet3 dev_private structure. When dev_private is allocated,
>> adapter_stopped will be 0 (FALSE).  eth_vmxnet3_dev_init() does not
>> set it to TRUE, so it will remain FALSE until a successful
>> vmxnet3_dev_start() followed by a vmxnet3_dev_stop().  When
>> vmxnet3_dev_close() is called, it will invoke vmxnet3_dev_stop().
>> vmxnet3_dev_stop() will check the adapter_stopped state in the
>> vmxnet3 shared data, find it is FALSE and will proceed to stop the
>> device, calling vmxnet3_disable_all_intrs().
>> vmxnet3_disable_all_intrs() attempts to access the vmxnet3 shared data
>> resulting in the segv.
>>
>> Solution:
>>
>> Set adapter_stopped to TRUE in eth_vmxnet3_dev_init(), to prevent stop
>> processing.
>>
>> Signed-off-by: Roger B Melton <rmelton@cisco.com>
> 
> Acked-by: Morten Brørup <mb@smartsharesystems.com>
> 

 Fixes: dfaff37fc46d ("vmxnet3: import new vmxnet3 poll mode driver
implementation")
 Cc: stable@dpdk.org

Applied to dpdk-next-net/main, thanks.

  reply	other threads:[~2024-10-31  5:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-26 14:33 Roger B Melton
2024-10-27  8:43 ` Morten Brørup
2024-10-31  5:38   ` Ferruh Yigit [this message]
2024-10-30  3:15 ` Ferruh Yigit
2024-10-30 20:27   ` Roger Melton (rmelton)
2024-10-31  0:08     ` Roger Melton (rmelton)

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=ced22999-fcf3-4746-894d-1c87183d77d9@amd.com \
    --to=ferruh.yigit@amd.com \
    --cc=dev@dpdk.org \
    --cc=jochen.behrens@broadcom.com \
    --cc=mb@smartsharesystems.com \
    --cc=rmelton@cisco.com \
    --cc=ronak.doshi@broadcom.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;
as well as URLs for NNTP newsgroup(s).