]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
nfsd: memory corruption in nfsd4_lock()
authorVasily Averin <vvs@virtuozzo.com>
Fri, 27 Mar 2020 04:50:40 +0000 (07:50 +0300)
committerStefan Bader <stefan.bader@canonical.com>
Thu, 14 May 2020 08:54:17 +0000 (10:54 +0200)
commit941bc0b8d9879f13be6e09d3c6586af379d7d308
treedb9b97296946c960207c234472e0defb58e99b8b
parente91dda7bad8cdea7f542c00030ba7b277af38dbf
nfsd: memory corruption in nfsd4_lock()

BugLink: https://bugs.launchpad.net/bugs/1877461
commit e1e8399eee72e9d5246d4d1bcacd793debe34dd3 upstream.

New struct nfsd4_blocked_lock allocated in find_or_allocate_block()
does not initialized nbl_list and nbl_lru.
If conflock allocation fails rollback can call list_del_init()
access uninitialized fields and corrupt memory.

v2: just initialize nbl_list and nbl_lru right after nbl allocation.

Fixes: 76d348fadff5 ("nfsd: have nfsd4_lock use blocking locks for v4.1+ lock")
Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
fs/nfsd/nfs4state.c