Skip to contentSkip to conversation

test_kmod: Avoid potential double free in trigger_config_run_type()

PATCH Markus Elfring 2 participants 2 messages Apr 18, 2020 – Apr 20, 2020 Kselftest

lore
Share & tools
lore
#0 lore raw
Quoted 2 lines

It should set config->test_fs instead of config->test_driver as NULL after kfree_const(config->test_fs) to avoid potential double free.

I suggest to improve this change description.

* How do you think about a wording variant like the following?

Reset the member “test_fs” of the test configuration after a call of the function “kfree_const” to a null pointer so that a double memory release will not be performed.

* Would you like to add the tag “Fixes”?

Regards,
Markus

#1 lore raw
Quoted 6 lines · Markus Elfring
Quoted 2 lines

It should set config->test_fs instead of config->test_driver as NULL after kfree_const(config->test_fs) to avoid potential double free.

I suggest to improve this change description.

* How do you think about a wording variant like the following?

Quoted 8 lines

Reset the member “test_fs” of the test configuration after a call of the function “kfree_const” to a null pointer so that a double memory release will not be performed.

* Would you like to add the tag “Fixes”?

Regards,
Markus

OK, I will send a v2 patch with the updated commit message and "Fixes" tag.

Thanks,
Tiezhu Yang