Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#35061 - [libpcap] segfaults when trying to enumerate usb devices when there's no USB hardware

Attached to Project: Arch Linux
Opened by pancake (pancake) - Thursday, 02 May 2013, 11:26 GMT
Last edited by Evangelos Foutras (foutrelis) - Sunday, 12 May 2013, 09:30 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Thomas Bächler (brain0)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

I'm running archlinux on a linode, which it's under a virtualized XEN that has no PCI or USB devices. The latest update of libpcap links against libusb and doesn't seems to handle this situation properly as long as it doesn't checks for null pointers..

Additional info:
* package version(s)

libpcap 1.3.0-3
libusb-compat 0.1.4-2
libusbx 1.0.15-1
tcpdump 4.4.0-1
usbutils 006-1


* config and/or log files etc.


Steps to reproduce:

# lsusb
unable to initialize libusb: -99
# tcpdump
Segmentation fault (core dumped)
# gdb tcpdump
(gdb) bt
#0 0x00007ffff7496b50 in __opendirat () from /usr/lib/libc.so.6
#1 0x00007ffff6dc2442 in ?? () from /usr/lib/libusb-1.0.so.0
#2 0x00007ffff6dba88a in libusb_get_device_list () from /usr/lib/libusb-1.0.so.0
#3 0x00007ffff77a1a9f in canusb_platform_finddevs () from /usr/lib/libpcap.so.1
#4 0x00007ffff779ecf4 in pcap_platform_finddevs () from /usr/lib/libpcap.so.1
#5 0x00007ffff77a1e93 in pcap_findalldevs () from /usr/lib/libpcap.so.1
#6 0x00007ffff77a3bd6 in pcap_lookupdev () from /usr/lib/libpcap.so.1
#7 0x00000000004048d9 in ?? ()
#8 0x00007ffff7405a15 in __libc_start_main () from /usr/lib/libc.so.6
#9 0x00000000004050ad in ?? ()
(gdb) disassemble $rip, $rip+20
Dump of assembler code from 0x7ffff7496b50 to 0x7ffff7496b64:
=> 0x00007ffff7496b50 <__opendirat+0>: cmpb $0x0,(%rsi)
0x00007ffff7496b53 <__opendirat+3>: je 0x7ffff7496b7d <__opendirat+45>
0x00007ffff7496b55 <__opendirat+5>: sub $0x8,%rsp
0x00007ffff7496b59 <__opendirat+9>: xor %ecx,%ecx
0x00007ffff7496b5b <__opendirat+11>: mov $0x90800,%edx
0x00007ffff7496b60 <__opendirat+16>: callq 0x7ffff74bcfe0 <__openat_nocancel>
End of assembler dump.
(gdb) print $rsi
$1 = 0


This task depends upon

Closed by  Evangelos Foutras (foutrelis)
Sunday, 12 May 2013, 09:30 GMT
Reason for closing:  Duplicate
Additional comments about closing:   FS#31014 
Comment by pancake (pancake) - Thursday, 02 May 2013, 11:41 GMT
Here's the patch for libpcap. im going to report this bug in mainstream
Comment by pancake (pancake) - Thursday, 02 May 2013, 11:45 GMT
uhm.. no need to report to mainstream. it's already fixed in git.
Comment by Thomas Bächler (brain0) - Friday, 03 May 2013, 08:22 GMT
There's also a pcap update pending. Has this fix been applied after 1.4.0 or before?
Comment by pancake (pancake) - Friday, 03 May 2013, 11:12 GMT
i have tested 1.4.0 on the same server with LD_LIBRARY_PATH set to the install dir and it seems to work fine, like the in the git.

Also, i have noticed that libpcap supports bluetooth sniffing too (didnt tested).

Why 1.4.0 is not listed in the website?
Comment by Thomas Bächler (brain0) - Friday, 03 May 2013, 11:23 GMT
It's out of date right now, needs an update. Expect one today.

Loading...