From: Chuck Lever <chuck.lever@oracle.com>
To: Rick Macklem <rick.macklem@gmail.com>,
Linux NFS Mailing List <linux-nfs@vger.kernel.org>,
J David <j.david.lists@gmail.com>
Subject: Re: knfsd server bug when GETATTR follows READDIR
Date: Tue, 17 Dec 2024 20:51:09 -0500 [thread overview]
Message-ID: <4804ce6a-fa67-4b50-bc31-715689d3c766@oracle.com> (raw)
In-Reply-To: <CAM5tNy4-SNVD+zqgaJTmLtAQ+kKV_Ce4tRr2zqgjTq1KPM-rfQ@mail.gmail.com>
On 12/17/24 5:10 PM, Rick Macklem wrote:
> Hi,
>
> The attached pcap file shows that the knfsd server generates
> bogus XDR for the reply to a GETATTR that follows a READDIR
> operation.
>
> More specifically, if you look at the pcap file in wireshark
> and go to packet#22 and then click on the operations and
> then "Opcode: GETATTR (9)", the start of
> the XDR for the GETATTR will be highlighted in the hexadecimal
> window.
> Now, if you look at what follows (in the hexadeciaml window),
> you'll see that the GETATTR reply looks like:
> - GETATTR (9)
> - NFS4_OK (0)
> - Length of bitmap (0) <-- Not (2)
> - 2 words of attribute bitmap
> - 98 (length of attributes in hex)
> - attribute values
>
> Everything looks ok, except the number of bitmap words is
> 0 and not 2.
>
> Since the knfsd does not do this normally, I'd guess it is
> some sort of runaway pointer or use after free type bug that
> causes this, maybe?
>
> Sofar, it only appears to happen when the GETATTR follows a
> READDIR operation.
>
> This was reported to me for a FreeBSD client mounting the following:
> Debian 12 w/kernel:
> $ uname -r
> 6.1.0-25-amd64
>
>> - what type of file system it exports
>
> ZFS:
>
> $ dpkg -l | fgrep libzfs4linux
> ii libzfs4linux 2.1.11-1
> amd64
> I suspect that ZFS exports are not common for the Linux knfsd?
>
> Anyhow, I am not sure if you have seen such a problem before,
> but I thought I would at least report it.
> (I have cc'd the reporter, in case you have questions for him.)
>
> rick
> ps: If the pcap file does not make it through the mailing list,
> email me and I'll send you a copy.
Hi Rick,
ZFS is an "out of tree" filesystem, so the upstream Linux community does
not support it. I'm guessing libzfs4linux has its own upstream
community. Even so, it is a not unpopular choice among Linux NAS
enthusiasts.
Also, 6.1.0-25-amd64 is a Debian-built kernel, not sure how it relates
to the upstream kernel (distros add their own special sauce, and this
code base looks a couple of years old to begin with).
It might seem unfriendly, but we usually ask, in such cases, for the
reporter to work with the Linux distributor first. If they can reproduce
this issue with an "in tree" file system contained in a recent upstream
Linux kernel, then we can take a look. (Or you and J. David can give it
a try).
If it can be reproduced, we have to fix the tip of the upstream branch
first, and then take that patch, as cleanly as possible, back to the LTS
6.1 kernel code base that 6.1.0-25-amd64 is based on. Debian would then
be responsible for taking the LTS fix into their kernel.
If it cannot be reproduced, then it's likely there is already a fix
somewhere between 6.1 and the tip of upstream. Generally a "git bisect"
can identify the commit, and it can then be backported as described
above.
HTH
--
Chuck Lever
next prev parent reply other threads:[~2024-12-18 1:51 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-17 22:10 knfsd server bug when GETATTR follows READDIR Rick Macklem
2024-12-18 1:51 ` Chuck Lever [this message]
2024-12-21 2:16 ` J David
2024-12-21 17:34 ` Chuck Lever
2024-12-21 20:52 ` J David
2024-12-21 23:27 ` Rick Macklem
2024-12-21 23:53 ` Rick Macklem
2024-12-22 0:29 ` Rick Macklem
2024-12-22 1:02 ` J David
2024-12-22 20:17 ` Chuck Lever
2024-12-24 6:51 ` Cedric Blancher
2024-12-24 13:45 ` Chuck Lever
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=4804ce6a-fa67-4b50-bc31-715689d3c766@oracle.com \
--to=chuck.lever@oracle.com \
--cc=j.david.lists@gmail.com \
--cc=linux-nfs@vger.kernel.org \
--cc=rick.macklem@gmail.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