Whamcloud - gitweb
LU-15634 ptlrpc: Use after free of 'conn' in rhashtable retry 63/46763/2
authorShaun Tancheff <shaun.tancheff@hpe.com>
Wed, 9 Mar 2022 08:53:24 +0000 (02:53 -0600)
committerOleg Drokin <green@whamcloud.com>
Fri, 18 Mar 2022 17:34:41 +0000 (17:34 +0000)
commit9dcbf8b3d44f9bb2b1d9c3ac6036345bad827797
treea0c21cafbc81dcce5d725b8d51582d33d8584a9f
parent4be1f7995f06d00362d2845a6ba2c81edd5ffc8a
LU-15634 ptlrpc: Use after free of 'conn' in rhashtable retry

Use after free of 'conn' in the uncommon case of
rhashtable_lookup_get_insert_fast failing with -EBUSY or -ENOMEM

Move OBD_FREE_PTR(conn) below the retry and set conn2 to NULL
on error, propagating to conn and returning to the caller.

HPE-bug-id: LUS-10776
Fixes: 37b29a8f70 ("LU-8130 ptlrpc: convert conn_hash to rhashtable");
Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Change-Id: I2fb27d4e8fa6a5324d0a8e06afe34a39fa622bc2
Reviewed-on: https://review.whamcloud.com/46763
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/ptlrpc/connection.c