diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2022-08-05 14:03:11 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2022-08-05 14:03:11 -0700 |
| commit | 79b7e67bb9747e621ff1b646a125fbea26e08d56 (patch) | |
| tree | 0f726e0c9ef34217fbc7bc3f6a7a79bea18fe17d /arch/um/kernel/mem.c | |
| parent | 4d5398a3ec060c1e3094097e52a19a4d0013c0e0 (diff) | |
| parent | af3e16101cee95efaa72095fe06c15ec0b8eb195 (diff) | |
| download | linux-79b7e67bb9747e621ff1b646a125fbea26e08d56.tar.gz linux-79b7e67bb9747e621ff1b646a125fbea26e08d56.tar.bz2 linux-79b7e67bb9747e621ff1b646a125fbea26e08d56.zip | |
Merge tag 'for-linus-5.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml
Pull UML updates from Richard Weinberger:
- KASAN support for x86_64
- noreboot command line option, just like qemu's -no-reboot
- Various fixes and cleanups
* tag 'for-linus-5.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml:
um: include sys/types.h for size_t
um: Replace to_phys() and to_virt() with less generic function names
um: Add missing apply_returns()
um: add "noreboot" command line option for PANIC_TIMEOUT=-1 setups
um: include linux/stddef.h for __always_inline
UML: add support for KASAN under x86_64
mm: Add PAGE_ALIGN_DOWN macro
um: random: Don't initialise hwrng struct with zero
um: remove unused mm_copy_segments
um: remove unused variable
um: Remove straying parenthesis
um: x86: print RIP with symbol
arch: um: Fix build for statically linked UML w/ constructors
x86/um: Kconfig: Fix indentation
um/drivers: Kconfig: Fix indentation
um: Kconfig: Fix indentation
Diffstat (limited to 'arch/um/kernel/mem.c')
| -rw-r--r-- | arch/um/kernel/mem.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c index 15295c3237a0..276a1f0b91f1 100644 --- a/arch/um/kernel/mem.c +++ b/arch/um/kernel/mem.c @@ -18,6 +18,25 @@ #include <kern_util.h> #include <mem_user.h> #include <os.h> +#include <linux/sched/task.h> + +#ifdef CONFIG_KASAN +int kasan_um_is_ready; +void kasan_init(void) +{ + /* + * kasan_map_memory will map all of the required address space and + * the host machine will allocate physical memory as necessary. + */ + kasan_map_memory((void *)KASAN_SHADOW_START, KASAN_SHADOW_SIZE); + init_task.kasan_depth = 0; + kasan_um_is_ready = true; +} + +static void (*kasan_init_ptr)(void) +__section(".kasan_init") __used += kasan_init; +#endif /* allocated in paging_init, zeroed in mem_init, and unchanged thereafter */ unsigned long *empty_zero_page = NULL; |
