Whamcloud - gitweb
LU-12965 obdclass: remove assertion for imp_refcount 43/36743/3
authorLi Dongyang <dongyangli@ddn.com>
Wed, 13 Nov 2019 04:01:25 +0000 (15:01 +1100)
committerOleg Drokin <green@whamcloud.com>
Tue, 17 Dec 2019 06:40:47 +0000 (06:40 +0000)
After calling obd_zombie_import_add(), obd_import could
be freed by obd_zombie before we check imp_refcount with
LASSERT_ATOMIC_GE_LT. It's a use after free and could
crash the box.

Signed-off-by: Li Dongyang <dongyangli@ddn.com>
Change-Id: I3d63acf2bff543924ca0e74a35d24c507d68f6aa
Reviewed-on: https://review.whamcloud.com/36743
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Shaun Tancheff <stancheff@cray.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/obdclass/genops.c

index af218a1..1ef9637 100644 (file)
@@ -1255,8 +1255,6 @@ void class_import_put(struct obd_import *imp)
                 obd_zombie_import_add(imp);
         }
 
-       /* catch possible import put race */
-       LASSERT_ATOMIC_GE_LT(&imp->imp_refcount, 0, LI_POISON);
        EXIT;
 }
 EXPORT_SYMBOL(class_import_put);