mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Harshal Gohel <hg@simonwunderlich.de>
To: netdev@vger.kernel.org, Jiri Pirko <jiri@resnulli.us>,
	Jamal Hadi Salim <jhs@mojatatu.com>
Cc: Simon Wunderlich <sw@simonwunderlich.de>,
	Sven Eckelmann <se@simonwunderlich.de>,
	linux-kernel@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: [net] Unexpected -EMSGSIZE returned by tcf_fill_node
Date: Thu, 12 Mar 2026 15:01:31 +0100	[thread overview]
Message-ID: <73887540-2fa8-41f4-9644-640d00cbcc3f@simonwunderlich.de> (raw)

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


                 reply	other threads:[~2026-03-12 14:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=73887540-2fa8-41f4-9644-640d00cbcc3f@simonwunderlich.de \
    --to=hg@simonwunderlich.de \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=se@simonwunderlich.de \
    --cc=sw@simonwunderlich.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®