Summary
In threadx modules, there is protection upon thread creation checking if priority and preemption priority is not higher than txm_module_instance_maximum_priority, but in thread_priority_change and thread_preemption_change there is no check for it
Details
there is an option to control the maximum thread priority and preemption priority.
This option controlled by:
|
UINT _txm_module_manager_maximum_module_priority_set(TXM_MODULE_INSTANCE *module_instance, UINT priority) |
This checked when creating all module threads:
|
if (module_instance -> txm_module_instance_start_stop_priority < module_instance -> txm_module_instance_maximum_priority || |
|
module_instance -> txm_module_instance_callback_priority < module_instance -> txm_module_instance_maximum_priority) |
|
if (extra_parameters[4] < module_instance -> txm_module_instance_maximum_priority) |
|
return(TX_PRIORITY_ERROR); |
|
|
|
if (extra_parameters[5] < module_instance -> txm_module_instance_maximum_priority) |
But not checked when thread request to change its/other thread priority.
Expected behaviour:
at:
|
static ALIGN_TYPE _txm_module_manager_tx_thread_preemption_change_dispatch(TXM_MODULE_INSTANCE *module_instance, ALIGN_TYPE param_0, ALIGN_TYPE param_1, ALIGN_TYPE param_2) |
|
static ALIGN_TYPE _txm_module_manager_tx_thread_priority_change_dispatch(TXM_MODULE_INSTANCE *module_instance, ALIGN_TYPE param_0, ALIGN_TYPE param_1, ALIGN_TYPE param_2) |
It will be checked if the requested thread is module thread and if it is to be checked against his module txm_module_instance_maximum_priority value
Impact
thread can have higher priority than allowed and potentially create a denial of service
Summary
In threadx modules, there is protection upon thread creation checking if priority and preemption priority is not higher than txm_module_instance_maximum_priority, but in thread_priority_change and thread_preemption_change there is no check for it
Details
there is an option to control the maximum thread priority and preemption priority.
This option controlled by:
threadx/common_modules/module_manager/src/txm_module_manager_maximum_module_priority_set.c
Line 68 in 7ad78c4
This checked when creating all module threads:
threadx/common_modules/module_manager/src/txm_module_manager_start.c
Lines 123 to 124 in 7ad78c4
threadx/common_modules/module_manager/inc/txm_module_manager_dispatch.h
Lines 2030 to 2033 in 7ad78c4
But not checked when thread request to change its/other thread priority.
Expected behaviour:
at:
threadx/common_modules/module_manager/inc/txm_module_manager_dispatch.h
Line 2387 in 7ad78c4
threadx/common_modules/module_manager/inc/txm_module_manager_dispatch.h
Line 2416 in 7ad78c4
It will be checked if the requested thread is module thread and if it is to be checked against his module txm_module_instance_maximum_priority value
Impact
thread can have higher priority than allowed and potentially create a denial of service