ARM: Cortex-M: IRQ lock/unlock() API non-functional but accessible from user mode #21735
Labels
area: ARM
ARM (32-bit) Architecture
area: Userspace
Userspace
bug
The issue is a bug, or the PR is fixing a bug
priority: low
Low impact/importance bug
Describe the bug
IRQ API is a kernel API, so, normally it shall not be accessible from user mode. This is the case for most of the API functions; an attempt to use them leads to a CPU fault.
This is not the case, however, for
irq_lock()
,irq_unlock()
for ARM Cortex-M Mainline architecture (both ARMv7-M and ARMv8-M): these functions do not cause a fault if called from user mode, although, they (correctly) do not lock or unlock interrupts. Since we do not explicitly document that the IRQ API shall only be used from supervisor mode, this might end up very confusing for user threads calling irq_lock/unlock API.To Reproduce
Steps to reproduce the behavior:
Simply call irq_lock() from user mode on ARM Cortex-M Mainline. The call does not fail and does not lock the IRQs.
Expected behavior
It should be clear for user mode threads that irq lock /unlock cannot be used.
I would see two options here
The text was updated successfully, but these errors were encountered: