]> git.baikalelectronics.ru Git - kernel.git/commit
NFSD: Fix a null reference case in find_or_create_lock_stateid()
authorKinglong Mee <kinglongmee@gmail.com>
Wed, 18 Jan 2017 11:04:42 +0000 (19:04 +0800)
committerJ. Bruce Fields <bfields@redhat.com>
Tue, 31 Jan 2017 17:29:24 +0000 (12:29 -0500)
commit3b092c0f57c28f007ea1b71b986a5201d4ab708e
tree8ce91162810ddf366f475ca22861c705aea115fa
parentaf3594dc652d27a1be9786fb22f7c0db391f6673
NFSD: Fix a null reference case in find_or_create_lock_stateid()

nfsd assigns the nfs4_free_lock_stateid to .sc_free in init_lock_stateid().

If nfsd doesn't go through init_lock_stateid() and put stateid at end,
there is a NULL reference to .sc_free when calling nfs4_put_stid(ns).

This patch let the nfs4_stid.sc_free assignment to nfs4_alloc_stid().

Cc: stable@vger.kernel.org
Fixes: 72e9dfd620bf "nfsd: clean up races in lock stateid searching..."
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4layouts.c
fs/nfsd/nfs4state.c
fs/nfsd/state.h