Whamcloud - gitweb
LU-11385 lnet: check if current->nsproxy is NULL before using 77/34577/8
authorSonia Sharma <sharmaso@whamcloud.com>
Sat, 30 Mar 2019 08:32:34 +0000 (01:32 -0700)
committerOleg Drokin <green@whamcloud.com>
Sat, 14 Dec 2019 05:58:31 +0000 (05:58 +0000)
commitef1783e282f6eba9d69b0957f1b5fed00be0cbd6
tree01301c9abc257e2832a993115a272053addfd25b
parent0ad54d59777366fba8ee61eaaa27b3060c91782f
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.

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