Skip to content

Conversation

guedou
Copy link
Member

@guedou guedou commented Jan 15, 2016

No description provided.

p-l- added a commit that referenced this pull request Jan 15, 2016
@p-l- p-l- merged commit f5cb464 into secdev:master Jan 15, 2016
wataash added a commit to wataash/scapy that referenced this pull request Feb 17, 2020
errno set by pcap_open_live(3) (typically EPERM or ENXIO) was not
checked, eventually causing a segmentation violation at
pcap_get_selectable_fd():

    $ python3 -c 'from scapy.all import *; conf.use_pcap = True; sendp("", iface="nonexist0")'
    fish: “python3 -c 'from scapy.all impo…” terminated by signal SIGSEGV (Address boundary error)

because pcap_get_selectable_fd(3) refered to NULL:

    (gdb) bt
    #0  pcap_get_selectable_fd (p=0x0) at ./pcap.c:1419
    secdev#1  0x00007f963a72781e in ffi_call_unix64 () from /lib/x86_64-linux-gnu/libffi.so.6
    secdev#2  0x00007f963a7271ef in ffi_call () from /lib/x86_64-linux-gnu/libffi.so.6
    secdev#3  0x00007f963b17cf49 in _call_function_pointer (flags=flags@entry=4353, pProc=pProc@entry=0x7f96382d1300 <pcap_get_selectable_fd>, avalues=0x7ffd96028bd0,
        atypes=<optimized out>, restype=<optimized out>, resmem=resmem@entry=0x7ffd96028be0, argcount=1) at ./Modules/_ctypes/callproc.c:827
    secdev#4  0x00007f963b17d965 in _ctypes_callproc (pProc=pProc@entry=0x7f96382d1300 <pcap_get_selectable_fd>, argtuple=argtuple@entry=0x7f963b263608, flags=4353,
        argtypes=argtypes@entry=0x7f9638360d58, restype=restype@entry=0x18d7628, checker=checker@entry=0x0) at ./Modules/_ctypes/callproc.c:1184
    secdev#5  0x00007f963b176401 in PyCFuncPtr_call (self=0x7f963836bcf0, inargs=<optimized out>, kwds=<optimized out>) at ./Modules/_ctypes/_ctypes.c:3969
    secdev#6  0x000000000043730f in ?? ()
    secdev#7  0x00007f96382823b8 in ?? ()
    secdev#8  0x0000000000000000 in ?? ()

    (gdb) l
    1414
    1415	#if !defined(_WIN32) && !defined(MSDOS)
    1416	int
    1417	pcap_get_selectable_fd(pcap_t *p)
    1418	{
    1419		return (p->selectable_fd);
    1420	}
    1421	#endif
    1422
    1423	void

    (gdb) p p
    $1 = (pcap_t *) 0x0
p-l- pushed a commit that referenced this pull request May 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants