Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3159707pxk; Tue, 15 Sep 2020 11:34:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwuDthU4TDZnEyo6fKwxcD/qBVtTpHD62bRnQ0Vrk4fk4RfXE1QcrTmQoT/PY7ADhsE2Cqb X-Received: by 2002:a50:99d6:: with SMTP id n22mr24250540edb.265.1600194848175; Tue, 15 Sep 2020 11:34:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600194848; cv=none; d=google.com; s=arc-20160816; b=m97kaLWKysXXAkvrAHdrdm+1xSCMZ7ffWCF52rvOtQN7tx5o0I1ubG17ZYr0MqgnyG GJC/YrQKAF+BvuPbP2IlCN4N+uYoHbcaKrbRtgSQcIwLf//g+4FMYW1RtlRQwfv4S4cV TfRtVgclA+mhafPivgDPUM/PMZyBbAxYAngvskhqcLSaPui5Y6EXaQfZfsMHAkR51sjG XC9dyzaw4LWSnDzc3zA2VxPgMKwRnOKNjliC0WJtSyryO98Wu3wL+o2vzcqXZV74z6x7 mK93iC/RTba0TePA32fOw4N4krQSrWeFOf8UkNTNM+BIbL79bHdv2WVDkrfqowd9ZHgt KW8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:from:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:date:dkim-signature:dkim-filter; bh=Gzs0g7lW696ivl7ubWpdXh2/Wk4Ipx8dGRXKZd2l9RE=; b=Mcet8ORGbM1FIJo4v1yblCsESsunYMds/5wc3Za2SfGMsAviMSLkSL9lr1TQHdSSwW TO9mPdA84SQN7nIMo4LRHhhHohWNEcRU9NKL9sqSURlHbZXG7Mvs0itDioRALcqz41mB 7kwPrKcG1I2REa3BnMh8fsXMB+Mf8iCfIYZhfm3X9RYohlmYY0wjflaTpSstFRxVs0Ii rrmNqO0o0A5iR2rquiROXEm4xJMBySXt+hjFtvaWNBh94UjkIsp9mTxCd7MSYTzGMgA1 NxbkKTmw4iQFZ4zrai3F1hSxHY5j09Kf8U9WrftpMBQmW/491fG9af/aka85KpMAYLXL ppJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fieldses.org header.s=default header.b=bW7m9iDz; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c25si10264916eds.548.2020.09.15.11.33.42; Tue, 15 Sep 2020 11:34:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@fieldses.org header.s=default header.b=bW7m9iDz; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727961AbgIOSdS (ORCPT + 99 others); Tue, 15 Sep 2020 14:33:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727903AbgIOSdO (ORCPT ); Tue, 15 Sep 2020 14:33:14 -0400 Received: from fieldses.org (fieldses.org [IPv6:2600:3c00:e000:2f7::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DC14C06174A; Tue, 15 Sep 2020 11:33:11 -0700 (PDT) Received: by fieldses.org (Postfix, from userid 2815) id 769F2425E; Tue, 15 Sep 2020 14:33:10 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.11.0 fieldses.org 769F2425E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fieldses.org; s=default; t=1600194790; bh=Gzs0g7lW696ivl7ubWpdXh2/Wk4Ipx8dGRXKZd2l9RE=; h=Date:To:Cc:Subject:References:In-Reply-To:From:From; b=bW7m9iDz5Y4O1XoA29QxZDV1G6WuqJ1223x3/+QIHuVEkUK+HjpDUvjRsEeWAx5pF +ntKDBlKmaugVxJWU67WddvR3cPAZkbWrOvEK693RrimM9VtDtBEVyz08tfX1lJDDd /xaJAq3zWanpZFfuujis97ADehMctwrs5amDpNxw= Date: Tue, 15 Sep 2020 14:33:10 -0400 To: Jeffrey Mitchell Cc: Trond Myklebust , Anna Schumaker , linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] nfs: Fix security label length not being reset Message-ID: <20200915183310.GB32632@fieldses.org> References: <20200914154958.55451-1-jeffrey.mitchell@starlab.io> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200914154958.55451-1-jeffrey.mitchell@starlab.io> User-Agent: Mutt/1.5.21 (2010-09-15) From: bfields@fieldses.org (J. Bruce Fields) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Mon, Sep 14, 2020 at 10:49:57AM -0500, Jeffrey Mitchell wrote: > nfs_readdir_page_filler() iterates over entries in a directory, reusing > the same security label buffer, but does not reset the buffer's length. > This causes decode_attr_security_label() to return -ERANGE if an entry's > security label is longer than the previous one's. This error, in > nfs4_decode_dirent(), only gets passed up as -EAGAIN, which causes another > failed attempt to copy into the buffer. The second error is ignored and > the remaining entries do not show up in ls, specifically the getdents64() > syscall. > > Reproduce by creating multiple files in NFS and giving one of the later > files a longer security label. ls will not see that file nor any that are > added afterwards, though they will exist on the backend. Please include these paragraphs in the changelog. --b. > > - Jeffrey > > Jeffrey Mitchell (1): > nfs: Fix security label length not being reset > > fs/nfs/dir.c | 3 +++ > 1 file changed, 3 insertions(+) > > -- > 2.25.1