Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vdpa/virtio: Add support for virtio-blk for vdpa driver #4

Merged
merged 2 commits into from
Jul 4, 2022

Conversation

kailiangz1
Copy link
Collaborator

Enable config_get/set feature for virtio-blk
Add config_get/set vhost message handle in vhost framework

Signed-off-by: Kailiang Zhou kailiangz@nvidia.com

#define VHOST_USER_MAX_CONFIG_SIZE 256
#endif

/** Get/set config msg payload */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove one extra "*".

@@ -3311,7 +3355,7 @@ int rte_vhost_host_notifier_ctrl(int vid, uint16_t qid, bool enable)
return -ENODEV;

if (!(dev->features & (1ULL << VIRTIO_F_VERSION_1)) ||
!(dev->features & (1ULL << VHOST_USER_F_PROTOCOL_FEATURES)) ||
/* !(dev->features & (1ULL << VHOST_USER_F_PROTOCOL_FEATURES)) ||-----blk device will not negotiate protocal feature, but still can use notify*/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

too long line, cut it out.

* For legacy virtio, if VIRTIO_F_ANY_LAYOUT is not negotiated,
* this is the first element of the read scatter-gather list.
*/
struct virtio_blk_outhdr {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the code that you are not using here.

@@ -0,0 +1,177 @@
/* SPDX-License-Identifier: BSD-3-Clause
* Copyright (c) 2022 NVIDIA Corporation & Affiliates
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also include this file in virtio.h, just like virtio_net.h

@kailiangz1 kailiangz1 force-pushed the main_submit branch 2 times, most recently from fa776f1 to f0580a4 Compare June 2, 2022 08:36
@@ -600,6 +617,10 @@ const struct virtio_dev_specific_ops virtio_net_dev_pci_modern_ops = {
.get_queue_num = modern_net_get_queue_num,
};

const struct virtio_dev_specific_ops virtio_blk_dev_pci_modern_ops = {
.get_queue_num = modern_blk_get_queue_num,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for extra white space after get_queue_num. remove.

@@ -179,6 +180,19 @@ start_vdpa(struct vdpa_port *vport)
"register driver failed: %s\n",
socket_path);

/*vdpa device should get feature from device and not use builtin_net_driver*/
ret = rte_vdpa_get_features(vport->dev,&features);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

white space after dev, is needed.

@@ -179,6 +180,19 @@ start_vdpa(struct vdpa_port *vport)
"register driver failed: %s\n",
socket_path);

/*vdpa device should get feature from device and not use builtin_net_driver*/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

white space before and after /* and */ is needed.

you need to review those cosmetics once before posting here.

@@ -2131,6 +2168,11 @@ vhost_user_get_vring_base(struct virtio_net **pdev,
/* We have to stop the queue (virtio) if it is running. */
vhost_destroy_device_notify(dev);

/* Device is not running after get vring base, we should unmask driver_ok.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all of these changes for get and set config etc, has nothing to do with blk.

split the patches to two.
one for blk actual work and one for this.

};

#define VIRTIO_VDPA_DRIVER_NAME vdpa_virtio
#define VIRTIO_VDPA_NET_PROTOCOL_FEATURES \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line doesnt belong to this generic virtio.h keep in the net file.

if (priv->pdev->id.device_id == VIRTIO_PCI_MODERN_DEVICEID_NET)
*features = VIRTIO_VDPA_NET_PROTOCOL_FEATURES;
else if (priv->pdev->id.device_id == VIRTIO_PCI_MODERN_DEVICEID_BLK)
*features = VIRTIO_VDPA_BLK_PROTOCOL_FEATURES;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get them from the device specific callback.

priv->dev_ops = &virtio_vdpa_net_callback;
else if (priv->pdev->id.device_id == VIRTIO_PCI_MODERN_DEVICEID_BLK)
priv->dev_ops = &virtio_vdpa_blk_callback;

priv->vfio_dev_fd = rte_intr_dev_fd_get(pci_dev->intr_handle);
if (priv->vfio_dev_fd < 0) {
DRV_LOG(ERR, "%s failed to get vfio dev fd", devname);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After virtio_pci_dev_alloc, rte_vdpa_register_device, virtio_pci_dev_interrupts_alloc, mem leak will happen

*/

/* These two define direction. */
#define VIRTIO_BLK_T_IN 0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix extra tab before 0

extern struct virtio_vdpa_device_callback virtio_vdpa_blk_callback;
extern struct virtio_vdpa_device_callback virtio_vdpa_net_callback;

#define VIRTIO_VDPA_INTR_RETRIES_USEC 1000
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these two variables can stay back in the .c file.

bool configured;
};

extern struct virtio_vdpa_device_callback virtio_vdpa_blk_callback;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

externs should be in .c file and not .h.

struct virtio_vdpa_priv *priv;
};

