zephyr/samples/net
Robert Lubos 46e93f67a6 samples: net: sockets: echo_server: Fix userspace crash
k_work_* API cannot not be used from the user threads as the APIs are
not syscalls. Doing so leads to a crash when userspace is enabled.

As the current use of delayed work API from user threads is merely
scheduling of the initial work execution, it can be moved into the main
thread context. The time difference from the former and current approach
should be marginal, as the start_tcp/udp_proto() calls are not blocking
calls.

Another issue was usage of k_mem_domain_add_thread() on uninitialized
TCP threads. This lead to another crash, as assigning thread to a memory
domain also involves removing it from the previous domain, which lead to
NULL pointer dereference if thread was not initialized yet. As, by
default, newly spawned threads inherit memory domain assignment from
their parent, it's not really needed to assign the same domain
explicitly, hence, it can be safely removed.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-03-03 10:48:21 +01:00
..
capture includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
cloud treewide: Disable automatic argparse argument shortening 2023-01-26 20:12:36 +09:00
common
dhcpv4_client includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
dns_resolve includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
dsa samples and tests: Add REQUIRED to Zephyr find_package call 2023-03-02 09:58:27 +01:00
eth_native_posix tests/samples: use integration_plaforms in more tests/samples 2022-11-29 16:03:23 +01:00
gptp yamllint: fix all yamllint line-length errors 2023-01-04 01:16:45 +09:00
gsm_modem includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
ipv4_autoconf tests/samples: use integration_plaforms in more tests/samples 2022-11-29 16:03:23 +01:00
lldp tests/samples: use integration_plaforms in more tests/samples 2022-11-29 16:03:23 +01:00
lwm2m_client net: lwm2m: Add event LWM2M_RD_CLIENT_EVENT_REG_UPDATE 2023-02-19 20:44:02 -05:00
mdns_responder tests/samples: use integration_plaforms in more tests/samples 2022-11-29 16:03:23 +01:00
mqtt_publisher all: Fix "#if IS_ENABLED(CONFIG_FOO)" occurrences 2022-12-21 10:09:23 +01:00
mqtt_sn_publisher tests/samples: use integration_plaforms in more tests/samples 2022-11-29 16:03:23 +01:00
openthread/coprocessor samples: net: openthread: coprocessor: Enable uart1 explicitly 2023-01-16 09:26:10 +01:00
promiscuous_mode includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
sockets samples: net: sockets: echo_server: Fix userspace crash 2023-03-03 10:48:21 +01:00
stats includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
syslog_net all: Fix "#if IS_ENABLED(CONFIG_FOO)" occurrences 2022-12-21 10:09:23 +01:00
telnet includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
virtual includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
vlan includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
wifi tests/samples: use integration_plaforms in more tests/samples 2022-11-29 16:03:23 +01:00
wpan_serial samples: Explicitly disable boot USB device support init at boot 2023-01-10 12:21:10 +01:00
wpanusb samples: Explicitly disable boot USB device support init at boot 2023-01-10 12:21:10 +01:00
zperf samples: Explicitly disable boot USB device support init at boot 2023-01-10 12:21:10 +01:00
net.rst