zephyr/samples/net/sockets
Robert Lubos 45d9960bc6 samples: net: sockets: echo_client: Fix userspace crash
k_work_* APIs cannot be used from user threads, hence it has to be
replaced with some other solution to retain userspace functionality in
the sample.

This commit reworks the sample as follows:
  * Replace delayed work items with combination of k_timer and a
    dedicated thread to send UDP packets. k_poll_signal is used for
    communication between k_timer callback and UDP thread.
  * As kernel objects should not be placed in a memory modifiable from
    user threads, declare a separate structure for them, and link it
    with the client context structure with a pointer.
  * k_timer_init() is not a system call, therefore it has to be called
    from supervisor thread. Therefore, add an additional function to
    initialize UDP, and use it to initialize kernel objects used by the
    UDP module and grant access for the main thread before it becomes an
    user thread. UDP thread inherits permissions from the parent (main
    thread).

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-03-20 16:56:46 +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 samples: migrate includes to contain <zephyr/...> prefix 2022-05-06 11:29:59 +02:00
echo_async_select samples: migrate includes to contain <zephyr/...> prefix 2022-05-06 11:29:59 +02:00
echo_client samples: net: sockets: echo_client: Fix userspace crash 2023-03-20 16:56:46 +01: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 samples: migrate includes to contain <zephyr/...> prefix 2022-05-06 11:29:59 +02:00
socketpair samples: net: socketpair: rename to main.c for consistence 2023-02-08 19:04:25 +09:00
tcp samples: net: sockets: tcp: Add newlib filter to samples.yaml 2023-03-16 11:46:45 +01: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