From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD2F8C43334 for ; Sun, 10 Jul 2022 10:43:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229570AbiGJKny (ORCPT ); Sun, 10 Jul 2022 06:43:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229491AbiGJKnx (ORCPT ); Sun, 10 Jul 2022 06:43:53 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C588C1033 for ; Sun, 10 Jul 2022 03:43:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657449830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sE852ravTvVsPO18Sdl2baOG3S42zcZNkqm0cGHZglM=; b=HbNfgrKtjFGEswdcw55yj0KNK2qvUesoMr45HZy10B91VcPlUIo0EIvDQpF+DBe9J1cHhU 2zLqNH0x+6kxCa/kKOYwV0Wy5Ks4U1P+BfhtVhIRhyt9eEaEXk0faDcZ4ZLUKVhp4GQMpB AvGuxcZwjjy/X2ZbLJQ57eRUzf63QvU= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-530-HkjtQ0zcPx69sVE7rPWjLA-1; Sun, 10 Jul 2022 06:43:49 -0400 X-MC-Unique: HkjtQ0zcPx69sVE7rPWjLA-1 Received: by mail-ed1-f71.google.com with SMTP id h17-20020a056402281100b0043aa5c0493dso2433576ede.16 for ; Sun, 10 Jul 2022 03:43:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sE852ravTvVsPO18Sdl2baOG3S42zcZNkqm0cGHZglM=; b=yoFOOQXBI9+fOIcSu2gp4EX8ej/H81oCLAEiTFa0U/+1Oq2f6YyHSWEmggZQt+oDxS ff4ni7g+kAU2R29VtKCNVv8hEsxSPjdfatw9RDeBkv/P5UyGt41G/JHFPSRgwgrTgoMg 7O1MGNE6Dw6SbbNMjN6E3LMksqd+jO6A3YLTctpcGD/YL42yDvHIxVCVUSe2dUSsaEP3 FPQ43x4ylf0NcOgKj1Tl8ZR2RBrbkXn9OOHPUUFPBdoeBXN1WvPXKAdyKMyXquvZS5mZ Zcz5jBfKWRFlPmcaNs5hvdfv7iolTbiE2fempdrb9LLr0dmkmPYEZWLyprCAlGJyv0eD uALg== X-Gm-Message-State: AJIora8a7n6/o6IA8ypRve2UIJdW9rLCIsI8fzVZcLK7ycEYjxa4mQ7h L8ck2VZ5iUjjgVP3iiYTpFGfPWN1ScCi8QrKol/cwHIXGuy7yj4JuUAITFBQj5r09cqHNp54Yeg jitMEB6AWB5LlZ1S+eR7ZFghB X-Received: by 2002:a17:906:106:b0:715:7cdf:400f with SMTP id 6-20020a170906010600b007157cdf400fmr13258587eje.1.1657449827530; Sun, 10 Jul 2022 03:43:47 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tOUSITMELdjSeJP9iBLs0F347SSLFLqXqHZEGAsoNzaXrTDc+RCSt9SVkaJYi8qOot4OaaYQ== X-Received: by 2002:a17:906:106:b0:715:7cdf:400f with SMTP id 6-20020a170906010600b007157cdf400fmr13258569eje.1.1657449827331; Sun, 10 Jul 2022 03:43:47 -0700 (PDT) Received: from localhost ([185.140.112.229]) by smtp.gmail.com with ESMTPSA id q16-20020a50aa90000000b0043aba618bf6sm2525690edc.80.2022.07.10.03.43.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Jul 2022 03:43:46 -0700 (PDT) Date: Sun, 10 Jul 2022 12:43:44 +0200 From: Igor Mammedov To: Chuck Lever III Cc: ondrej.valousek.xm@renesas.com, Linux NFS Mailing List , Linux Kernel Mailing List , bfields@fieldses.org, Linus Torvalds Subject: Re: [GIT PULL] nfsd changes for 5.18 Message-ID: <20220710124344.36dfd857@redhat.com> In-Reply-To: References: X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 21 Mar 2022 14:12:31 +0000 Chuck Lever III wrote: couldn't find offender patch on ML so replying here > Hi Linus- > > The following changes since commit 7e57714cd0ad2d5bb90e50b5096a0e671dec1ef3: > > Linux 5.17-rc6 (2022-02-27 14:36:33 -0800) > > are available in the Git repository at: > > git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux.git tags/nfsd-5.18 > > for you to fetch changes up to 4fc5f5346592cdc91689455d83885b0af65d71b8: > > nfsd: fix using the correct variable for sizeof() (2022-03-20 12:49:38 -0400) > > ---------------------------------------------------------------- > New features: > - NFSv3 support in NFSD is now always built > - Added NFSD support for the NFSv4 birth-time file attribute [...] > Ondrej Valousek (1): > nfsd: Add support for the birth time attribute This patch regressed clients that support TIME_CREATE attribute. Starting with this patch client might think that server supports TIME_CREATE and start sending this attribute in its requests. However kernel on server side (since this patch and to current master) upon getting such request will return EINVAL. (my guess is that TIME_CREATE not being decoded properly and that messes up request parsing). End result is unusable mount (unless it's treated as readonly). Reproduces with current master (HEAD at e5524c2a1fc40) and MacOS client (Big Sur or newest Monterey). server is typical setup exporting files from XFS (Fedora36) # rpcdebug -m nfsd -s all on client: % mount -t nfs -o vers=4,rw,nfc,sec=sys testnas:/mnt ~/test % touch ~/test/fff touch: test/fff: Invalid argument server logs: nfsd: fh_compose(exp fd:00/128 fff, ino=0) NFSD: nfsd4_open filename op_openowner 0000000000000000 Here is a request the touch generates: Network File System, Ops(6): PUTFH, SAVEFH, OPEN, GETATTR, RESTOREFH, GETATTR [Program Version: 4] [V4 Procedure: COMPOUND (1)] Tag: create minorversion: 0 Operations (count: 6): PUTFH, SAVEFH, OPEN, GETATTR, RESTOREFH, GETATTR Opcode: PUTFH (22) Opcode: SAVEFH (32) Opcode: OPEN (18) seqid: 0x00000004 share_access: OPEN4_SHARE_ACCESS_BOTH (3) share_deny: OPEN4_SHARE_DENY_NONE (0) clientid: 0xba93c9620aec46ea owner: Open Type: OPEN4_CREATE (1) Create Mode: UNCHECKED4 (0) Attr mask: 0x00040002 (Mode, Time_Create) reco_attr: Mode (33) reco_attr: Time_Create (50) Claim Type: CLAIM_NULL (0) Name: fff [...] when trying to copy file via GUI (Finder) it goes a different route but ends up with error anyway and with leftover 0-length file on server with messed up permissions, i.e. open/create without Time_Create succeeds but followup setattr with Time_Create fails EINVAL. Network File System, Ops(3): PUTFH, SETATTR, GETATTR [Program Version: 4] [V4 Procedure: COMPOUND (1)] Tag: setattr minorversion: 0 Operations (count: 3): PUTFH, SETATTR, GETATTR Opcode: PUTFH (22) Opcode: SETATTR (34) StateID Attr mask: 0x00450002 (Mode, Time_Access_Set, Time_Create, Time_Modify_Set) reco_attr: Mode (33) reco_attr: Time_Access_Set (48) reco_attr: Time_Create (50) reco_attr: Time_Modify_Set (54) Opcode: GETATTR (9) [Main Opcode: SETATTR (34)] [...] > -- > Chuck Lever > > >