Commit 86bd911
committed
ipc: userspace: don't fault when removing an already-sent IPC message
z_vrfy_ipc_msg_list_remove() rejected any message that was not currently
on ipc->msg_list by failing K_SYSCALL_VERIFY(found), which turns into a
kernel oops. But ipc_msg_list_remove() is called from ipc_msg_free() /
mod_ipc_msg_free() to drop a message that may or may not still be
queued. The common case at stream stop / pipeline delete is freeing a
message that has already been sent and dequeued: its list node is
self-linked (empty), so it is not "found" and the verifier oopses the LL
user thread with:
<err> os.z_vrfy_ipc_msg_list_remove: syscall z_vrfy_ipc_msg_list_remove
... failed check: found
<err> os.z_fatal_error: >>> ZEPHYR FATAL ERROR 3: Kernel oops on CPU 0
Relax the checks to avoid this scenario. If the msg->list is empty, it
is safe to call z_impl_ipc_msg_list_remove(). The msg->list pointer
itself is already verified with K_SYSCALL_MEMORY_WRITE().
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>1 parent e8fafe2 commit 86bd911
1 file changed
Lines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
362 | 362 | | |
363 | 363 | | |
364 | 364 | | |
365 | | - | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
366 | 376 | | |
367 | 377 | | |
368 | 378 | | |
| |||
0 commit comments