zephyr/subsys
Maochen Wang 1dbe1dfa1f net: lib: sockets: fix socket_service thread stuck by mistake
Use Wi-Fi connecting to Qualcomm IPQ8074 AP, and run the UDP RX traffic
with Zperf, but zperf does not return the throughput number after
traffic completion nor any session started prints. After traffic
completion, ping from STA to AP and vice versa does not work. The
socket_service thread is found blocked forever at zsock_wait_data()
after dns_dispatcher_svc_handler() is called via trigger_work().
The root cause of this issue is:
STA received one DHCPv4 packet containing DHCPV4_OPTIONS_DNS_SERVER,
it will create DNS socket and registered to socket_service. Then STA
received another IPv6 router advertisement packet containing
NET_ICMPV6_ND_OPT_RDNSS, it will close socket and change the state of
poll_events to K_POLL_STATE_CANCELLED(8), then registered to
socket_service with same fd. In socket_service thread, zsock_poll()
called zsock_poll_update_ctx() when handled ZFD_IOCTL_POLL_UPDATE, and
it checked the state of poll_events was not K_POLL_STATE_NOT_READY(0),
then it will set pfd->revents to '|= ZSOCK_POLLIN'. Finally
trigger_work() can be called as 'ctx.events[i].revents > 0' is matched.

The fix of this issue is that, in zsock_poll_update_ctx(), it should
check the state of poll_events is neither K_POLL_STATE_NOT_READY nor
K_POLL_STATE_CANCELLED before setting revents as ZSOCK_POLLIN, to avoid
trigger_work be unexpectedly called.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2025-03-12 07:14:46 +01:00
..
bindesc
bluetooth Bluetooth: SSP: Fix MITM flag incorrect issue in pairing 2025-03-12 07:14:25 +01:00
canbus
console
dap dap: add DAP backend USB 2025-03-11 18:54:24 +01:00
debug debug: gdbstub: Re-enable warning 2025-02-21 04:46:12 +01:00
demand_paging
dfu dfu: Add support for new MCUboot swap using offset mode 2025-02-10 19:05:25 +01:00
disk
dsp
emul
fb fb: cfb: Remove unused config 2025-02-13 12:14:52 +01:00
fs zms: fix the zms_mount() sector_size check 2025-03-12 02:29:31 +01:00
input
ipc ipc_service: icmsg: Add "unbound" functionality 2025-02-14 13:34:49 +01:00
jwt
llext llext: Add parameters to arch_elf_relocate 2025-03-07 19:44:54 +01:00
logging logging: Added config to disable vla in statements 2025-03-11 18:55:08 +01:00
lorawan lorawan: add callback for descriptor changes 2025-03-07 19:42:56 +01:00
mctp
mem_mgmt
mgmt mgmt: ec_host_cmd: remove response leftovers 2025-03-07 20:21:02 +01:00
modbus modbus: initialize return variable. 2025-01-21 19:28:52 +01:00
modem
net net: lib: sockets: fix socket_service thread stuck by mistake 2025-03-12 07:14:46 +01:00
pm pm: Remove deprecated function 2025-02-10 03:41:06 +01:00
portability portability: cmsis: Implement osThreadJoin using Zephyr k_thread_join 2025-03-07 19:51:50 +01:00
profiling arch: remove z_arch_esf_t 2025-01-23 16:32:36 +01:00
random random: Correct Mutex define 2025-03-04 21:55:45 +01:00
retention
rtio rtio: workq: Default workqueue to two threads with SPI/I2C/I3C 2025-03-07 20:00:18 +01:00
sd sd: mmc: Remove unwanted request to card for reading OCR content 2025-02-26 22:03:23 +00:00
secure_storage secure_storage: swap select to depends on 2025-02-27 09:07:56 +00:00
sensing sensing: Fix static assert in get_sensor_by_dev() 2025-01-18 12:40:03 +01:00
settings settings: zms: fix some bugs related to the name's ID 2025-03-06 11:37:58 +00:00
shell shell: fixes shell dead code issue 2025-03-07 20:00:27 +01:00
sip_svc
stats
storage storage/stream_flash: Switch to stream_flash_erase_to_append 2025-01-30 14:13:42 +01:00
task_wdt
testsuite toolchain: Add indirection for compiler warnings 2025-03-07 19:47:30 +01:00
timing
tracing
usb usb: device_next: fix Get Status request response 2025-02-28 14:51:53 +01:00
zbus zbus: assert when inside an ISR and time out is not zero 2025-01-21 19:30:20 +01:00
CMakeLists.txt
Kconfig