zephyr/tests/net/socket/socketpair/testcase.yaml
Chaitanya Tata 40ee8791f2 net: socketpair: Fix use after free
In low memory conditions, its possible for socketpair memory allocation
to fail and then the socketpair is freed but after that the remote
semaphore is released causing a crash.

Fix this by freeing the socketpair after releasing the semaphore. Add a
test case to induce low memory conditions (low HEAP and high socketpair
buffer size), with the fix issue is not seen.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2023-09-18 20:34:12 +02:00

29 lines
926 B
YAML

common:
tags:
- net
- socket
- userspace
depends_on: netif
min_ram: 21
tests:
net.socket.socketpair:
platform_exclude: vmu_rt1170 mimxrt1160_evk_cm7 # See #61246
net.socket.socketpair.newlib:
filter: TOOLCHAIN_HAS_NEWLIB == 1
extra_configs:
- CONFIG_NEWLIB_LIBC=y
platform_exclude: vmu_rt1170 mimxrt1160_evk_cm7 # See #61246
net.socket.socketpair.picolibc:
filter: CONFIG_PICOLIBC_SUPPORTED
extra_configs:
- CONFIG_PICOLIBC=y
platform_exclude: vmu_rt1170 mimxrt1160_evk_cm7 # See #61246
net.socket.socketpair.high_mem:
min_ram: 64
extra_configs:
# Low buffer sizes (e.g., 8192) will verify the crash fix, but tests will still
# fail due to insufficient memory. So, use high buffer sizes.
- CONFIG_NET_SOCKETPAIR_BUFFER_SIZE=4096
- CONFIG_HEAP_MEM_POOL_SIZE=32768
platform_exclude: vmu_rt1170 mimxrt1160_evk_cm7 # See #61246