NetworkConfiguration / dhcpcd

DHCP / IPv4LL / IPv6RA / DHCPv6 client.
https://roy.marples.name/projects/dhcpcd
BSD 2-Clause "Simplified" License
337 stars 109 forks source link

Segmentation fault in debian bookworm #235

Closed zabarabab closed 1 year ago

zabarabab commented 1 year ago

In https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1041204 I reported a Segmentation fault in debian bookworm.

Martin-Éric asked me to "open a bug upstream and attach a backtrace, just so that we can confirm whether it is a different bug. This would be good to know, because the patch for the earlier bug you mention (#156) has been merged in 9.4.1-12, so it likely is a different issue."

Here it is:


(gdb) run
Starting program: /usr/sbin/dhcpcd -T enp0s25
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
dhcpcd-9.4.1 starting
[Detaching after fork from child process 19135]
[Detaching after fork from child process 19136]
DUID 00:04:af:d6:73:01:53:a4:11:cb:8c:cf:f8:0b:0f:76:cd:a5
enp0s25: IAID 75:00:7c:3a
dhcp6_openudp: Address already in use
ps_inet_listenin6: Address already in use
ps_root_recvmsg: Address already in use
enp0s25: soliciting an IPv6 router
enp0s25: soliciting a DHCP lease
ps_sendpsmmsg: Transport endpoint is not connected
ps_sendpsmmsg: Transport endpoint is not connected
ps_sendpsmmsg: Transport endpoint is not connected
ps_sendpsmmsg: Transport endpoint is not connected
ps_bpf_recvbpf: Transport endpoint is not connected
ps_bpf_recvbpf: Transport endpoint is not connected
ps_bpf_recvbpf: Transport endpoint is not connected
ps_bpf_recvbpf: Transport endpoint is not connected
enp0s25: offered 192.168.1.223 from 192.168.1.2
interface='enp0s25'
pid='19132'
protocol='dhcp'
reason='TEST'
ifcarrier='up'
ifflags='69699'
ifmetric='1002'
ifmtu='1500'
ifwireless='0'
new_broadcast_address='192.168.1.255'
new_dhcp_lease_time='1800'
new_dhcp_message_type='2'
new_dhcp_server_identifier='192.168.1.2'
new_domain_name='linuxhotel.de'
new_domain_name_servers='192.168.1.5'
new_host_name='notebook23'
new_ip_address='192.168.1.223'
new_network_number='192.168.1.0'
new_routers='192.168.1.5'
new_subnet_cidr='24'
new_subnet_mask='255.255.255.0'

Program received signal SIGSEGV, Segmentation fault.
0x000055555557da82 in dhcp_handledhcp (ifp=0x5555555d2070, bootp=0x7ffffffee54c, bootp_len=<optimized out>, 
    from=<optimized out>) at ./src/dhcp.c:3339
3339    ./src/dhcp.c: Datei oder Verzeichnis nicht gefunden.
(gdb) bt
#0  0x000055555557da82 in dhcp_handledhcp (ifp=0x5555555d2070, bootp=0x7ffffffee54c, bootp_len=<optimized out>, 
    from=<optimized out>) at ./src/dhcp.c:3339
#1  0x000055555557daec in dhcp_handlebootp (ifp=<optimized out>, bootp=<optimized out>, len=<optimized out>, 
    from=<optimized out>) at ./src/dhcp.c:3552
#2  0x000055555557de61 in dhcp_packet (ifp=0x5555555d2070, data=0x7ffffffee530 "E\020\001O", len=335, 
    bpf_flags=<optimized out>) at ./src/dhcp.c:3622
#3  0x0000555555595128 in ps_bpf_dispatch (ctx=ctx@entry=0x7fffffffe6d0, psm=psm@entry=0x7ffffffee4f0, 
    msg=msg@entry=0x7ffffffee4a0) at ./src/privsep-bpf.c:299
#4  0x0000555555592419 in ps_root_dispatchcb (arg=arg@entry=0x7fffffffe6d0, psm=psm@entry=0x7ffffffee4f0, 
    msg=msg@entry=0x7ffffffee4a0) at ./src/privsep-root.c:769
#5  0x0000555555591ae4 in ps_recvpsmsg (ctx=<optimized out>, fd=<optimized out>, 
    callback=callback@entry=0x555555592400 <ps_root_dispatchcb>, cbctx=0x7fffffffe6d0) at ./src/privsep.c:988
#6  0x00005555555922b9 in ps_root_dispatch (arg=<optimized out>) at ./src/privsep-root.c:782
#7  0x000055555556519f in eloop_start (eloop=0x5555555c93e0, signals=signals@entry=0x7fffffffe918) at ./src/eloop.c:779
#8  0x000055555555e520 in main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>) at ./src/dhcpcd.c:2553
(gdb) ps_sendpsmmsg: Transport endpoint is not connected
ps_sendpsmmsg: Transport endpoint is not connected
ps_bpf_recvbpf: Transport endpoint is not connected
ps_bpf_recvbpf: Transport endpoint is not connected
ps_sendpsmmsg: Transport endpoint is not connected
ps_bpf_recvbpf: Transport endpoint is not connected
ps_sendpsmmsg: Transport endpoint is not connected
ps_bpf_recvbpf: Transport endpoint is not connected
(gdb) ```
ido commented 1 year ago

Can you reproduce this on master, 10.0.2, or 9.5.2?

perkelix commented 1 year ago

I notice that commit https://github.com/NetworkConfiguration/dhcpcd/commit/f77c5f131b23fe5d20e8a4d852c7c69f2647f879 fixed another segmentation fault. Could this be it?

perkelix commented 1 year ago

@zabarabab can you answer the question?

zabarabab commented 1 year ago

Sorry, I currently can't dig into this