Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SM2算法存在内存泄漏问题 #1750

Open
Zak-Young opened this issue Sep 27, 2024 · 0 comments
Open

SM2算法存在内存泄漏问题 #1750

Zak-Young opened this issue Sep 27, 2024 · 0 comments

Comments

@Zak-Young
Copy link

在使用asan编译GmSSl后执行GmSSl命令,发现GmSSl的SM2算法存在内存泄漏。
执行 gmssl sm2utl -verify -in GRCh38.103.gtf -sigfile result.sign -pubin -inkey public.pem -passin pass:testgmssl -id "5"
本身这是一个构造的会失败的用例,其中GRCh38.103.gtf是一个大小超出SM2算法处理范围的压缩包。执行该命令暴露出如下地址消毒问题:

Direct leak of 112 byte(s) in 1 object(s) allocated from:
#0 0xffff93199404 in malloc (/usr/lib64/libasan.so.6+0xaa404)
#1 0xffff92eb5ac0 in CRYPTO_zalloc (/home/XXX/opt/gmssl/lib/libcrypto.so.1.1+0x14cac0)
#2 0xffff92e093d8 in BIO_new (/home/XXX/opt/gmssl/lib/libcrypto.so.1.1+0xa03d8)
#3 0xffff92e0df18 in BIO_new_file (/home/XXX/opt/gmssl/lib/libcrypto.so.1.1+0xa4f18)
#4 0x450b08 in sm2utl_main (/home/XXX/opt/gmssl/bin/gmssl+0x450b08)
#5 0x431370 in do_cmd (/home/XXX/opt/gmssl/bin/gmssl+0x431370)
#6 0x41c7bc in main (/home/XXX/opt/gmssl/bin/gmssl+0x41c7bc)
#7 0xffff92be4ffc (/usr/lib64/libc.so.6+0x2affc)
#8 0xffff92be50d4 in __libc_start_main (/usr/lib64/libc.so.6+0x2b0d4)
#9 0x41c82c in _start (/home/XXX/opt/gmssl/bin/gmssl+0x41c82c)

Direct leak of 112 byte(s) in 1 object(s) allocated from:
#0 0xffff93199404 in malloc (/usr/lib64/libasan.so.6+0xaa404)
#1 0xffff92eb5ac0 in CRYPTO_zalloc (/home/XXX/opt/gmssl/lib/libcrypto.so.1.1+0x14cac0)
#2 0xffff92e093d8 in BIO_new (/home/XXX/opt/gmssl/lib/libcrypto.so.1.1+0xa03d8)
#3 0xffff92e0df18 in BIO_new_file (/home/XXX/opt/gmssl/lib/libcrypto.so.1.1+0xa4f18)
#4 0x4213f8 in bio_open_default (/home/XXX/opt/gmssl/bin/gmssl+0x4213f8)
#5 0x450ad4 in sm2utl_main (/home/XXX/opt/gmssl/bin/gmssl+0x450ad4)
#6 0x431370 in do_cmd (/home/XXX/opt/gmssl/bin/gmssl+0x431370)
#7 0x41c7bc in main (/home/XXX/opt/gmssl/bin/gmssl+0x41c7bc)
#8 0xffff92be4ffc (/usr/lib64/libc.so.6+0x2affc)
#9 0xffff92be50d4 in __libc_start_main (/usr/lib64/libc.so.6+0x2b0d4)
#10 0x41c82c in _start (/home/XXX/opt/gmssl/bin/gmssl+0x41c82c)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant