Whamcloud - gitweb
LU-18845 obdclass: NPE in with_imp_locked_nested 99/58499/4
authorVandana Rungta <vrungta@amazon.com>
Fri, 21 Mar 2025 16:06:25 +0000 (16:06 +0000)
committerOleg Drokin <green@whamcloud.com>
Fri, 25 Apr 2025 00:55:04 +0000 (00:55 +0000)
commit62276528bafd4a26885991478e577bad44901871
tree1f66e6473f46f5ea57e8ad10795a1114bdb27131
parenta5d184007053d1b6a7b75e9461dab0ec4bcd7aff
LU-18845 obdclass: NPE in with_imp_locked_nested

Unable to handle kernel NULL pointer dereference
at virtual address 0000000000000588

down_read+0x28/0x100
active_show+0x2c/0x90 [osp]
lustre_attr_show+0x1c/0x2c [obdclass]

active_show calls macro with_imp_locked with an
obd_device, which in turn gets a lock on
u.cli.cl_sem in obd_device. The exception is at offset 0x588,
and u.cli.cl_sem is at 0x588 in struct obd_device,
which confirms that a NULL obd was being used.

This fix adds checks for NULL obd to active_show.

Signed-off-by: Vandana Rungta <vrungta@amazon.com>
Change-Id: Ia0ff9e7a07f40bb7dd9c0d4cc0ecc38ea8d61d0b
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/58499
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Neil Brown <neil@brown.name>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Timothy Day <timday@amazon.com>
lustre/include/lprocfs_status.h
lustre/osp/lproc_osp.c