zephyr/tests/kernel
Nicolas Pitre ace11bbefd mempool: make sure max block size isn't smaller than minimum allowed
If maxsize is smaller than _MPOOL_MINBLK, then Z_MPOOL_LVLS() will be 0.
That means the loop in z_sys_mem_pool_base_init() that initializes the
block free list for the nonexistent level 0 will corrupt whatever memory
at the location the zero-sized struct sys_mem_pool_lvl array was
located. And the corruption happens to be done with a perfectly legit
memory pool block address which makes for really nasty bugs to solve.

This is more likely on 64-bit systems due to _MPOOL_MINBLK being twice
the size of 32-bit systems.

Let's prevent that with a build-time assertion on maxsize when defining
a memory pool, and adjust the affected test accordingly.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-07-02 19:41:20 -07:00
..
arm_irq_vector_table
arm_ramfunc
arm_runtime_nmi cleanup: include/: move misc/reboot.h to power/reboot.h 2019-06-27 22:55:49 -04:00
arm_zero_latency_irqs
boot_page_table
common tests: common: add tests for extra sflist APIs 2019-07-01 08:25:25 -07:00
context
critical
device
early_sleep
fatal tests: kernel: fatal: run test for ARMv8-M with MPU stack guards 2019-07-01 12:54:20 -07:00
fifo
fp_sharing
gen_isr_table
interrupt
lifo
mbox
mem_heap/mheap_api_concept
mem_pool
mem_protect arch/x86: move include/arch/x86/arch.h to ia32/arch.h 2019-07-02 19:30:00 -04:00
mem_slab
mp
msgq/msgq_api
mutex tests: sys_mutex: improve code coverage 2019-06-29 13:31:14 -07:00
obj_tracing
pending
pipe
poll
profiling/profiling_api
queue mempool: make sure max block size isn't smaller than minimum allowed 2019-07-02 19:41:20 -07:00
sched tests: schedule_api: cover priority checks 2019-07-02 18:44:11 -04:00
semaphore
sleep kernel: cover k_usleep() from user mode 2019-06-29 20:55:07 -07:00
smp
spinlock
stack
static_idt arch/x86: move include/arch/x86/segmentation.h to ia32/segmentation.h 2019-07-02 19:30:00 -04:00
threads kernel: fix CONFIG_THREAD_NAME from user mode. 2019-07-01 16:29:45 -07:00
tickless
timer
workq
xip