Whamcloud - gitweb
LU-11385 lnet: check if current->nsproxy is NULL before using 13/37313/2
authorSonia Sharma <sharmaso@whamcloud.com>
Sat, 30 Mar 2019 08:32:34 +0000 (01:32 -0700)
committerOleg Drokin <green@whamcloud.com>
Mon, 27 Jan 2020 23:12:44 +0000 (23:12 +0000)
commitfea400b3005982322c4e5c2df9b8376398a561ce
tree02f95cf07df026fe2758a8cc0c094a280573d15b
parentf8e915bc0946772ab9c92a8e3c37211716cbd395
LU-11385 lnet: check if current->nsproxy is NULL before using

A crash is seen at few sites in the function
rdma_create_id(current->nsproxy->net_ns, cb, dev, ps, qpt).
The issue is identified with the first param in this
function - current->nsproxy->net_ns. There is a
possibility that this value is NULL and resulting in
"kernel NULL pointer dereference" crash.

Handle the case of NULL value gracefully by adding
a check and using init_net if current or
current->nsproxy is NULL.

Lustre-change: https://review.whamcloud.com/34577
Lustre-commit: ef1783e282f6eba9d69b0957f1b5fed00be0cbd6

Change-Id: I06349e081f2c4ba0480b3924fc304f94ca765891
Signed-off-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Signed-off-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/37313
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lnet/klnds/o2iblnd/o2iblnd.h
lnet/lnet/acceptor.c
lnet/lnet/config.c
lnet/lnet/lib-move.c