From: Chuck Lever <chuck.lever@oracle.com>
To: Christoph Hellwig <hch@infradead.org>,
Sergey Bashirov <sergeybashirov@gmail.com>
Cc: Jeff Layton <jlayton@kernel.org>, NeilBrown <neil@brown.name>,
Olga Kornievskaia <okorniev@redhat.com>,
Dai Ngo <Dai.Ngo@oracle.com>, Tom Talpey <tom@talpey.com>,
linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] NFSD: Rework encoding and decoding of nfsd4_deviceid
Date: Tue, 22 Jul 2025 10:07:06 -0400 [thread overview]
Message-ID: <05e851b2-a569-4311-b95b-e1ac94d4db5c@oracle.com> (raw)
In-Reply-To: <aH8jeNFJFuxCugKZ@infradead.org>
On 7/22/25 1:36 AM, Christoph Hellwig wrote:
> On Mon, Jul 21, 2025 at 05:48:55PM +0300, Sergey Bashirov wrote:
>> Compilers may optimize the layout of C structures,
>
> By interpreting the standard in the most hostile way: yes.
> In practice: no.
Earnest question: Is NFSD/XDR properly insulated against the "randomize
structure layout" option?
> Just about every file system on-disk format and every network wire
> protocol depends on the compiler not "optimizing" properly padded
> C structures.
It's an intrinsic assumption that is not documented in the code or
anywhere else. IMO that is a latent banana peel.
While not urgent, this is a defensive change and it improves code
portability amongst compilers and languages (eg, Rust).
--
Chuck Lever
next prev parent reply other threads:[~2025-07-22 14:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-21 14:48 Sergey Bashirov
2025-07-21 15:02 ` Chuck Lever
2025-07-22 5:36 ` Christoph Hellwig
2025-07-22 14:07 ` Chuck Lever [this message]
2025-07-23 1:28 ` NeilBrown
2025-07-23 14:35 ` Chuck Lever
2025-07-29 7:48 ` Christoph Hellwig
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=05e851b2-a569-4311-b95b-e1ac94d4db5c@oracle.com \
--to=chuck.lever@oracle.com \
--cc=Dai.Ngo@oracle.com \
--cc=hch@infradead.org \
--cc=jlayton@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=neil@brown.name \
--cc=okorniev@redhat.com \
--cc=sergeybashirov@gmail.com \
--cc=tom@talpey.com \
/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®