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

glibc 2.41 broke dhcpcd #450

Open
maravtdm opened this issue Jan 31, 2025 · 8 comments
Open

glibc 2.41 broke dhcpcd #450

maravtdm opened this issue Jan 31, 2025 · 8 comments

Comments

@maravtdm
Copy link

maravtdm commented Jan 31, 2025

After compiling dhcpcd with glibc 2.41
dhcpcd never start, it seems that privsep is broken

# dhcpcd -d -t 15 -L wlan0
dhcpcd-10.1.0 starting
chrooting as dhcpcd to /var/lib/dhcpcd
sandbox: seccomp
spawned manager process on PID 13803
spawned privileged proxy on PID 13804
spawned network proxy on PID 13805
spawned controller proxy on PID 13806
DUID 00:01:00:01:2d:3c:fb:17:a2:fb:c5:dc:b7:b5
wlan0: spawned DHCP6 proxy 2a01:e0a:7a:5c80:8a5b:1da1:6873:bf67 on PID 13809
wlan0: executing: /lib/dhcpcd/dhcpcd-run-hooks PREINIT
wlan0: spawned DHCP6 proxy fe80::b37f:103f:b8e0:ddfc on PID 13810
wlan0: connected to Access Point: XXXXXXXXX
wlan0: executing: /lib/dhcpcd/dhcpcd-run-hooks CARRIER
wlan0: IAID 88:51:f7:11
dhcpcd_fork_cb: dhcpcd manager hungup

@perkelix
Copy link
Contributor

Can you enable debug output (add the debug statement to dhcpcd.conf or use the -d option) and paste the result here?

@maravtdm
Copy link
Author

I've already enabled debug mode
see my command => dhcpcd -d -t 15 -L wlan0

@perkelix
Copy link
Contributor

Sorry, I missed that. Still, debug would normally show a LOT more output than what you pasted.

@loqs
Copy link

loqs commented Feb 1, 2025

Similar downstream report dhcpcd fails with Bad system call error with glibc 2.41+r2+g0a7c7a3e283a-1. The issue could no longer be produced with seccomp disabled. @maravtdm does # strace -f dhcpcd -d -t 15 -L wlan0 reveal what system call is triggering seccomp?

@loqs
Copy link

loqs commented Feb 1, 2025

Backtrace of the issue

(gdb) thread apply all backtrace full

Thread 1 (Thread 0x7cd605559740 (LWP 1347)):
#0  vgetrandom_get_state () at ../sysdeps/unix/sysv/linux/getrandom.c:166
        __futex = 0x7cd604ff8480 <grnd_alloc>
        state = 0x0
        set = {__val = {140725753146060}}
        state = <optimized out>
        set = <optimized out>
        __futex = <optimized out>
        __futex = <optimized out>
        __private = <optimized out>
        __oldval = <optimized out>
#1  getrandom_vdso (buffer=buffer@entry=0x7ffd4486eaa4, length=length@entry=4, flags=flags@entry=0, cancel=cancel@entry=false) at ../sysdeps/unix/sysv/linux/getrandom.c:202
        self = 0x7cd605559740
        state = 0x0
        r = false
        out = <optimized out>
        ret = <optimized out>
#2  0x00007cd604e4f9fb in __getrandom_nocancel (buffer=buffer@entry=0x7ffd4486eaa4, length=length@entry=4, flags=flags@entry=0) at ../sysdeps/unix/sysv/linux/getrandom.c:341
No locals.
#3  0x00007cd604e4cde1 in __GI___arc4random_buf (p=p@entry=0x7ffd4486eaa4, n=n@entry=4) at arc4random.c:45
        __result = <optimized out>
        l = <optimized out>
        fd = <optimized out>
        seen_initialized = 0
#4  0x00007cd604e4cff7 in __GI___arc4random_buf (p=<optimized out>, n=<optimized out>) at arc4random.c:96
        l = <optimized out>
        fd = <optimized out>
        seen_initialized = 0
        l = <optimized out>
        fd = <optimized out>
        __result = <optimized out>
        pfd = <optimized out>
        __result = <optimized out>
        __result = <optimized out>
        __result = <optimized out>
        __result = <optimized out>
#5  __GI___arc4random () at arc4random.c:98
        r = 32765
#6  0x00007cd604e4d064 in __GI___arc4random_uniform (n=2000) at arc4random_uniform.c:52
        value = <optimized out>
        r = <optimized out>
        z = 21
        mask = 2047
        bits = 11
#7  __GI___arc4random_uniform (n=2000) at arc4random_uniform.c:34
        z = <optimized out>
        mask = <optimized out>
        bits = <optimized out>
        value = <optimized out>
        r = <optimized out>
--Type <RET> for more, q to quit, c to continue without paging--
        bits_left = <optimized out>
#8  0x00005d590fe709b5 in dhcp_start ()
No symbol table info available.
#9  0x00005d590fe49a1a in eloop_start ()
No symbol table info available.
#10 0x00005d590fe46c03 in main ()
No symbol table info available.

Possibly related to linux: Add support for getrandom vDSO as I could not reproduce in linux 6.6.74?

@loqs
Copy link

loqs commented Feb 1, 2025

In vgetrandom_get_state internal_signal_block_all calls internal_signal_block_all which calls rt_sigprocmask which is blocked by seccomp producing (on a build with ' SECCOMP_FILTER_DEBUG' defined):

dhcpcd[1906]: ps_seccomp_violation: unexpected syscall 14 (arch=0xc000003e)

Where syscall 14 on x86_64 is rt_sigprocmask

Edit:

Fixed in e9e4040 which is not yet part of any release.

@perkelix
Copy link
Contributor

perkelix commented Feb 1, 2025

@rsmarples yet another reason to wrap things up and produce a release ASAP. The fix for this bug has been sitting in Git for a long time. Hopefully, you have received your new network card and will soon be ready to roll. :)

@rsmarples
Copy link
Member

@rsmarples yet another reason to wrap things up and produce a release ASAP. The fix for this bug has been sitting in Git for a long time. Hopefully, you have received your new network card and will soon be ready to roll. :)

Yes, I have a new wireless card in my dev box now and finally have reliable speeds > 1Mbps

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

No branches or pull requests

4 participants