Linux NFS development
 help / color / mirror / Atom feed
From: Jeff Layton <jeff.layton@primarydata.com>
To: NeilBrown <neilb@suse.de>
Cc: Jeff Layton <jeff.layton@primarydata.com>,
	"L. A. Walsh" <suse@tlinx.org>,
	linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, Jiri Slaby <jslaby@suse.cz>
Subject: Re: [PATCH] locks: fix NULL-deref in generic_delete_lease
Date: Tue, 13 Jan 2015 07:04:50 -0500	[thread overview]
Message-ID: <20150113070450.60f912f6@tlielax.poochiereds.net> (raw)
In-Reply-To: <20150113151743.7c260163@notabene.brown>

[-- Attachment #1: Type: text/plain, Size: 1361 bytes --]

On Tue, 13 Jan 2015 15:17:43 +1300
NeilBrown <neilb@suse.de> wrote:

> 
> 
> commit 0efaa7e82f02fe69c05ad28e905f31fc86e6f08e
>   locks: generic_delete_lease doesn't need a file_lock at all
> 
> moves the call to fl->fl_lmops->lm_change() to a place in the
> code where fl might be a non-lease lock.
> When that happens, fl_lmops is NULL and an Oops ensures.
> 
> So add an extra test to restore correct functioning.
> 
> Reported-by: Linda Walsh <suse@tlinx.org>
> Link: https://bugzilla.suse.com/show_bug.cgi?id=912569
> Cc: stable@vger.kernel.org (v3.18)
> Fixes: 0efaa7e82f02fe69c05ad28e905f31fc86e6f08e
> Signed-off-by: NeilBrown <neilb@suse.de>
> ---
>  fs/locks.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/locks.c b/fs/locks.c
> index 735b8d3fa78c..59e2f905e4ff 100644
> --- a/fs/locks.c
> +++ b/fs/locks.c
> @@ -1702,7 +1702,7 @@ static int generic_delete_lease(struct file *filp)
>  			break;
>  	}
>  	trace_generic_delete_lease(inode, fl);
> -	if (fl)
> +	if (fl && IS_LEASE(fl))
>  		error = fl->fl_lmops->lm_change(before, F_UNLCK, &dispose);
>  	spin_unlock(&inode->i_lock);
>  	locks_dispose_list(&dispose);

Looks good. I'll merge and do a bit of testing on it today and send it
along to Linus in the next day or so.

Thanks!
-- 
Jeff Layton <jlayton@primarydata.com>

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

      reply	other threads:[~2015-01-13 12:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-13  2:17 [PATCH] locks: fix NULL-deref in generic_delete_lease NeilBrown
2015-01-13 12:04 ` Jeff Layton [this message]

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=20150113070450.60f912f6@tlielax.poochiereds.net \
    --to=jeff.layton@primarydata.com \
    --cc=jslaby@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=suse@tlinx.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