Skip to contentSkip to conversation

[5.15] Please apply 'selftest/lkdtm: Skip stack-entropy test if lkdtm is not available'

DISCUSSION Andrew Paniakin 2 participants 2 messages Feb 17, 2023 – Feb 18, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

commit 90091c367e74d5b58d9ebe979cc363f7468f58d3 upstream.

This patch fixes the stack-entropy.sh test to exit gracefully when the LKDTM is not available. Test will hang otherwise as reported in [1].

Applicability of this fix to other LTS kernels:
- 4.14: No lkdtm selftest
- 4.19: No lkdtm selftest
- 5.4: No lkdtm selftests
- 5.10: Inital selftest version introduced in 46d1a0f03d661 ("selftests/lkdtm:
Add tests for LKDTM targets") is a single script which has the LKDTM availability check
- 6.1: Fix applied

This patch applies cleanly to stable-5.15 tree. Updated test was executed in Qemu VM with different kernels:
- CONFIG_LKDTM not enabled. Test finished with status SKIP.
- CONFIG_LKDTM enabled. Test failed (but not hanged) with error 'Stack entropy is low'.
- CONFIG_LKDTM enabled and randomize_kstack_offset=on boot argument provided. Test succeed.

[1] https://lore.kernel.org/lkml/[email protected]

#1 lore raw
Quoted 22 lines · Andrew Paniakin

commit 90091c367e74d5b58d9ebe979cc363f7468f58d3 upstream.

This patch fixes the stack-entropy.sh test to exit gracefully when the LKDTM is not available. Test will hang otherwise as reported in [1].

Applicability of this fix to other LTS kernels:
- 4.14: No lkdtm selftest
- 4.19: No lkdtm selftest
- 5.4: No lkdtm selftests
- 5.10: Inital selftest version introduced in 46d1a0f03d661 ("selftests/lkdtm:
Add tests for LKDTM targets") is a single script which has the LKDTM availability check
- 6.1: Fix applied

This patch applies cleanly to stable-5.15 tree. Updated test was executed in Qemu VM with different kernels:
- CONFIG_LKDTM not enabled. Test finished with status SKIP.
- CONFIG_LKDTM enabled. Test failed (but not hanged) with error 'Stack entropy is low'.
- CONFIG_LKDTM enabled and randomize_kstack_offset=on boot argument provided. Test succeed.

Quoted 1 line

[1] https://lore.kernel.org/lkml/[email protected]

Now queued up, thanks.

greg k-h