zephyr/kernel
iva kik 687f799b7f kernel/queue: fix queue append/get race
k_queue_append and k_queue_alloc_append are in a race
    condition.

    Scenario:
    Using either of the above mentioned functions from a
    preemptive context, can lead to the element being
    appended to the queue to be lost. The element loss happens
    when the k_queue_append is interrupted at a critical point,
    when the list only contains one element and k_queue_get is
    called, before the k_queue_append is allowed to complete.

    Fix:
    Move sys_sflist_peek_tail inside queue_insert(). Add additional
    bool paramenter to queue_insert(), to indicate append/prepend
    operation.
    Fixes #29257

Signed-off-by: iva kik <megatheriumiva@gmail.com>
2020-10-28 17:01:41 +01:00
..
include kernel: add common bits to support TLS 2020-10-24 10:52:00 -07:00
atomic_c.c kernel: Add k_heap synchronized memory allocator 2020-04-14 10:05:55 -07:00
cache_handlers.c syscalls: Add system call for cache flush & invalidate 2020-08-04 17:26:45 -04:00
CMakeLists.txt kernel: Deprecate CONFIG_MULTITHREADING 2020-09-23 15:50:32 -05:00
compiler_stack_protect.c kernel: Fix gcc-9.2 warning with _StackCheckHandler 2019-10-04 05:22:30 -07:00
device.c kernel: device: invert sense of ready bit 2020-09-15 18:22:38 +02:00
errno.c kernel: support using thread local storage for errno 2020-10-24 10:52:00 -07:00
fatal.c kernel: fatal: check if _current is NULL 2020-10-24 12:54:32 -04:00
futex.c kernel/timeout: Make timeout arguments an opaque type 2020-03-31 19:40:47 -04:00
idle.c kernel: handle thread self-aborts on idle thread 2020-09-30 14:11:59 -04:00
init.c kernel: Add cache coherence management framework 2020-10-21 06:38:53 -04:00
Kconfig kernel: support using thread local storage for errno 2020-10-24 10:52:00 -07:00
kheap.c device: Const-ify all device driver instance pointers 2020-09-02 13:48:13 +02:00
mailbox.c device: Const-ify all device driver instance pointers 2020-09-02 13:48:13 +02:00
mem_domain.c userspace: do nothing if added to same domain 2020-10-22 16:47:07 -07:00
mem_slab.c device: Const-ify all device driver instance pointers 2020-09-02 13:48:13 +02:00
mempool.c kernel: Refactor k_mem_pool APIs into a base and derived level 2020-04-14 10:05:55 -07:00
mempool_sys.c device: Const-ify all device driver instance pointers 2020-09-02 13:48:13 +02:00
mmu.c mmu: Fix mapping_pos calculation 2020-10-23 16:24:04 -04:00
msg_q.c doc: Clarify semantics of k_msgq_put 2020-09-23 13:21:07 -05:00
mutex.c device: Const-ify all device driver instance pointers 2020-09-02 13:48:13 +02:00
pipes.c device: Const-ify all device driver instance pointers 2020-09-02 13:48:13 +02:00
poll.c kernel/poll: Mark incompatibility with KERNEL_COHERENCE 2020-10-21 06:38:53 -04:00
queue.c kernel/queue: fix queue append/get race 2020-10-28 17:01:41 +01:00
sched.c kernel: add context pointer to thread->fn_abort 2020-10-22 23:32:37 -04:00
sem.c device: Const-ify all device driver instance pointers 2020-09-02 13:48:13 +02:00
smp.c kernel: smp: avoid identifier collisions 2020-07-25 21:26:15 -04:00
stack.c kernel: stack: fix stack_push spinlock and return 2020-10-07 17:10:36 -04:00
system_work_q.c device: Const-ify all device driver instance pointers 2020-09-02 13:48:13 +02:00
thread.c kernel: wipe TLS when dropping to user mode 2020-10-26 13:06:16 +01:00
thread_abort.c kernel: handle thread self-aborts on idle thread 2020-09-30 14:11:59 -04:00
timeout.c kernel: Add cache coherence management framework 2020-10-21 06:38:53 -04:00
timer.c kernel: timer: update k_timer API for const correctness 2020-10-02 11:29:14 +02:00
userspace.c userspace: Fix thread index type in z_thread_perms_all_clear() 2020-10-21 08:00:35 -04:00
userspace_handler.c userspace: update k_object API to support immutable objects 2020-09-02 13:48:13 +02:00
version.c zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
work_q.c kernel: delayed_work: update k_delayed_work_cancel documentation 2020-10-09 11:48:00 +02:00