#define VIRTIO_VDPA_DRIVER_NAME vdpa_virtio
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

string should be in "vdpa_virtio".

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

current in DPDK, all driver don't use "" in RTE_PMD_REGISTER_PCI

@@ -468,6 +469,22 @@ modern_net_get_queue_num(struct virtio_hw *hw)

}

static uint16_t
modern_blk_get_queue_num(struct virtio_hw *hw)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this function be shifted to virtio_vdpa_blk.c similar for net.c

#include "virtqueue.h"

static uint16_t
modern_net_get_queue_num(struct virtio_hw *hw)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cut down this routine. it was overkill from the beginning.

struct virtio_pci_common_cfg {} structure has num_queues field for all the device types including net and blk.
This needs to reflect the maximum queue value regardless of device type.

Use it uniformly for net and blk.
and put in common code.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

num_queue include control queue and admin queue.
VDPA driver use this to get how many IO queue device can support.
so, shoule only return number of IO queue.
So, blk and net is different also.
we should keep this code , but only remove admin queue and controler queue logic.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kailiangz1 the logic should be in get_vqs_num() callbkc to be,

get_hw_num_vqs() -1 for net cvq.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should not like this, get_hw_num_vqs to get from common config's num_queues is hard to judge
whether the number include cvq or admin vq.
Directly get from virtio_net_config obey the spec and do need to calculate.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kailiangz1 num_vqs is generic for all the protocols regardless of device type. This is the virtio pci layer provides.
vdpa net and block layer can derive its own value from low layer.

This is simple math. no need to judge/guess anything.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to judge whether cvq is enabled and whether admin vq is enabled.

@@ -179,6 +180,19 @@ start_vdpa(struct vdpa_port *vport)
"register driver failed: %s\n",
socket_path);

/* vdpa device should get feature from device and not use builtin_net_driver */
ret = rte_vdpa_get_features(vport->dev, &features);
if (ret != 0)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just do

if (ret)

below also

socket_path);

ret = rte_vhost_driver_set_features(socket_path, features);
if (ret != 0)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (ret)

rte_exit(EXIT_FAILURE,
"set feature failed: %s\n",
socket_path);

ret = rte_vhost_driver_callback_register(socket_path,
&vdpa_sample_devops);
if (ret != 0)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (ret)

vdpa_dev = dev->vdpa_dev;

if (vdpa_dev)
vdpa_dev->ops->get_dev_config(dev->vid,ctx->msg.payload.cfg.region,ctx->msg.payload.cfg.size);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

white space after, ","

split to two lines.

Please run kernel checkpatch.pl before pushing changes to catch such silly cosmetic changes.

