From: Pengpeng Hou <pengpeng@iscas.ac.cn>
To: David Howells <dhowells@redhat.com>
Cc: linux-afs@lists.infradead.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, Pengpeng Hou <pengpeng@iscas.ac.cn>
Subject: Re: [PATCH v2] rxrpc/proc: size address buffers for %pISpc output
Date: Wed, 08 Apr 2026 16:21:56 +0800 [thread overview]
Message-ID: <20260408171000.1-rxrpc-padding-reply-pengpeng@iscas.ac.cn> (raw)
In-Reply-To: <20260406170001.2-rxrpc-proc-v2-pengpeng@iscas.ac.cn>
Hi David,
That's possible for some builds, yes.
My concern here is a bit narrower: with the current %pISpc formatter, the
ISATAP case can produce 50 visible characters, i.e. 51 bytes including
the trailing NUL, while these helpers pass a declared char[50] object to
sprintf().
So even if a particular compiler/ABI happens to pad the stack slot out to
sizeof(long) or more, that would only be incidental code generation slack.
It still writes one byte past the end of the declared object, and whether
that lands in padding or in another live stack slot depends on the build
and the specific function layout.
In particular, rxrpc_local_seq_show() has only a single local char[50]
buffer, so there is no source-level guarantee of spare space there either.
The patch is really just making the object size match the formatter's
actual maximum output, so we don't depend on incidental stack padding.
Thanks,
Pengpeng
next prev parent reply other threads:[~2026-04-08 8:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-04 9:32 [PATCH] rxrpc/proc: size address buffers for %pISpc output Pengpeng Hou
2026-04-05 17:40 ` Anderson Nascimento
2026-04-06 6:10 ` Pengpeng Hou
2026-04-06 4:12 ` Anderson Nascimento
2026-04-06 8:40 ` [PATCH v2] " Pengpeng Hou
2026-04-08 8:08 ` David Howells
2026-04-08 8:21 ` Pengpeng Hou [this message]
2026-04-08 11:40 ` David Howells
2026-04-06 9:00 ` [PATCH] " Pengpeng Hou
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=20260408171000.1-rxrpc-padding-reply-pengpeng@iscas.ac.cn \
--to=pengpeng@iscas.ac.cn \
--cc=dhowells@redhat.com \
--cc=linux-afs@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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