/mm/ |
D | usercopy.c | 103 static bool overlaps(const unsigned long ptr, unsigned long n, in overlaps() argument 106 const unsigned long check_low = ptr; in overlaps() 117 static inline void check_kernel_text_object(const unsigned long ptr, in check_kernel_text_object() argument 124 if (overlaps(ptr, n, textlow, texthigh)) in check_kernel_text_object() 125 usercopy_abort("kernel text", NULL, to_user, ptr - textlow, n); in check_kernel_text_object() 142 if (overlaps(ptr, n, textlow_linear, texthigh_linear)) in check_kernel_text_object() 144 ptr - textlow_linear, n); in check_kernel_text_object() 147 static inline void check_bogus_address(const unsigned long ptr, unsigned long n, in check_bogus_address() argument 151 if (ptr + (n - 1) < ptr) in check_bogus_address() 152 usercopy_abort("wrapped address", NULL, to_user, 0, ptr + n); in check_bogus_address() [all …]
|
D | kmemleak.c | 283 const u8 *ptr = (const u8 *)object->pointer; in hex_dump_object() local 292 HEX_GROUP_SIZE, ptr, len, HEX_ASCII); in hex_dump_object() 349 void *ptr = (void *)object->trace[i]; in print_unreferenced() local 350 warn_or_seq_printf(seq, " [<%p>] %pS\n", ptr, ptr); in print_unreferenced() 379 static struct kmemleak_object *lookup_object(unsigned long ptr, int alias) in lookup_object() argument 386 if (ptr < object->pointer) in lookup_object() 388 else if (object->pointer + object->size <= ptr) in lookup_object() 390 else if (object->pointer == ptr || alias) in lookup_object() 394 ptr); in lookup_object() 511 static struct kmemleak_object *find_and_get_object(unsigned long ptr, int alias) in find_and_get_object() argument [all …]
|
D | percpu.c | 111 #define __pcpu_ptr_to_addr(ptr) \ argument 112 (void __force *)((unsigned long)(ptr) + \ 119 #define __pcpu_ptr_to_addr(ptr) (void __force *)(ptr) argument 520 static void pcpu_mem_free(void *ptr) in pcpu_mem_free() argument 522 kvfree(ptr); in pcpu_mem_free() 1598 void __percpu *ptr; in pcpu_alloc() local 1736 ptr = __addr_to_pcpu_ptr(chunk->base_addr + off); in pcpu_alloc() 1737 kmemleak_alloc_percpu(ptr, size, gfp); in pcpu_alloc() 1740 chunk->base_addr, off, ptr); in pcpu_alloc() 1742 return ptr; in pcpu_alloc() [all …]
|
D | dmapool.c | 509 struct dma_pool **ptr, *pool; in dmam_pool_create() local 511 ptr = devres_alloc(dmam_pool_release, sizeof(*ptr), GFP_KERNEL); in dmam_pool_create() 512 if (!ptr) in dmam_pool_create() 515 pool = *ptr = dma_pool_create(name, dev, size, align, allocation); in dmam_pool_create() 517 devres_add(dev, ptr); in dmam_pool_create() 519 devres_free(ptr); in dmam_pool_create()
|
D | sparse.c | 503 void *ptr = NULL; in sparse_buffer_alloc() local 506 ptr = (void *) roundup((unsigned long)sparsemap_buf, size); in sparse_buffer_alloc() 507 if (ptr + size > sparsemap_buf_end) in sparse_buffer_alloc() 508 ptr = NULL; in sparse_buffer_alloc() 511 if ((unsigned long)(ptr - sparsemap_buf) > 0) in sparse_buffer_alloc() 512 sparse_buffer_free((unsigned long)(ptr - sparsemap_buf)); in sparse_buffer_alloc() 513 sparsemap_buf = ptr + size; in sparse_buffer_alloc() 516 return ptr; in sparse_buffer_alloc()
|
D | sparse-vmemmap.c | 76 void *ptr = sparse_buffer_alloc(size); in vmemmap_alloc_block_buf() local 78 if (!ptr) in vmemmap_alloc_block_buf() 79 ptr = vmemmap_alloc_block(size, node); in vmemmap_alloc_block_buf() 80 return ptr; in vmemmap_alloc_block_buf()
|
D | slab.c | 247 #define MAKE_ALL_LISTS(cachep, ptr, nodeid) \ argument 249 MAKE_LIST((cachep), (&(ptr)->slabs_full), slabs_full, nodeid); \ 250 MAKE_LIST((cachep), (&(ptr)->slabs_partial), slabs_partial, nodeid); \ 251 MAKE_LIST((cachep), (&(ptr)->slabs_free), slabs_free, nodeid); \ 1157 struct kmem_cache_node *ptr; in init_list() local 1159 ptr = kmalloc_node(sizeof(struct kmem_cache_node), GFP_NOWAIT, nodeid); in init_list() 1160 BUG_ON(!ptr); in init_list() 1162 memcpy(ptr, list, sizeof(struct kmem_cache_node)); in init_list() 1166 spin_lock_init(&ptr->list_lock); in init_list() 1168 MAKE_ALL_LISTS(cachep, ptr, nodeid); in init_list() [all …]
|
D | memblock.c | 1508 void *ptr; in memblock_alloc_try_nid_raw() local 1514 ptr = memblock_alloc_internal(size, align, in memblock_alloc_try_nid_raw() 1516 if (ptr && size > 0) in memblock_alloc_try_nid_raw() 1517 page_init_poison(ptr, size); in memblock_alloc_try_nid_raw() 1519 return ptr; in memblock_alloc_try_nid_raw() 1544 void *ptr; in memblock_alloc_try_nid() local 1549 ptr = memblock_alloc_internal(size, align, in memblock_alloc_try_nid() 1551 if (ptr) in memblock_alloc_try_nid() 1552 memset(ptr, 0, size); in memblock_alloc_try_nid() 1554 return ptr; in memblock_alloc_try_nid()
|
D | list_lru.c | 60 static __always_inline struct mem_cgroup *mem_cgroup_from_kmem(void *ptr) in mem_cgroup_from_kmem() argument 66 page = virt_to_head_page(ptr); in mem_cgroup_from_kmem() 71 list_lru_from_kmem(struct list_lru_node *nlru, void *ptr, in list_lru_from_kmem() argument 80 memcg = mem_cgroup_from_kmem(ptr); in list_lru_from_kmem() 116 list_lru_from_kmem(struct list_lru_node *nlru, void *ptr, in list_lru_from_kmem() argument
|
D | zswap.c | 961 static int zswap_is_page_same_filled(void *ptr, unsigned long *value) in zswap_is_page_same_filled() argument 966 page = (unsigned long *)ptr; in zswap_is_page_same_filled() 975 static void zswap_fill_page(void *ptr, unsigned long value) in zswap_fill_page() argument 979 page = (unsigned long *)ptr; in zswap_fill_page()
|
D | slub.c | 249 static inline void *freelist_ptr(const struct kmem_cache *s, void *ptr, in freelist_ptr() argument 263 return (void *)((unsigned long)ptr ^ s->random ^ in freelist_ptr() 266 return ptr; in freelist_ptr() 1388 static inline void *kmalloc_large_node_hook(void *ptr, size_t size, gfp_t flags) in kmalloc_large_node_hook() argument 1390 ptr = kasan_kmalloc_large(ptr, size, flags); in kmalloc_large_node_hook() 1392 kmemleak_alloc(ptr, size, 1, flags); in kmalloc_large_node_hook() 1393 return ptr; in kmalloc_large_node_hook() 3812 void *ptr = NULL; in kmalloc_large_node() local 3818 ptr = page_address(page); in kmalloc_large_node() 3823 return kmalloc_large_node_hook(ptr, size, flags); in kmalloc_large_node() [all …]
|
D | hugetlb_cgroup.c | 182 struct hugetlb_cgroup **ptr) in hugetlb_cgroup_charge_cgroup() argument 209 *ptr = h_cg; in hugetlb_cgroup_charge_cgroup()
|
/mm/kasan/ |
D | common.c | 42 static inline int in_irqentry_text(unsigned long ptr) in in_irqentry_text() argument 44 return (ptr >= (unsigned long)&__irqentry_text_start && in in_irqentry_text() 45 ptr < (unsigned long)&__irqentry_text_end) || in in_irqentry_text() 46 (ptr >= (unsigned long)&__softirqentry_text_start && in in_irqentry_text() 47 ptr < (unsigned long)&__softirqentry_text_end); in in_irqentry_text() 528 void * __must_check kasan_kmalloc_large(const void *ptr, size_t size, in kasan_kmalloc_large() argument 538 if (unlikely(ptr == NULL)) in kasan_kmalloc_large() 541 page = virt_to_page(ptr); in kasan_kmalloc_large() 542 redzone_start = round_up((unsigned long)(ptr + size), in kasan_kmalloc_large() 544 redzone_end = (unsigned long)ptr + page_size(page); in kasan_kmalloc_large() [all …]
|
D | init.c | 86 void *ptr = memblock_alloc_try_nid(size, size, __pa(MAX_DMA_ADDRESS), in early_alloc() local 89 if (!ptr) in early_alloc() 93 return ptr; in early_alloc()
|