Public bug reported:

The systemd-networkd crashes when we do tc operation on ubuntu 24.04 system 
(systemd=255.4-1ubuntu8.12).
In the following scenario, this is a 100% reproducible bug.
We also found the same issue 
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/2067924 in launchpad.

Environment:
os:ubuntu 24.04
nic:multiple hardware queues (>1)
systemd:255.4-1ubuntu8.12 (255.4-1ubuntu8.17 also has the same issue)

Script:
#!/bin/bash
count=0
loop=10
for ii in $(seq 1 "$loop"); do
    # init systemd-networkd status
    systemctl restart systemd-networkd 
    sleep 5
    pre_pid=$(pidof systemd-networkd)
    # do tc operation; this operation will cause the crash
    tc qdisc replace dev eth0 root handle 1: mq
    # undo tc operation
    tc qdisc delete dev eth0 root
    sleep 5
    now_pid=$(pidof systemd-networkd)
    if [[ $pre_pid != $now_pid ]]; then
        echo loopping $ii crash
        count=$((count+1))
    fi
done
echo $count/$loop

Result:
systemd-networkd should run normally,but it crashed with the stack overflow.
#0  0x000076c6493c4d0a in _hashmap_iterate (h=0x635ddd0ef398, 
i=i@entry=0x7ffd04ca7040, value=value@entry=0x7ffd04ca7038, key=key@entry=0x0) 
at ../src/basic/hashmap.c:722
#1  0x0000635dd0858af5 in set_iterate (value=0x7ffd04ca7038, i=0x7ffd04ca7040, 
s=<optimized out>) at ../src/basic/set.h:76
#2  tclass_drop.isra.0 (tclass=0x635ddd10abc0) at ../src/network/tc/tclass.c:264
#3  0x0000635dd08589cd in qdisc_drop.isra.0 (qdisc=0x635ddd10c200) at 
../src/network/tc/qdisc.c:301
#4  0x0000635dd0858b0a in tclass_drop.isra.0 (tclass=0x635ddd10abc0) at 
../src/network/tc/tclass.c:268
#5  0x0000635dd08589cd in qdisc_drop.isra.0 (qdisc=0x635ddd10c200) at 
../src/network/tc/qdisc.c:301
#6  0x0000635dd0858b0a in tclass_drop.isra.0 (tclass=0x635ddd10abc0) at 
../src/network/tc/tclass.c:268
#7  0x0000635dd08589cd in qdisc_drop.isra.0 (qdisc=0x635ddd10c200) at 
../src/network/tc/qdisc.c:301
#8  0x0000635dd0858b0a in tclass_drop.isra.0 (tclass=0x635ddd10abc0) at 
../src/network/tc/tclass.c:268
.....
#87348 0x0000635dd0858b0a in tclass_drop.isra.0 (tclass=0x635ddd10abc0) at 
../src/network/tc/tclass.c:268
#87349 0x0000635dd08589cd in qdisc_drop.isra.0 (qdisc=0x635ddd101d20) at 
../src/network/tc/qdisc.c:301
#87350 0x0000635dd07c545e in manager_rtnl_process_qdisc (rtnl=<optimized out>, 
message=0x635ddd0f3110, m=0x635ddd0ee0d0) at ../src/network/tc/qdisc.c:549
#87351 0x000076c649464f1e in process_match (m=0x635ddd0f3110, 
nl=0x635ddd0effa0) at ../src/libsystemd/sd-netlink/sd-netlink.c:314
#87352 process_running (ret=0x0, nl=0x635ddd0effa0) at 
../src/libsystemd/sd-netlink/sd-netlink.c:344
#87353 sd_netlink_process (nl=0x635ddd0effa0, ret=ret@entry=0x0) at 
../src/libsystemd/sd-netlink/sd-netlink.c:374
#87354 0x000076c6494653f7 in io_callback (s=<optimized out>, fd=<optimized 
out>, revents=<optimized out>, userdata=<optimized out>) at 
../src/libsystemd/sd-netlink/sd-netlink.c:655
#87355 0x000076c64949d424 in source_dispatch (s=s@entry=0x635ddd0f0120) at 
../src/libsystemd/sd-event/sd-event.c:4187
#87356 0x000076c64949d76d in sd_event_dispatch (e=<optimized out>, 
e@entry=0x635ddd0ee410) at ../src/libsystemd/sd-event/sd-event.c:4808
#87357 0x000076c64949f0d8 in sd_event_run (e=<optimized out>, 
e@entry=0x635ddd0ee410, timeout=timeout@entry=18446744073709551615) at 
../src/libsystemd/sd-event/sd-event.c:4869
#87358 0x000076c64949f2ff in sd_event_loop (e=<optimized out>) at 
../src/libsystemd/sd-event/sd-event.c:4891
#87359 0x0000635dd079727b in run (argc=<optimized out>, argv=<optimized out>) 
at ../src/network/networkd.c:117
#87360 0x0000635dd0790cd9 in main (argc=<optimized out>, argv=<optimized out>) 
at ../src/network/networkd.c:124

Upstream status:
This issue was introduced in upstream version v255 and has been fixed in 
upstream version v256.
bug: https://github.com/systemd/systemd/issues/32247
fix patch 1: 
https://github.com/systemd/systemd/commit/632d321050f58fe1b5bed7cfe769d212377c0301
fix patch 2: 
https://github.com/systemd/systemd/commit/ee8f605ded4fea6b93aae018415efae877c26ed2

Does Ubuntu 24.04 have any plans to fix this issue?

** Affects: systemd (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2164889

Title:
  systemd-networkd crashes on ubuntu 24.04 systems with tc operation

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/2164889/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to