Whamcloud - gitweb
LU-12965 obdclass: remove assertion for imp_refcount 66/37066/2
authorLi Dongyang <dongyangli@ddn.com>
Wed, 13 Nov 2019 04:01:25 +0000 (15:01 +1100)
committerOleg Drokin <green@whamcloud.com>
Fri, 3 Jan 2020 23:43:46 +0000 (23:43 +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.

Lustre-change: https://review.whamcloud.com/36743
Lustre-commit: dd71e74fecf45b81daa27c89c0b8065a58cac5c1

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

index 5a3802d..ab319bb 100644 (file)
@@ -1268,8 +1268,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);