All of lore.kernel.org
 help / color / mirror / Atom feed
From: bfields@fieldses.org (J. Bruce Fields)
To: "J. Bruce Fields" <bfields@redhat.com>
Cc: linux-nfs@vger.kernel.org,
	Anna Schumaker <Anna.Schumaker@Netapp.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH 2/3] nfsd4: disallow SEEK with special stateids
Date: Tue, 21 Apr 2015 16:26:47 -0400	[thread overview]
Message-ID: <20150421202647.GC13782@fieldses.org> (raw)
In-Reply-To: <1429647735-15512-3-git-send-email-bfields@redhat.com>

On Tue, Apr 21, 2015 at 04:22:14PM -0400, J. Bruce Fields wrote:
> From: "J. Bruce Fields" <bfields@redhat.com>
> 
> If the client uses a special stateid then we'll pass a NULL file to
> vfs_llseek.

By the way, Christoph has also pointed out that it's probably worth
fixing nfsd4_preprocess_stateid_op() to do a temporary open itself in
the special stateid case.

If we wanted to get nfsd4_preprocess_stateid_op() to the point where it
also returned a file (if requested) on success, then there'd also be the
possible NULL returns from find_{read|write}able_file() to handle.

I haven't figured that out yet.

--b.

> 
> Fixes: 24bab491220f " NFSD: Implement SEEK"
> Cc: Anna Schumaker <Anna.Schumaker@Netapp.com>
> Cc: stable@vger.kernel.org
> Reported-by: Christoph Hellwig <hch@infradead.org>
> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
> ---
>  fs/nfsd/nfs4proc.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
> index d0848fc6529e..4a8314f08a0e 100644
> --- a/fs/nfsd/nfs4proc.c
> +++ b/fs/nfsd/nfs4proc.c
> @@ -1071,6 +1071,8 @@ nfsd4_seek(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
>  		dprintk("NFSD: nfsd4_seek: couldn't process stateid!\n");
>  		return status;
>  	}
> +	if (!file)
> +		return nfserr_bad_stateid;
>  
>  	switch (seek->seek_whence) {
>  	case NFS4_CONTENT_DATA:
> -- 
> 1.9.3
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2015-04-21 20:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-21 20:22 patches for 4.1 J. Bruce Fields
2015-04-21 20:22 ` [PATCH 1/3] nfsd4: disallow ALLOCATE with special stateids J. Bruce Fields
2015-04-21 20:22 ` [PATCH 2/3] nfsd4: disallow SEEK " J. Bruce Fields
2015-04-21 20:26   ` J. Bruce Fields [this message]
2015-04-21 20:22 ` [PATCH 3/3] nfsd4: fix READ permission checking J. Bruce Fields

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=20150421202647.GC13782@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=Anna.Schumaker@Netapp.com \
    --cc=bfields@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.