struct vhu_msg_context *ctx __rte_unused,
int main_fd __rte_unused)
{
VHOST_LOG_CONFIG(ERR, "vhost_user_set_config not supported");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the commit msg you say, it is must, but in the actual code it does nothing.

How does it work?
When set_config() called?
Does the caller ignore the return status?

if so, can this routine be set to NULL?

What all config fields are setup today by QEMU on this area?

Copy link
Collaborator Author

@kailiangz1 kailiangz1 Jun 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

set_config is read only for virtio-blk device, so, remove it.

For virito-blk device, vhost must support config msg.
So, add support for vhost framework

Signed-off-by: Kailiang Zhou <kailiangz@nvidia.com>
Enable config_get/set feature for virtio-blk
Seprate vhost feature get for blk and net device

Signed-off-by: Kailiang Zhou <kailiangz@nvidia.com>
#define VIRTIO_VDPA_INTR_RETRIES 256

extern struct virtio_vdpa_device_callback virtio_vdpa_blk_callback;
extern struct virtio_vdpa_device_callback virtio_vdpa_net_callback;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kailiangz1 we have layering problem but can be fixed later.

@paravmellanox
Copy link
Collaborator

Overall we need some improvements, but this is good enough start.
so lets revisit the module layering again in some time.

@paravmellanox paravmellanox reopened this Jul 4, 2022
@paravmellanox paravmellanox merged commit 12403d9 into Mellanox:main Jul 4, 2022
yajwu added a commit to yajwu/dpdk-vhost-vfe that referenced this pull request Aug 28, 2023
In rte_vhost_driver_unregister which is called from vdpa-rpc thread,
vsocket should be removed from reconn_list again after remove vsocket
from conn_list. Because vhost_user_read_cb which is called in vhost-events
thread can add vsocket to reconn_list again.

When qemu close domain socket server, vhost_user_read_cb will be called
to clean up vhost device.

vsocket->path is NULL

    #0  0x00007f07665834d1 in __strnlen_sse2 () from /lib64/libc.so.6
    Mellanox#1  0x00007f076aee79da in vhost_user_add_connection (fd=160, vsocket=0x7f070406d160) at ../lib/vhost/socket.c:226
    Mellanox#2  0x00007f076aee7d63 in vhost_user_client_reconnect (arg=<optimized out>) at ../lib/vhost/socket.c:481
    Mellanox#3  0x00007f07668cbdd5 in start_thread () from /lib64/libpthread.so.0
    Mellanox#4  0x00007f07665f4ead in clone () from /lib64/libc.so.6

RM: 3585558
Signed-off-by: Yajun Wu <yajunw@nvidia.com>
kailiangz1 pushed a commit that referenced this pull request Aug 28, 2023
In rte_vhost_driver_unregister which is called from vdpa-rpc thread,
vsocket should be removed from reconn_list again after remove vsocket
from conn_list. Because vhost_user_read_cb which is called in vhost-events
thread can add vsocket to reconn_list again.

When qemu close domain socket server, vhost_user_read_cb will be called
to clean up vhost device.

vsocket->path is NULL

    #0  0x00007f07665834d1 in __strnlen_sse2 () from /lib64/libc.so.6
    #1  0x00007f076aee79da in vhost_user_add_connection (fd=160, vsocket=0x7f070406d160) at ../lib/vhost/socket.c:226
    #2  0x00007f076aee7d63 in vhost_user_client_reconnect (arg=<optimized out>) at ../lib/vhost/socket.c:481
    #3  0x00007f07668cbdd5 in start_thread () from /lib64/libpthread.so.0
    #4  0x00007f07665f4ead in clone () from /lib64/libc.so.6

RM: 3585558
Signed-off-by: Yajun Wu <yajunw@nvidia.com>
yajwu added a commit to yajwu/dpdk-vhost-vfe that referenced this pull request Sep 11, 2023
When MSIX configured less then queue number, quit testpmd in VM,
cause vDPA crash.

	Mellanox#3  0x00007fbc8421b489 in _int_free () from /lib64/libc.so.6
	Mellanox#4  0x0000000001a471c5 in virtio_vdpa_virtq_doorbell_relay_disable (vq_idx=vq_idx@entry=11, priv=<optimized out>, priv=<optimized out>) at ../drivers/vdpa/virtio/virtio_vdpa.c:349
	Mellanox#5  0x0000000001a47275 in virtio_vdpa_virtq_disable () at ../drivers/vdpa/virtio/virtio_vdpa.c:413
	Mellanox#6  0x0000000001a47a5a in virtio_vdpa_vring_state_set () at ../drivers/vdpa/virtio/virtio_vdpa.c:588
	Mellanox#7  0x00000000005ad8af in vhost_user_notify_queue_state (dev=0x17ffcd000, index=11, enable=0) at ../lib/vhost/vhost_user.c:283
	Mellanox#8  0x00000000005b0414 in vhost_user_msg_handler (vid=<optimized out>, fd=<optimized out>) at ../lib/vhost/vhost_user.c:3164
	Mellanox#9  0x00000000012f812f in vhost_user_read_cb () at ../lib/vhost/socket.c:310

When callfd == -1, virtio_pci_dev_interrupt_enable is skilled. But in
virtio_vdpa_virtq_disable, no such check to skip virtio_pci_dev_interrupt_disable.
virtio_vdpa_virtq_disable return error without changing queue state to disable.
Double free is caused by this wrong queue state.

The fix is to add/check vector_enable variable for virtio_pci_dev_interrupt_disable.
And remove error return in virtio_vdpa_virtq_disable.

RM: 3587409
Signed-off-by: Yajun Wu <yajunw@nvidia.com>
yajwu added a commit to yajwu/dpdk-vhost-vfe that referenced this pull request Sep 11, 2023
When MSIX configured less then queue number, quit testpmd in VM,
cause vDPA crash.

	Mellanox#3  0x00007fbc8421b489 in _int_free () from /lib64/libc.so.6
	Mellanox#4  0x0000000001a471c5 in virtio_vdpa_virtq_doorbell_relay_disable (vq_idx=vq_idx@entry=11, priv=<optimized out>, priv=<optimized out>) at ../drivers/vdpa/virtio/virtio_vdpa.c:349
	Mellanox#5  0x0000000001a47275 in virtio_vdpa_virtq_disable () at ../drivers/vdpa/virtio/virtio_vdpa.c:413
	Mellanox#6  0x0000000001a47a5a in virtio_vdpa_vring_state_set () at ../drivers/vdpa/virtio/virtio_vdpa.c:588
	Mellanox#7  0x00000000005ad8af in vhost_user_notify_queue_state (dev=0x17ffcd000, index=11, enable=0) at ../lib/vhost/vhost_user.c:283
	Mellanox#8  0x00000000005b0414 in vhost_user_msg_handler (vid=<optimized out>, fd=<optimized out>) at ../lib/vhost/vhost_user.c:3164
	Mellanox#9  0x00000000012f812f in vhost_user_read_cb () at ../lib/vhost/socket.c:310

When callfd == -1, virtio_pci_dev_interrupt_enable is skipped. But in
virtio_vdpa_virtq_disable, no such check to skip virtio_pci_dev_interrupt_disable.
virtio_vdpa_virtq_disable return error without changing queue state to disable.
Double free is caused by this wrong queue state.

The fix is to add/check vector_enable variable for virtio_pci_dev_interrupt_disable.
And remove error return in virtio_vdpa_virtq_disable.

RM: 3587409
Signed-off-by: Yajun Wu <yajunw@nvidia.com>
kailiangz1 pushed a commit that referenced this pull request Sep 18, 2023
When MSIX configured less then queue number, quit testpmd in VM,
cause vDPA crash.

	#3  0x00007fbc8421b489 in _int_free () from /lib64/libc.so.6
	#4  0x0000000001a471c5 in virtio_vdpa_virtq_doorbell_relay_disable (vq_idx=vq_idx@entry=11, priv=<optimized out>, priv=<optimized out>) at ../drivers/vdpa/virtio/virtio_vdpa.c:349
	#5  0x0000000001a47275 in virtio_vdpa_virtq_disable () at ../drivers/vdpa/virtio/virtio_vdpa.c:413
	#6  0x0000000001a47a5a in virtio_vdpa_vring_state_set () at ../drivers/vdpa/virtio/virtio_vdpa.c:588
	#7  0x00000000005ad8af in vhost_user_notify_queue_state (dev=0x17ffcd000, index=11, enable=0) at ../lib/vhost/vhost_user.c:283
	#8  0x00000000005b0414 in vhost_user_msg_handler (vid=<optimized out>, fd=<optimized out>) at ../lib/vhost/vhost_user.c:3164
	#9  0x00000000012f812f in vhost_user_read_cb () at ../lib/vhost/socket.c:310

When callfd == -1, virtio_pci_dev_interrupt_enable is skipped. But in
virtio_vdpa_virtq_disable, no such check to skip virtio_pci_dev_interrupt_disable.
virtio_vdpa_virtq_disable return error without changing queue state to disable.
Double free is caused by this wrong queue state.

The fix is to add/check vector_enable variable for virtio_pci_dev_interrupt_disable.
And remove error return in virtio_vdpa_virtq_disable.

RM: 3587409
Signed-off-by: Yajun Wu <yajunw@nvidia.com>
Ch3n60x pushed a commit to Ch3n60x/dpdk-vhost-vfe that referenced this pull request Mar 27, 2024
[ upstream commit 1c80a40 ]

The net/vhost pmd currently provides a -1 vid when disabling interrupt
after a virtio port got disconnected.

This can be caught when running with ASan.

First, start dpdk-l3fwd-power in interrupt mode with a net/vhost port.

$ ./build-clang/examples/dpdk-l3fwd-power -l0,1 --in-memory \
	-a 0000:00:00.0 \
	--vdev net_vhost0,iface=plop.sock,client=1\
	-- \
	-p 0x1 \
	--interrupt-only \
	--config '(0,0,1)' \
	--parse-ptype 0

Then start testpmd with virtio-user.

$ ./build-clang/app/dpdk-testpmd -l0,2 --single-file-segment --in-memory \
	-a 0000:00:00.0 \
	--vdev net_virtio_user0,path=plop.sock,server=1 \
	-- \
	-i

Finally stop testpmd.
ASan then splats in dpdk-l3fwd-power:

=================================================================
==3641005==ERROR: AddressSanitizer: global-buffer-overflow on address
	0x000005ed0778 at pc 0x000001270f81 bp 0x7fddbd2eee20
	sp 0x7fddbd2eee18
READ of size 8 at 0x000005ed0778 thread T2
    #0 0x1270f80 in get_device .../lib/vhost/vhost.h:801:27
    Mellanox#1 0x1270f80 in rte_vhost_get_vhost_vring .../lib/vhost/vhost.c:951:8
    Mellanox#2 0x3ac95cb in eth_rxq_intr_disable
	.../drivers/net/vhost/rte_eth_vhost.c:647:8
    Mellanox#3 0x170e0bf in rte_eth_dev_rx_intr_disable
	.../lib/ethdev/rte_ethdev.c:5443:25
    Mellanox#4 0xf72ba7 in turn_on_off_intr .../examples/l3fwd-power/main.c:881:4
    Mellanox#5 0xf71045 in main_intr_loop .../examples/l3fwd-power/main.c:1061:6
    Mellanox#6 0x17f9292 in eal_thread_loop
	.../lib/eal/common/eal_common_thread.c:210:9
    Mellanox#7 0x18373f5 in eal_worker_thread_loop .../lib/eal/linux/eal.c:915:2
    Mellanox#8 0x7fddc16ae12c in start_thread (/lib64/libc.so.6+0x8b12c)
	(BuildId: 81daba31ee66dbd63efdc4252a872949d874d136)
    Mellanox#9 0x7fddc172fbbf in __GI___clone3 (/lib64/libc.so.6+0x10cbbf)
	(BuildId: 81daba31ee66dbd63efdc4252a872949d874d136)

0x000005ed0778 is located 8 bytes to the left of global variable
	'vhost_devices' defined in '.../lib/vhost/vhost.c:24'
	(0x5ed0780) of size 8192
0x000005ed0778 is located 20 bytes to the right of global variable
	'vhost_config_log_level' defined in '.../lib/vhost/vhost.c:2174'
	(0x5ed0760) of size 4
SUMMARY: AddressSanitizer: global-buffer-overflow
	.../lib/vhost/vhost.h:801:27 in get_device
Shadow bytes around the buggy address:
  0x000080bd2090: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
  0x000080bd20a0: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
  0x000080bd20b0: f9 f9 f9 f9 00 f9 f9 f9 00 f9 f9 f9 00 f9 f9 f9
  0x000080bd20c0: 00 00 00 00 00 00 00 f9 f9 f9 f9 f9 04 f9 f9 f9
  0x000080bd20d0: 00 00 00 00 00 f9 f9 f9 f9 f9 f9 f9 00 00 00 00
=>0x000080bd20e0: 00 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9 04 f9 f9[f9]
  0x000080bd20f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x000080bd2100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x000080bd2110: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x000080bd2120: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x000080bd2130: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
Thread T2 created by T0 here:
    #0 0xe98996 in __interceptor_pthread_create
	(.examples/dpdk-l3fwd-power+0xe98996)
	(BuildId: d0b984a3b0287b9e0f301b73426fa921aeecca3a)
    Mellanox#1 0x1836767 in eal_worker_thread_create .../lib/eal/linux/eal.c:952:6
    Mellanox#2 0x1834b83 in rte_eal_init .../lib/eal/linux/eal.c:1257:9
    Mellanox#3 0xf68902 in main .../examples/l3fwd-power/main.c:2496:8
    Mellanox#4 0x7fddc164a50f in __libc_start_call_main (/lib64/libc.so.6+0x2750f)
	(BuildId: 81daba31ee66dbd63efdc4252a872949d874d136)

==3641005==ABORTING

More generally, any application passing an incorrect vid would trigger
such an OOB access.

Fixes: 4796ad6 ("examples/vhost: import userspace vhost application")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants