[LU-15545] lgss_sk crash because of freeing twice Created: 10/Feb/22  Updated: 02/Apr/22  Resolved: 02/Apr/22

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.15.0

Type: Bug Priority: Minor
Reporter: Li Xi Assignee: Feng Lei
Resolution: Fixed Votes: 0
Labels: None

Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

When a key "xxx" alreasy exists, following command would crash:

# /usr/sbin/lgss_sk -t client -f lustre0 -w xxx
Reading random data for shared key from '/dev/random'
Generating DH parameters, this can take a while...
error: opening 'xxx': File exists
*** Error in `/usr/sbin/lgss_sk': free(): invalid size: 0x000000000226ff90 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x81329)[0x7fc28d9e4329]
/lib64/libcrypto.so.10(CRYPTO_free+0x1d)[0x7fc28e51780d]
/lib64/libcrypto.so.10(BN_clear_free+0x50)[0x7fc28e575a20]
/lib64/libcrypto.so.10(DH_free+0x75)[0x7fc28e5ba125]
/usr/sbin/lgss_sk[0x402caa]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7fc28d985555]
/usr/sbin/lgss_sk[0x4031f3]
======= Memory map: ========

This is caused by calling DH_free() on the same address for twice.



 Comments   
Comment by Gerrit Updater [ 23/Feb/22 ]

"Feng, Lei <flei@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/46594
Subject: LU-15545 utils: fix double free in lgss_sk
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: fc151847435b39ed7c0bd45a3f88816602740dc4

Comment by Gerrit Updater [ 02/Apr/22 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/46594/
Subject: LU-15545 utils: fix double free in lgss_sk
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: cd34488668be189c5c7ce140190f9347b9c1d1e7

Comment by Peter Jones [ 02/Apr/22 ]

Landed for 2.15

Generated at Sat Feb 10 03:19:14 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.