[net] Unexpected -EMSGSIZE returned by tcf_fill_node
From: Harshal Gohel
Date: Thu Mar 12 2026 - 10:07:40 EST
Dear Kernel developers and maintainers,
While playing around with tc and iproute2 we discovered that dumping filters with tc filter show dev eth0 fails because kernel returns -EMSGSIZE (-90). We were able to reproduce this on an amd64 machine running debian:trixie, debian:buster and nixos:stable, kernel 6.18, 6.12 and 6.1 and on rpi4b running RaspberryPi OS 64 bit.
To reproduce add dummy interface, add htb qdisc and add tc filter for all protocols with firewall mark.
```
sudo ip link add type dummy
sudo tc qdisc add dev dummy0 root handle ffe: htb default 0x0000 r2q 1
sudo tc filter add dev dummy0 parent ffe: protocol all fw
```
then try to dump filters for dummy0 device with
`sudo tc filter show dev dummy0`
This results in
```
filter parent ffe: protocol all pref 49152 fw chain 0
Error: Buffer too small for object.
Dump terminated
```
strace also reveals the return code (-EMSGSIZE)
```
...
recvmsg(3, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base=[{nlmsg_len=20, nlmsg_type=NLMSG_DONE, nlmsg_flags=NLM_F_MULTI, nlmsg_seq=1773323104, nlmsg_pid=50516}, -90], iov_len=32768}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 20
```
I am not sure if this should be handled by iproute2/libmnl or in kernel.
This error is only visible after this commit in iproute2: https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=05a14fc1218885ba6236b409fbf6b89976b8636e
--
Regards,
Harshal