Whamcloud - gitweb
LU-18510 llite: free op_data upon error only when alloc inside 91/57291/3
authorQian Yingjin <qian@ddn.com>
Sat, 30 Nov 2024 06:48:31 +0000 (14:48 +0800)
committerOleg Drokin <green@whamcloud.com>
Thu, 2 Jan 2025 20:49:26 +0000 (20:49 +0000)
commit5bac854028d7bb4067ddad6fb2a4522eeb716782
treefac3f29702fd3b74bba4b84b0e5f6aa53dae7ae5
parent80a9e94df1865287dc67676528d3141a020288be
LU-18510 llite: free op_data upon error only when alloc inside

In ll_prep_md_op_data() for preparing md_op_data, it should free
@op_data upon ll_setup_filename() failure only when @op_data is
allocated inside.

Otherwise, it will double free @op_data for the pass-in case and
may cause sanity-sec/63 crash as follows:
ll_prep_md_op_data()) lustre: failed to setup filename: rc = -126
RIP: 0010:set_freepointer.part.57+0x0/0x10
kfree+0x238/0x250
ll_prep_md_op_data+0x2af/0x870 [lustre]
sa_prep_data+0xde/0x350 [lustre]
sa_statahead+0x3b9/0xd20 [lustre]
ll_statahead_thread+0x151f/0x2210 [lustre]

Fixes: 4d38566a004 (LU-13717 sec: filename encryption)
Test-Parameters: testlist=sanity-sec env=ONLY=63,ONLY_REPEAT=250
Signed-off-by: Qian Yingjin <qian@ddn.com>
Change-Id: Ia46635e5bab17e21f4c411e7497e8f70711eb4e4
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/57291
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Marc Vef <mvef@whamcloud.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/llite/llite_lib.c