linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton-vpEMnDpepFuMZCB2o+C8xQ@public.gmane.org>
To: linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	william-M8Sm6a3kpgNeoWH0uzbU5w@public.gmane.org,
	bfields-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org
Subject: [RFC PATCH 1/4] Revert "nfs: take extra reference to fl->fl_file when running a LOCKU operation"
Date: Fri, 10 Jul 2015 16:33:31 -0400	[thread overview]
Message-ID: <1436560414-26306-2-git-send-email-jeff.layton@primarydata.com> (raw)
In-Reply-To: <1436560414-26306-1-git-send-email-jeff.layton-7I+n7zu2hftEKMMhf/gKZA@public.gmane.org>

This reverts commit db2efec0caba4f81a22d95a34da640b86c313c8e.

William reported that he was seeing instability with this patch, which
is likely due to the fact that it can cause the kernel to take a new
reference to a filp after the last reference has already been put.

Revert this patch for now, as we'll need to fix this in another way.

Cc: stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Reported-by: William Dauchy <william-M8Sm6a3kpgNeoWH0uzbU5w@public.gmane.org>
Signed-off-by: Jeff Layton <jeff.layton-7I+n7zu2hftEKMMhf/gKZA@public.gmane.org>
---
 fs/nfs/nfs4proc.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 6f228b5af819..60be01f69b84 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -5484,7 +5484,6 @@ static struct nfs4_unlockdata *nfs4_alloc_unlockdata(struct file_lock *fl,
 	atomic_inc(&lsp->ls_count);
 	/* Ensure we don't close file until we're done freeing locks! */
 	p->ctx = get_nfs_open_context(ctx);
-	get_file(fl->fl_file);
 	memcpy(&p->fl, fl, sizeof(p->fl));
 	p->server = NFS_SERVER(inode);
 	return p;
@@ -5496,7 +5495,6 @@ static void nfs4_locku_release_calldata(void *data)
 	nfs_free_seqid(calldata->arg.seqid);
 	nfs4_put_lock_state(calldata->lsp);
 	put_nfs_open_context(calldata->ctx);
-	fput(calldata->fl.fl_file);
 	kfree(calldata);
 }
 
-- 
2.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2015-07-10 20:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-10 20:33 [RFC PATCH 0/4] locks/nfs: fix use-after-free problem in unlock codepath Jeff Layton
2015-07-10 20:33 ` [RFC PATCH 2/4] locks: have flock_lock_file take an inode pointer instead of a filp Jeff Layton
2015-07-10 20:33 ` [RFC PATCH 3/4] locks: new helpers - flock_lock_inode_wait and posix_lock_inode_wait Jeff Layton
2015-07-10 20:33 ` [RFC PATCH 4/4] nfs4: have do_vfs_lock take an inode pointer Jeff Layton
     [not found] ` <1436560414-26306-1-git-send-email-jeff.layton-7I+n7zu2hftEKMMhf/gKZA@public.gmane.org>
2015-07-10 20:33   ` Jeff Layton [this message]
2015-07-10 20:51     ` [RFC PATCH 1/4] Revert "nfs: take extra reference to fl->fl_file when running a LOCKU operation" Jeff Layton
2015-07-10 21:10   ` [RFC PATCH 0/4] locks/nfs: fix use-after-free problem in unlock codepath J. Bruce Fields
     [not found]     ` <20150710211054.GB7665-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>
2015-07-10 21:14       ` Jeff Layton
     [not found]         ` <20150710171426.082be2b0-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2015-07-10 21:21           ` J. Bruce Fields
2015-07-13 10:22   ` [PATCH 5/4] locks: inline posix_lock_file_wait and flock_lock_file_wait Jeff Layton

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=1436560414-26306-2-git-send-email-jeff.layton@primarydata.com \
    --to=jlayton-vpemndpepfumzcb2o+c8xq@public.gmane.org \
    --cc=bfields-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org \
    --cc=linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=william-M8Sm6a3kpgNeoWH0uzbU5w@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).