[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20150113070450.60f912f6@tlielax.poochiereds.net>
Date: Tue, 13 Jan 2015 07:04:50 -0500
From: Jeff Layton <jeff.layton@...marydata.com>
To: NeilBrown <neilb@...e.de>
Cc: Jeff Layton <jeff.layton@...marydata.com>,
"L. A. Walsh" <suse@...nx.org>, linux-kernel@...r.kernel.org,
linux-nfs@...r.kernel.org, linux-fsdevel@...r.kernel.org,
Jiri Slaby <jslaby@...e.cz>
Subject: Re: [PATCH] locks: fix NULL-deref in generic_delete_lease
On Tue, 13 Jan 2015 15:17:43 +1300
NeilBrown <neilb@...e.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@...nx.org>
> Link: https://bugzilla.suse.com/show_bug.cgi?id=912569
> Cc: stable@...r.kernel.org (v3.18)
> Fixes: 0efaa7e82f02fe69c05ad28e905f31fc86e6f08e
> Signed-off-by: NeilBrown <neilb@...e.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@...marydata.com>
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists