zephyr/kernel
Flavio Ceolin 6c0fad2888 kernel: Fixes for z_early_rand_get
The early random get function was making many wrong assumptions
about random subsys and entropy drivers. First, it was assuming
that entropy_get_entropy() would be ISR safe, that is not right,
the driver has an ISR safe callback and if it is not implemented
or not working it is not ok using the other callback.
Second, the fallback to the random subsys is even more problematic
since they can use kernel services to protect internal states and be
thread-safe.

Another incorrect thing in this function was the guard around it.
It was needed by features like stack randomization and stack canaries,
and not when those conditions were match. Just remove it and in case
it is not needed the linker will take care of it.

The drawback of this change is that in the absence of an entropy
generator with support to be called from ISR the randomness is very
weak.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-13 10:03:53 +03:00
..
include kernel: random: Rename early random get function 2023-10-13 10:03:53 +03:00
paging
atomic_c.c kernel/atomic_c.c: prevent usage in SMP configs 2023-05-23 08:53:39 +02:00
banner.c kernel: banner: Allow for customising version 2023-08-21 10:09:46 +02:00
busy_wait.c kernel: crude k_busy_wait() implementation 2023-07-19 21:42:41 -04:00
CMakeLists.txt kernel: Add initial obj_core infrastructure 2023-09-30 08:04:14 +03:00
compiler_stack_protect.c kernel: canaries: Allow using TLS to store it 2023-08-08 19:08:04 -04:00
condvar.c kernel: Integrate object cores into kernel 2023-09-30 08:04:14 +03:00
device.c device: make device dependencies optional 2023-06-21 09:32:05 +02:00
dynamic.c kernel: dynamic: add missing assert argument 2023-09-06 18:34:58 +02:00
dynamic_disabled.c kernel: dynamic: declare dynamic stubs when disabled 2023-07-24 12:59:43 -04:00
errno.c
events.c kernel: Integrate object cores into kernel 2023-09-30 08:04:14 +03:00
fatal.c kernel: fatal: Remove redundant function 2023-09-29 13:05:13 +02:00
futex.c
idle.c kernel: move wait_q.h header to be internal 2023-09-12 12:55:36 -04:00
init.c kernel: Fixes for z_early_rand_get 2023-10-13 10:03:53 +03:00
Kconfig libc: Control Z_LIBC_PARTITION_EXISTS from Kconfig 2023-10-10 23:39:40 +03:00
Kconfig.vm kernel: mmu: add direct-map support in z_phys_map() 2023-05-26 13:50:35 -04:00
kheap.c kernel: move wait_q.h header to be internal 2023-09-12 12:55:36 -04:00
mailbox.c kernel: Remove legacy mem block from mailbox 2023-10-13 09:56:02 +03:00
main_weak.c kernel: Switch main return type from void to int 2023-04-14 07:49:41 +09:00
mem_domain.c init: remove the need for a dummy device pointer in SYS_INIT functions 2023-04-12 14:28:07 +00:00
mem_slab.c kernel: Integrate object core statistics 2023-09-30 08:04:14 +03:00
mempool.c
mmu.c kernel: mmu: fix bitmap set and clear under direct map 2023-08-15 16:30:55 -04:00
msg_q.c kernel: Integrate object cores into kernel 2023-09-30 08:04:14 +03:00
mutex.c kernel: Integrate object cores into kernel 2023-09-30 08:04:14 +03:00
obj_core.c kernel: Integrate object core statistics 2023-09-30 08:04:14 +03:00
pipes.c kernel: Integrate object cores into kernel 2023-09-30 08:04:14 +03:00
poll.c kernel: poll: Lock all calls to signal_poll_event 2023-09-18 15:41:23 -04:00
queue.c kernel: Integrate object cores into kernel 2023-09-30 08:04:14 +03:00
sched.c kernel: move sched_priq.h to internal/ folder 2023-09-30 18:43:28 +02:00
sem.c kernel: Integrate object cores into kernel 2023-09-30 08:04:14 +03:00
smp.c kernel: rename shadow variables 2023-08-10 08:14:12 +00:00
stack.c kernel: Integrate object cores into kernel 2023-09-30 08:04:14 +03:00
system_work_q.c init: remove the need for a dummy device pointer in SYS_INIT functions 2023-04-12 14:28:07 +00:00
thread.c kernel: random: Rename early random get function 2023-10-13 10:03:53 +03:00
timeout.c kernel: move timeout_q.h to kernel/include 2023-09-12 12:55:36 -04:00
timer.c kernel: Integrate object cores into kernel 2023-09-30 08:04:14 +03:00
usage.c kernel: Integrate object core statistics 2023-09-30 08:04:14 +03:00
userspace.c kernel: s/k_current_get/_current 2023-09-29 13:05:13 +02:00
userspace_handler.c kernel: userspace: add k_object_is_valid() 2023-09-28 17:28:43 -04:00
version.c
work.c kernel: work: check handler when submit to queue 2023-10-05 13:43:07 +01:00
xip.c kernel: canaries: Allow using TLS to store it 2023-08-08 19:08:04 -04:00