Linux NFS development
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: Chuck Lever <chuck.lever@oracle.com>, rtm@csail.mit.edu
Cc: 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
Subject: Re: client can crash nfsd4_encode_fattr4() by setting bit 84
Date: Wed, 10 Sep 2025 11:08:00 -0400	[thread overview]
Message-ID: <7dcc3c5228fd4fbe7f9d7746d2fd0f99c6dc3a99.camel@kernel.org> (raw)
In-Reply-To: <0f0c9878-b45f-49c1-b9e8-9ee4b830d51e@oracle.com>

On Wed, 2025-09-10 at 10:53 -0400, Chuck Lever wrote:
> On 9/10/25 10:49 AM, Jeff Layton wrote:
> > On Wed, 2025-09-10 at 09:55 -0400, rtm@csail.mit.edu wrote:
> > > Entry 84 (and a few neighbors) in nfsd4_enc_fattr4_encode_ops[] is
> > > NULL, so if a client sets that bit in an OP_VERIFY bitmask, the server
> > > will crash here in nfsd_encode_fattr4():
> > > 
> > >         for_each_set_bit(bit, attr_bitmap,
> > >                          ARRAY_SIZE(nfsd4_enc_fattr4_encode_ops)) {
> > >                 status = nfsd4_enc_fattr4_encode_ops[bit](xdr, &args);
> > 
> > Thanks. That looks like a real bug, alright. I think we just need to
> > check that nfsd4_enc_fattr4_encode_ops[bit] is non-NULL before calling
> > its handler.
> > 
> > Care to propose a patch?
> 
> 597 #define FATTR4_WORD2_XATTR_SUPPORT      BIT(FATTR4_XATTR_SUPPORT -
> 64)
> 598 #define FATTR4_WORD2_TIME_DELEG_ACCESS  BIT(FATTR4_TIME_DELEG_ACCESS
> - 64)
> 599 #define FATTR4_WORD2_TIME_DELEG_MODIFY  BIT(FATTR4_TIME_DELEG_MODIFY
> - 64)
> 600 #define FATTR4_WORD2_OPEN_ARGUMENTS     BIT(FATTR4_OPEN_ARGUMENTS -
> 64)
> 
> I think entries for time_deleg_access and time_deleg_modify are missing
> in nfsd4_enc_fattr4_encode_ops...
>

Those are typically requested in CB_GETATTR calls. I'm not sure those
are legit to request in a GETATTR. Are they?

-- 
Jeff Layton <jlayton@kernel.org>

  reply	other threads:[~2025-09-10 15:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-10 13:55 client can crash nfsd4_encode_fattr4() by setting bit 84 rtm
2025-09-10 14:49 ` Jeff Layton
2025-09-10 14:53   ` Chuck Lever
2025-09-10 15:08     ` Jeff Layton [this message]
2025-09-10 15:10       ` Chuck Lever
2025-09-10 15:21         ` Jeff Layton

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=7dcc3c5228fd4fbe7f9d7746d2fd0f99c6dc3a99.camel@kernel.org \
    --to=jlayton@kernel.org \
    --cc=Dai.Ngo@oracle.com \
    --cc=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neil@brown.name \
    --cc=okorniev@redhat.com \
    --cc=rtm@csail.mit.edu \
    --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