| /kernel/linux/linux-6.6/kernel/livepatch/ |
| D | shadow.c | 3 * shadow.c - Shadow Variables 11 * DOC: Shadow variable API concurrency notes: 13 * The shadow variable API provides a simple relationship between an 15 * caller to provide any mutual exclusion required of the shadow data. 17 * Once a shadow variable is attached to its parent object via the 19 * call to klp_shadow_get() may then return the shadow variable's data 20 * pointer. Callers of klp_shadow_*alloc() should prepare shadow data 23 * The klp_shadow_*alloc() API calls may allocate memory for new shadow 42 * the shadow variables it references. 47 * struct klp_shadow - shadow variable structure [all …]
|
| /kernel/linux/linux-5.10/kernel/livepatch/ |
| D | shadow.c | 3 * shadow.c - Shadow Variables 11 * DOC: Shadow variable API concurrency notes: 13 * The shadow variable API provides a simple relationship between an 15 * caller to provide any mutual exclusion required of the shadow data. 17 * Once a shadow variable is attached to its parent object via the 19 * call to klp_shadow_get() may then return the shadow variable's data 20 * pointer. Callers of klp_shadow_*alloc() should prepare shadow data 23 * The klp_shadow_*alloc() API calls may allocate memory for new shadow 42 * the shadow variables it references. 47 * struct klp_shadow - shadow variable structure [all …]
|
| /kernel/linux/linux-6.6/Documentation/arch/x86/ |
| D | shstk.rst | 4 Control-flow Enforcement Technology (CET) Shadow Stack 14 CET introduces shadow stack and indirect branch tracking (IBT). A shadow stack 17 return address to both the normal stack and the shadow stack. Upon 18 function return, the processor pops the shadow stack copy and compares it 21 as marked by the compiler with 'ENDBR' opcodes. Not all CPU's have both Shadow 23 shadow stack and kernel IBT are supported. 25 Requirements to use Shadow Stack 28 To use userspace shadow stack you need HW that supports it, a kernel 31 The kernel Kconfig option is X86_USER_SHADOW_STACK. When compiled in, shadow 34 To build a user shadow stack enabled kernel, Binutils v2.29 or LLVM v6 or later [all …]
|
| /kernel/linux/linux-6.6/Documentation/livepatch/ |
| D | shadow-vars.rst | 2 Shadow Variables 5 Shadow variables are a simple way for livepatch modules to associate 6 additional "shadow" data with existing data structures. Shadow data is 8 unmodified. The shadow variable API described in this document is used 9 to allocate/add and remove/free shadow variables to/from their parents. 13 shadow data. The numeric identifier is a simple enumeration that may be 14 used to describe shadow variable version, class or type, etc. More 16 numeric id subsequently filters hashtable queries. Multiple shadow 24 (See the full API usage docbook notes in livepatch/shadow.c.) 26 A hashtable references all shadow variables. These references are [all …]
|
| /kernel/linux/linux-5.10/Documentation/livepatch/ |
| D | shadow-vars.rst | 2 Shadow Variables 5 Shadow variables are a simple way for livepatch modules to associate 6 additional "shadow" data with existing data structures. Shadow data is 8 unmodified. The shadow variable API described in this document is used 9 to allocate/add and remove/free shadow variables to/from their parents. 13 shadow data. The numeric identifier is a simple enumeration that may be 14 used to describe shadow variable version, class or type, etc. More 16 numeric id subsequently filters hashtable queries. Multiple shadow 24 (See the full API usage docbook notes in livepatch/shadow.c.) 26 A hashtable references all shadow variables. These references are [all …]
|
| /kernel/linux/linux-6.6/drivers/gpu/drm/ |
| D | drm_gem_atomic_helper.c | 22 * for planes with shadow buffers. 41 * A driver using a shadow buffer copies the content of the shadow buffers 43 * a mapping of the shadow buffer into kernel address space. The mappings 47 * The helpers for shadow-buffered planes establish and release mappings, 51 * Shadow-buffered planes can easily be enabled by using the provided macros 54 * shadow-buffer helpers. 70 * In the driver's atomic-update function, shadow-buffer mappings are available 83 * // access shadow buffer via shadow_plane_state->map 92 * callbacks. Access to shadow-buffer mappings is similar to regular 109 * // access shadow buffer via shadow_plane_state->map [all …]
|
| /kernel/linux/linux-5.10/kernel/ |
| D | cfi.c | 44 /* Page index for the beginning of the shadow */ 46 /* An array of __cfi_check locations (as indices to the shadow) */ 47 shadow_t shadow[1]; member 51 * The shadow covers ~128M from the beginning of the module region. If 61 /* The actual size of the shadow array, minus metadata */ 62 #define SHADOW_ARR_SIZE (SHADOW_SIZE - offsetof(struct cfi_shadow, shadow)) 68 /* Returns the index in the shadow for the given address */ 80 return -1; /* Cannot be addressed with shadow */ in ptr_to_shadow() 85 /* Returns the page address for an index in the shadow */ 95 /* Returns the __cfi_check function address for the given shadow location */ [all …]
|
| /kernel/linux/linux-6.6/drivers/scsi/ |
| D | xen-scsifront.c | 121 struct vscsifrnt_shadow *shadow[VSCSIIF_MAX_REQS]; member 163 info->shadow[id] = NULL; in _scsifront_put_rqid() 182 struct vscsifrnt_shadow *shadow) in scsifront_do_request() argument 186 struct scsi_cmnd *sc = shadow->sc; in scsifront_do_request() 197 info->shadow[id] = shadow; in scsifront_do_request() 198 shadow->rqid = id; in scsifront_do_request() 204 ring_req->act = shadow->act; in scsifront_do_request() 205 ring_req->ref_rqid = shadow->ref_rqid; in scsifront_do_request() 206 ring_req->nr_segments = shadow->nr_segments; in scsifront_do_request() 220 for (i = 0; i < (shadow->nr_segments & ~VSCSIIF_SG_GRANT); i++) in scsifront_do_request() [all …]
|
| /kernel/linux/linux-5.10/drivers/scsi/ |
| D | xen-scsifront.c | 118 struct vscsifrnt_shadow *shadow[VSCSIIF_MAX_REQS]; member 160 info->shadow[id] = NULL; in _scsifront_put_rqid() 179 struct vscsifrnt_shadow *shadow) in scsifront_do_request() argument 183 struct scsi_cmnd *sc = shadow->sc; in scsifront_do_request() 194 info->shadow[id] = shadow; in scsifront_do_request() 195 shadow->rqid = id; in scsifront_do_request() 201 ring_req->act = shadow->act; in scsifront_do_request() 202 ring_req->ref_rqid = shadow->ref_rqid; in scsifront_do_request() 203 ring_req->nr_segments = shadow->nr_segments; in scsifront_do_request() 217 for (i = 0; i < (shadow->nr_segments & ~VSCSIIF_SG_GRANT); i++) in scsifront_do_request() [all …]
|
| /kernel/linux/linux-6.6/mm/kmsan/ |
| D | core.c | 90 u32 *align_shadow_src, shadow; in kmsan_internal_memmove_metadata() local 101 * @src is untracked: zero out destination shadow, ignore the in kmsan_internal_memmove_metadata() 132 shadow = align_shadow_src[i]; in kmsan_internal_memmove_metadata() 137 * of the first shadow slot. in kmsan_internal_memmove_metadata() 140 shadow = (shadow >> skip_bits) << skip_bits; in kmsan_internal_memmove_metadata() 147 * last shadow slot. in kmsan_internal_memmove_metadata() 150 shadow = (shadow << skip_bits) >> skip_bits; in kmsan_internal_memmove_metadata() 154 * shadow is nonempty. in kmsan_internal_memmove_metadata() 156 if (origin_src[i] && (origin_src[i] != old_origin) && shadow) { in kmsan_internal_memmove_metadata() 167 if (shadow) in kmsan_internal_memmove_metadata() [all …]
|
| D | init.c | 67 * Initialize the shadow for existing mappings during kernel initialization. 83 /* Allocate shadow for .data */ in kmsan_init_shadow() 97 struct page *shadow, *origin; member 106 * time with a certain order, it is reserved as a shadow block, for the second 108 * shadow and origin ranges from the previously saved shadow and origin blocks, 116 struct page *shadow, *origin; in kmsan_memblock_free_pages() local 118 if (!held_back[order].shadow) { in kmsan_memblock_free_pages() 119 held_back[order].shadow = page; in kmsan_memblock_free_pages() 126 shadow = held_back[order].shadow; in kmsan_memblock_free_pages() 128 kmsan_setup_meta(page, shadow, origin, order); in kmsan_memblock_free_pages() [all …]
|
| D | shadow.c | 3 * KMSAN shadow implementation. 85 void *shadow; in kmsan_get_shadow_origin_ptr() local 97 shadow = kmsan_get_metadata(address, KMSAN_META_SHADOW); in kmsan_get_shadow_origin_ptr() 98 if (!shadow) in kmsan_get_shadow_origin_ptr() 101 ret.shadow = shadow; in kmsan_get_shadow_origin_ptr() 108 ret.shadow = dummy_store_page; in kmsan_get_shadow_origin_ptr() 112 ret.shadow = dummy_load_page; in kmsan_get_shadow_origin_ptr() 119 * Obtain the shadow or origin pointer for the given address, or NULL if there's 175 struct page *shadow, *origin; in kmsan_alloc_page() local 182 shadow = shadow_page_for(page); in kmsan_alloc_page() [all …]
|
| /kernel/linux/linux-6.6/include/drm/ |
| D | drm_gem_atomic_helper.h | 20 * Helpers for planes with shadow buffers 24 * DRM_SHADOW_PLANE_MAX_WIDTH - Maximum width of a plane's shadow buffer in pixels 26 * For drivers with shadow planes, the maximum width of the framebuffer is 33 * DRM_SHADOW_PLANE_MAX_HEIGHT - Maximum height of a plane's shadow buffer in scanlines 35 * For drivers with shadow planes, the maximum height of the framebuffer is 42 * struct drm_shadow_plane_state - plane state for planes with shadow buffers 44 * For planes that use a shadow buffer, struct drm_shadow_plane_state 45 * provides the regular plane state plus mappings of the shadow buffer 94 * Initializes struct drm_plane_funcs for shadow-buffered planes 96 * Drivers may use GEM BOs as shadow buffers over the framebuffer memory. This [all …]
|
| /kernel/linux/linux-6.6/arch/arm/mm/ |
| D | kasan_init.c | 55 panic("%s failed to allocate shadow page for address 0x%lx\n", in kasan_pte_populate() 64 * The early shadow memory is mapping all KASan in kasan_pte_populate() 68 * proper KASan shadow memory. in kasan_pte_populate() 74 * Early shadow mappings are PMD_SIZE aligned, so if the in kasan_pte_populate() 96 * We attempt to allocate a shadow block for the PMDs in kasan_pmd_populate() 104 panic("%s failed to allocate shadow block for address 0x%lx\n", in kasan_pmd_populate() 129 * Allocate and populate the shadow block of p4d folded into in kasan_pgd_populate() 136 panic("%s failed to allocate shadow block for address 0x%lx\n", in kasan_pgd_populate() 176 * We walk the page table and set all of the shadow memory to point in kasan_early_init() 196 pr_info("Mapping kernel virtual memory block: %px-%px at shadow: %px-%px\n", in create_mapping() [all …]
|
| /kernel/linux/linux-5.10/arch/arm/mm/ |
| D | kasan_init.c | 56 panic("%s failed to allocate shadow page for address 0x%lx\n", in kasan_pte_populate() 65 * The early shadow memory is mapping all KASan in kasan_pte_populate() 69 * proper KASan shadow memory. in kasan_pte_populate() 75 * Early shadow mappings are PMD_SIZE aligned, so if the in kasan_pte_populate() 97 * We attempt to allocate a shadow block for the PMDs in kasan_pmd_populate() 105 panic("%s failed to allocate shadow block for address 0x%lx\n", in kasan_pmd_populate() 130 * Allocate and populate the shadow block of p4d folded into in kasan_pgd_populate() 137 panic("%s failed to allocate shadow block for address 0x%lx\n", in kasan_pgd_populate() 177 * We walk the page table and set all of the shadow memory to point in kasan_early_init() 197 pr_info("Mapping kernel virtual memory block: %px-%px at shadow: %px-%px\n", in create_mapping() [all …]
|
| /kernel/linux/linux-6.6/drivers/gpio/ |
| D | gpio-mm-lantiq.c | 31 u16 shadow; /* shadow the latches state */ member 35 * ltq_mm_apply() - write the shadow value to the ebu address. 38 * Write the shadow value to the EBU to set the gpios. We need to set the 47 __raw_writew(chip->shadow, chip->mmchip.regs); in ltq_mm_apply() 58 * Set the shadow value and call ltq_mm_apply. 65 chip->shadow |= (1 << offset); in ltq_mm_set() 67 chip->shadow &= ~(1 << offset); in ltq_mm_set() 104 u32 shadow; in ltq_mm_probe() local 117 /* store the shadow value if one was passed by the devicetree */ in ltq_mm_probe() 118 if (!of_property_read_u32(pdev->dev.of_node, "lantiq,shadow", &shadow)) in ltq_mm_probe() [all …]
|
| /kernel/linux/linux-5.10/drivers/gpio/ |
| D | gpio-mm-lantiq.c | 31 u16 shadow; /* shadow the latches state */ member 35 * ltq_mm_apply() - write the shadow value to the ebu address. 38 * Write the shadow value to the EBU to set the gpios. We need to set the 47 __raw_writew(chip->shadow, chip->mmchip.regs); in ltq_mm_apply() 58 * Set the shadow value and call ltq_mm_apply. 65 chip->shadow |= (1 << offset); in ltq_mm_set() 67 chip->shadow &= ~(1 << offset); in ltq_mm_set() 104 u32 shadow; in ltq_mm_probe() local 117 /* store the shadow value if one was passed by the devicetree */ in ltq_mm_probe() 118 if (!of_property_read_u32(pdev->dev.of_node, "lantiq,shadow", &shadow)) in ltq_mm_probe() [all …]
|
| /kernel/linux/linux-6.6/arch/arm/include/asm/ |
| D | kasan_def.h | 19 * space to use as shadow memory for KASan as follows: 31 * | | |-> The shadow area of kernel virtual address. 34 * | |\ shadow address of MODULES_VADDR 47 * This value begins with the MODULE_VADDR's shadow address. It is the 49 * to cover also that area with shadow memory so we can find memory 53 * This value is the 0x100000000's shadow address: the mapping that would 55 * kernel address sanitizer shadow area. It is also the start of the 59 * This value is used to map an address to the corresponding shadow 65 * byte in the shadow memory covers 8 bytes of kernel memory, so one 66 * bit shadow memory per byte of kernel memory is used. [all …]
|
| /kernel/linux/linux-5.10/arch/arm/include/asm/ |
| D | kasan_def.h | 19 * space to use as shadow memory for KASan as follows: 31 * | | |-> The shadow area of kernel virtual address. 34 * | |\ shadow address of MODULES_VADDR 47 * This value begins with the MODULE_VADDR's shadow address. It is the 49 * to cover also that area with shadow memory so we can find memory 53 * This value is the 0x100000000's shadow address: the mapping that would 55 * kernel address sanitizer shadow area. It is also the start of the 59 * This value is used to map an address to the corresponding shadow 65 * byte in the shadow memory covers 8 bytes of kernel memory, so one 66 * bit shadow memory per byte of kernel memory is used. [all …]
|
| /kernel/linux/linux-6.6/Documentation/dev-tools/ |
| D | kmsan.rst | 95 incorrect shadow/origin values, likely leading to false positives. Functions 125 KMSAN shadow memory 128 KMSAN associates a metadata byte (also called shadow byte) with every byte of 129 kernel memory. A bit in the shadow byte is set iff the corresponding bit of the 131 setting its shadow bytes to ``0xff``) is called poisoning, marking it 132 initialized (setting the shadow bytes to ``0x00``) is called unpoisoning. 139 Compiler instrumentation also tracks the shadow values as they are used along 141 ``mm/kmsan/`` to persist shadow values. 143 The shadow value of a basic or compound type is an array of bytes of the same 145 When a value is read from memory, its shadow memory is also obtained and [all …]
|
| /kernel/linux/linux-5.10/Documentation/dev-tools/ |
| D | kasan.rst | 141 The state of each 8 aligned bytes of memory is encoded in one shadow byte. 143 We use the following encoding for each shadow byte: 0 means that all 8 bytes 150 In the report above the arrows point to the shadow byte 03, which means that 164 of kmemcheck: use shadow memory to record whether each byte of memory is safe 165 to access, and use compile-time instrumentation to insert checks of shadow 168 Generic KASAN dedicates 1/8th of kernel memory to its shadow memory (e.g. 16TB 170 translate a memory address to its corresponding shadow address. 172 Here is the function which translates an address to its corresponding shadow 186 access is valid or not by checking corresponding shadow memory. 189 function calls GCC directly inserts the code to check the shadow memory. [all …]
|
| /kernel/linux/linux-6.6/arch/powerpc/include/asm/ |
| D | kasan.h | 37 * The shadow ends before the highest accessible address 38 * because we don't need a shadow for the shadow. Instead: 46 * The shadow ends before the highest accessible address 47 * because we don't need a shadow for the shadow. 48 * But it doesn't hurt to have a shadow for the shadow, 49 * keep shadow end aligned eases things.
|
| /kernel/linux/linux-5.10/samples/livepatch/ |
| D | livepatch-shadow-fix1.c | 7 * livepatch-shadow-fix1.c - Shadow variables, livepatch demo 12 * Fixes the memory leak introduced in livepatch-shadow-mod through the 13 * use of a shadow variable. This fix demonstrates the "extending" of 22 * section of livepatch-shadow-mod.c. 32 /* Shadow variable enums */ 49 * In this example, it would be safe to assign the pointer also to the shadow 79 * Patch: save the extra memory location into a SV_LEAK shadow in livepatch_fix1_dummy_alloc() 90 pr_err("%s: failed to allocate shadow variable for the leaking pointer: dummy @ %p, leak @ %p\n", in livepatch_fix1_dummy_alloc() 122 * Patch: fetch the saved SV_LEAK shadow variable, detach and in livepatch_fix1_dummy_free() 123 * free it. Note: handle cases where this shadow variable does in livepatch_fix1_dummy_free() [all …]
|
| /kernel/linux/linux-6.6/samples/livepatch/ |
| D | livepatch-shadow-fix1.c | 7 * livepatch-shadow-fix1.c - Shadow variables, livepatch demo 12 * Fixes the memory leak introduced in livepatch-shadow-mod through the 13 * use of a shadow variable. This fix demonstrates the "extending" of 22 * section of livepatch-shadow-mod.c. 32 /* Shadow variable enums */ 49 * In this example, it would be safe to assign the pointer also to the shadow 79 * Patch: save the extra memory location into a SV_LEAK shadow in livepatch_fix1_dummy_alloc() 90 pr_err("%s: failed to allocate shadow variable for the leaking pointer: dummy @ %p, leak @ %p\n", in livepatch_fix1_dummy_alloc() 122 * Patch: fetch the saved SV_LEAK shadow variable, detach and in livepatch_fix1_dummy_free() 123 * free it. Note: handle cases where this shadow variable does in livepatch_fix1_dummy_free() [all …]
|
| /kernel/linux/linux-5.10/fs/nilfs2/ |
| D | mdt.c | 472 struct nilfs_shadow_map *shadow = mdi->mi_shadow; in nilfs_mdt_clear() local 477 if (shadow) { in nilfs_mdt_clear() 478 struct inode *s_inode = shadow->inode; in nilfs_mdt_clear() 480 shadow->inode = NULL; in nilfs_mdt_clear() 509 * nilfs_mdt_setup_shadow_map - setup shadow map and bind it to metadata file 511 * @shadow: shadow mapping 514 struct nilfs_shadow_map *shadow) in nilfs_mdt_setup_shadow_map() argument 519 INIT_LIST_HEAD(&shadow->frozen_buffers); in nilfs_mdt_setup_shadow_map() 525 shadow->inode = s_inode; in nilfs_mdt_setup_shadow_map() 526 mi->mi_shadow = shadow; in nilfs_mdt_setup_shadow_map() [all …]
|