Bug ID 1786
Summary dumpcap crashes with segmentation fault when capturing from af_packet
Product DPDK
Version unspecified
Hardware All
OS All
Status UNCONFIRMED
Severity normal
Priority Normal
Component ethdev
Assignee dev@dpdk.org
Reporter kerem.aksu@i2i-systems.com
Target Milestone ---

dumpcap crashes when capturing traffic from af_packet ethernet device.

$ ./dpdk-dumpcap -i 0
Capturing on 'net_af_packet0'
File: /tmp/dpdk-dumpcap_0_net_af_packet0_20250912103908.pcapng

Thread 1 "dpdk-dumpcap" received signal SIGSEGV, Segmentation fault.
0x00007ffff7e46d78 in strlcpy () from /lib/x86_64-linux-gnu/libbsd.so.0


#0  0x00007ffff7e46d78 in strlcpy () from /lib/x86_64-linux-gnu/libbsd.so.0
#1  0x0000555556406faa in eth_dev_change_flags (if_name=0x560490350da0 <error:
Cannot access memory at address 0x560490350da0>, flags=256, mask=4294967295) at
../drivers/net/af_packet/rte_eth_af_packet.c:592
#2  0x0000555556407080 in eth_dev_promiscuous_enable (dev=0x55555b38d680
<rte_eth_devices>) at ../drivers/net/af_packet/rte_eth_af_packet.c:613
#3  0x0000555556211eb1 in rte_eth_promiscuous_enable (port_id=0) at
../lib/ethdev/rte_ethdev.c:2680
#4  0x0000555555629a49 in enable_pdump (r=0x15b438040, mp=0x15ba3c900) at
../app/dumpcap/main.c:688
#5  0x000055555562af5b in main (argc=3, argv=0x7fffffffe448) at
../app/dumpcap/main.c:818

dumpcap tries to enable promiscuous mode on the host device but it cannot
access device name and crashes.

I think problem caused by a strdup(3) within rte_eth_af_packet.c:744 struct
pmd_internals * (internals)->if_name is allocated with strdup(3) which is not
accessible from secondary process (in this context dumpcap). 

Allocating this field with rte_malloc probably will fix the issue.
          


You are receiving this mail because: