FS#74826 - [dhcpcd] dhcpcd -U crashed with SIGSYS

Attached to Project: Arch Linux
Opened by Haruue Icymoon (haruue) - Sunday, 22 May 2022, 18:25 GMT
Last edited by Toolybird (Toolybird) - Tuesday, 27 June 2023, 22:40 GMT
Task Type Bug Report
Category Upstream Bugs
Status Closed
Assigned To Giancarlo Razzolini (grazzolini)
Architecture x86_64
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:

dhcpcd -U [interface] or dhcpcd --dumplease [interface] is useful to dump the current lease information.
I use this command to dump some information like dhcp6_pd_prefix for other network configure scripts.

However, this command crashes with SIGSYS on the Arch Linux. This made this command entirely not operational.

After recompiling the dhcpcd 9.4.1-1 with options=('!strip'), I got the stack trace[1] and found out the reason is the lack of newfstatat(2) in its seccomp rule.
And it seems like upstream has made a patch[2] that fixes this issue, but the patch has not been merged.

[1] Attached file dhcpcd-U-stacktrace.txt. Note the si_signo=31 and _syscall=262 in the $_siginfo.
[2] https://github.com/NetworkConfiguration/dhcpcd/commit/b4d8a349e55d269866bc6ee6e3bb3b03ef293eda

It seems like this problem only occurs with the recent version of glibc, so this issue doesn't appear on other distros such as Ubuntu.
So maybe we can apply this patch in the downstream package now, before the upstream finally got this patch merged and release a new version of dhcpcd.

Additional info:
* package version(s): dhcpcd 9.4.1-1
* config and/or log files etc: see links above.
* link to upstream bug report: nope, the upstream fixed this issue by chance when they tried to fix another issue[3].

[3] https://github.com/NetworkConfiguration/dhcpcd/issues/99#issuecomment-1126793972

Steps to reproduce:
1. Obtain a lease with dhcpcd: dhcpcd -w eth0
2. Dump lease information: dhcpcd -U eth0
And then you will see
root@archlinux:~ # dhcpcd -U ppp0
Bad system call (core dumped)
This task depends upon

Closed by  Toolybird (Toolybird)
Tuesday, 27 June 2023, 22:40 GMT
Reason for closing:  Fixed
Additional comments about closing:  dhcpcd 10.0.1-1
Comment by Philipp B. (phibre) - Monday, 26 September 2022, 14:25 GMT
There are several commits upstream which fix seccomp syscall filter issues due to newer glibc versions.
In my case I noticed dhcpcd 9.4.1-1 crashing on exit (fixed upstream [0]).

I opened an issue upstream [1] to request a new release tag to get all these seccomp patches downstream, not only for Arch Linux.


[0] https://github.com/NetworkConfiguration/dhcpcd/issues/128
[1] https://github.com/NetworkConfiguration/dhcpcd/issues/135
Comment by Roy Marples (rsmarples) - Monday, 24 April 2023, 00:25 GMT
This is fixed in dhcpcd-10.0.1

Loading...