From: Phil Sutter <phil@nwl.cc>
To: YuPeng <yupeng@kylinos.cn>
Cc: netfilter-devel@vger.kernel.org, fw@strlen.de, debianyu@163.com
Subject: Re: [PATCH] ebtablesd: Fix missing arguments for %s in error messages
Date: Wed, 25 Nov 2026 12:00:31 +0100 [thread overview]
Message-ID: <awa_z-IRhiv2BS5P@orbyte.nwl.cc> (raw)
In-Reply-To: <1795597475442100152.16763@kylinos.cn>
On Wed, Nov 25, 2026 at 05:04:35PM +0800, YuPeng wrote:
> Five ebt_print_error() calls in ebtablesd.c use a "%s" format
> specifier without passing the corresponding argument. As
> __ebt_print_error() is variadic, this is undefined behaviour and what
> gets printed depends on leftover register contents. With current gcc
> output on x86-64 the preceding strcmp() happens to leave argv[2] in
> the variadic argument register, so the message usually still names the
> table; different code generation or a different call site can print
> garbage, print "(null)", or crash instead of reporting the error.
>
> Pass argv[2], which holds the table name for the free, open, fopen,
> commit and fcommit commands, as the calls just around these already do.
Correct, in other spots argv[2] is passed for that matter as well.
> This fix was originally carried in the Kylin Linux SRPM since 2022;
> the commit message has been rewritten to describe the behaviour
> observed on current master.
>
> Signed-off-by: YuPeng <yupeng@kylinos.cn>
One could also fix the inconsistency wrt. ticks around table name or not
and also join the format strings broken into pieces. OTOH ebtablesd is
so dead, we may risk reincarnating it by accident. So I applied this
patch as-is (aside from adding a Fixes: tag).
Thanks, Phil
prev parent reply other threads:[~2026-11-25 11:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 9:04 [PATCH] ebtablesd: Fix missing arguments for %s in error messages YuPeng
2026-11-25 11:00 ` Phil Sutter [this message]
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=awa_z-IRhiv2BS5P@orbyte.nwl.cc \
--to=phil@nwl.cc \
--cc=debianyu@163.com \
--cc=fw@strlen.de \
--cc=netfilter-devel@vger.kernel.org \
--cc=yupeng@kylinos.cn \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.