zephyr/samples/net/sockets
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
..
big_http_download samples: net: big_http_download: Fix POSIX compability 2023-01-19 11:17:38 +01:00
can yamllint: fix all yamllint truthy errors 2023-01-04 01:16:45 +09:00
coap_client includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
coap_server includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
dumb_http_server ethernet: remove defconfig/proj setting of ethernet drivers 2022-08-15 14:32:45 +02:00
dumb_http_server_mt all: Fix "#if IS_ENABLED(CONFIG_FOO)" occurrences 2022-12-21 10:09:23 +01:00
echo ethernet: remove defconfig/proj setting of ethernet drivers 2022-08-15 14:32:45 +02:00
echo_async
echo_async_select
echo_client boards: cc1352r1_launchxl: fix echo samples 2023-01-27 17:44:38 +09:00
echo_server samples: net: sockets: echo_server: Fix userspace crash 2023-03-03 10:48:21 +01:00
http_client include: net: http: rename http_x.h http/x.h 2022-10-12 09:02:21 -04:00
http_get yamllint: fix all yamllint comments-indentation errors 2023-01-04 01:16:45 +09:00
net_mgmt all: Fix "#if IS_ENABLED(CONFIG_FOO)" occurrences 2022-12-21 10:09:23 +01:00
packet all: Fix "#if IS_ENABLED(CONFIG_FOO)" occurrences 2022-12-21 10:09:23 +01:00
sntp_client
socketpair samples: net: socketpair: rename to main.c for consistence 2023-02-08 19:04:25 +09:00
tcp samples: socket: tcp: add tests section 2023-02-22 05:31:07 -05:00
txtime samples and tests: Add REQUIRED to Zephyr find_package call 2023-03-02 09:58:27 +01:00
websocket_client net: websocket: new receiving algorithm 2022-12-20 17:05:12 +00:00