[nfsv4] Re: knfsd related bug reported to FreeBSD
Rick Macklem <rick.macklem@gmail.com> Sat, 14 December 2024 01:02 UTC
Return-Path: <rick.macklem@gmail.com>
X-Original-To: nfsv4@ietfa.amsl.com
Delivered-To: nfsv4@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 4A73AC151084 for <nfsv4@ietfa.amsl.com>; Fri, 13 Dec 2024 17:02:29 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.107
X-Spam-Level:
X-Spam-Status: No, score=-2.107 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EWfDNAJxYwxw for <nfsv4@ietfa.amsl.com>; Fri, 13 Dec 2024 17:02:28 -0800 (PST)
Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D681EC151073 for <nfsv4@ietf.org>; Fri, 13 Dec 2024 17:02:28 -0800 (PST)
Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-5d3bdccba49so4100648a12.1 for <nfsv4@ietf.org>; Fri, 13 Dec 2024 17:02:28 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734138147; x=1734742947; darn=ietf.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=UTdPTlez/SApZ/nJ12qEq9yYOhSpfUggOq0vXmiFtfY=; b=WE4XlQ+9n4xKv3WpGzmsM2aHOLZ+DfXHOANCsQazFlyAzmsHfMZRpwj463Li1mHXHW thtGaIlzUFz1Ttk6pEjrMsS32cV6DiRMCmuHRMNMZfpwwaxKebNcQmFVKDt1N8pgWS/x vYBTkEFmYJAnL2rzGANewyUBMjs0yc6QMp0dBE4Ju4+lF2+UyXdmvHaCpn2F+sk9JUSq l4K/f9X2isBBvQgvnMZ/MG8zUjqz/XhkT5hN+hzCxUStvC9u+02txDIQZOBb7dL0r+HS S4olU6BwXqN2yTgBnqS8hwsFCK3X97NICUn0i1gZ2kXX4YYnBrTByAaQIUQIkF4n+gb8 yedg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734138147; x=1734742947; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UTdPTlez/SApZ/nJ12qEq9yYOhSpfUggOq0vXmiFtfY=; b=dpRjNRBJIYZrJCpwnYArNA9iayy297nCO028SFYonrlH9eoJbSJ0ZgWXSsQyhtsvsN +nQ75E3cgdG8nQhcsGlFBKLbHJ2xcto/uQzlbWJbBxQ/sv/zBIi4FxJiQDt8tkqayiKA jlttL5y+8cemoQTer9ag3xOs9aHk4rCdXB93XRX/gnBSqjs5w0LBYDHneREoebRz2kbU s4jEPM9XRv3Wm45nCCMxT7ugC1O8BigqFg+HQPrJ4caj44zfkzlrWG4Q78jtiAnx+fOg pcEQ317LkLtDIB2Sq6OiakodbAUu2WP5RKZrr/KmYLh8TkT/+kaIcSIHlNS7BTmbtHej IH2A==
X-Gm-Message-State: AOJu0Yzf3ySvm8bF52NZG8/StOLZOrcA83IA9991GorSFEVq77F0I3Ay 6yZ3dmR1JX9vsRxJlnTq7ZJOz9I7h545uVK0co75IXgVuBWhqxmOL//iuG1AZex0mVJ0Zq+RqLp qGdRt3/NTJsGzNPPLbkZ26XBDq2FJ
X-Gm-Gg: ASbGncuFvQFRsM7GmGOIQMLx75vm47YbYrbi7I5e34jyYIYQ6MOYL9ToyWZNE0oNsvy S4nnhOnyOB7vomnj31YYfhsL76qBRuxBvfbGg7q0JK0yuNSc9+o3YeDqTFnHK6UMJ4MQLnw==
X-Google-Smtp-Source: AGHT+IHSrhzee3IAiBSI/OCXQBOPNoOQhPXYJiQGPQfd3kDj4yIxiLo4DXB8HyEqIUjpEaahDPncxV1dYEAuipKgv0I=
X-Received: by 2002:a05:6402:11c6:b0:5d0:e2f0:d578 with SMTP id 4fb4d7f45d1cf-5d63c308fd9mr4264848a12.14.1734138147204; Fri, 13 Dec 2024 17:02:27 -0800 (PST)
MIME-Version: 1.0
References: <CAM5tNy4q61V=JNB569wuFPpLVgvYkPMX=ENhwTpWanZkRFydAQ@mail.gmail.com> <20241214005858.k2jisy46njaegxkg@pali>
In-Reply-To: <20241214005858.k2jisy46njaegxkg@pali>
From: Rick Macklem <rick.macklem@gmail.com>
Date: Fri, 13 Dec 2024 17:02:17 -0800
Message-ID: <CAM5tNy6C9FRJ+rHXHbq+Ap+5rtZWnd33GOmXxZfjR_1X1hr01w@mail.gmail.com>
To: Pali Rohár <pali-ietf-nfsv4@ietf.pali.im>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Message-ID-Hash: FEITV574M4X53H2TS556K5IZ63VAMAS7
X-Message-ID-Hash: FEITV574M4X53H2TS556K5IZ63VAMAS7
X-MailFrom: rick.macklem@gmail.com
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-nfsv4.ietf.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
CC: NFSv4 <nfsv4@ietf.org>
X-Mailman-Version: 3.3.9rc6
Precedence: list
Subject: [nfsv4] Re: knfsd related bug reported to FreeBSD
List-Id: NFSv4 Working Group <nfsv4.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/nfsv4/1FM7TWzmViSBtpNtf84zAt9UXAg>
List-Archive: <https://mailarchive.ietf.org/arch/browse/nfsv4>
List-Help: <mailto:nfsv4-request@ietf.org?subject=help>
List-Owner: <mailto:nfsv4-owner@ietf.org>
List-Post: <mailto:nfsv4@ietf.org>
List-Subscribe: <mailto:nfsv4-join@ietf.org>
List-Unsubscribe: <mailto:nfsv4-leave@ietf.org>
On Fri, Dec 13, 2024 at 4:59 PM Pali Rohár <pali-ietf-nfsv4@ietf.pali.im> wrote: > > Hello Rick, > > Just a quick reply. I have not looked at the pcap yet but I know that > wireshark incorrectly decodes some of NFS4 packets with GETATTR opcode. > I have my own modification of wireshark to fix this problem. > > So it could be possible that server is sending the correct reply and > just wireshark dissect it incorrect. > > I'm not saying that it is this case, just to be aware of it. In this case, I am looking at the hexadecimal for the on-the-wire packet and it does not look correct. Also, FreeBSD fails the reply as incorrect XDR. rick > > Pali > > On Friday 13 December 2024 16:47:45 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 and > > I can send you a copy.
- [nfsv4] knfsd related bug reported to FreeBSD Rick Macklem
- [nfsv4] Re: knfsd related bug reported to FreeBSD Pali Rohár
- [nfsv4] Re: knfsd related bug reported to FreeBSD Rick Macklem
- [nfsv4] Re: knfsd related bug reported to FreeBSD Pali Rohár