idx
int64
func_before
string
Vulnerability Classification
string
vul
int64
func_after
string
patch
string
CWE ID
string
lines_before
string
lines_after
string
19,800
static u8 *check_bytes(u8 *start, unsigned int value, unsigned int bytes) { while (bytes) { if (*start != (u8)value) return start; start++; bytes--; } return NULL; }
DoS
0
static u8 *check_bytes(u8 *start, unsigned int value, unsigned int bytes) { while (bytes) { if (*start != (u8)value) return start; start++; bytes--; } return NULL; }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,801
static int check_bytes_and_report(struct kmem_cache *s, struct page *page, u8 *object, char *what, u8 *start, unsigned int value, unsigned int bytes) { u8 *fault; u8 *end; fault = check_bytes(start, value, bytes); if (!fault) return 1; end = start + bytes; while (end > fault && end[-1] == value) end--...
DoS
0
static int check_bytes_and_report(struct kmem_cache *s, struct page *page, u8 *object, char *what, u8 *start, unsigned int value, unsigned int bytes) { u8 *fault; u8 *end; fault = check_bytes(start, value, bytes); if (!fault) return 1; end = start + bytes; while (end > fault && end[-1] == value) end--...
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,802
static int check_object(struct kmem_cache *s, struct page *page, void *object, int active) { u8 *p = object; u8 *endobject = object + s->objsize; if (s->flags & SLAB_RED_ZONE) { unsigned int red = active ? SLUB_RED_ACTIVE : SLUB_RED_INACTIVE; if (!check_bytes_and_report(s, page, object, "Redzone", e...
DoS
0
static int check_object(struct kmem_cache *s, struct page *page, void *object, int active) { u8 *p = object; u8 *endobject = object + s->objsize; if (s->flags & SLAB_RED_ZONE) { unsigned int red = active ? SLUB_RED_ACTIVE : SLUB_RED_INACTIVE; if (!check_bytes_and_report(s, page, object, "Redzone", e...
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,803
static inline int check_object(struct kmem_cache *s, struct page *page, void *object, int active) { return 1; }
DoS
0
static inline int check_object(struct kmem_cache *s, struct page *page, void *object, int active) { return 1; }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,804
static int check_pad_bytes(struct kmem_cache *s, struct page *page, u8 *p) { unsigned long off = s->inuse; /* The end of info */ if (s->offset) /* Freepointer is placed after the object. */ off += sizeof(void *); if (s->flags & SLAB_STORE_USER) /* We also have user information there */ off += 2 * sizeof(st...
DoS
0
static int check_pad_bytes(struct kmem_cache *s, struct page *page, u8 *p) { unsigned long off = s->inuse; /* The end of info */ if (s->offset) /* Freepointer is placed after the object. */ off += sizeof(void *); if (s->flags & SLAB_STORE_USER) /* We also have user information there */ off += 2 * sizeof(st...
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,805
static int check_slab(struct kmem_cache *s, struct page *page) { int maxobj; VM_BUG_ON(!irqs_disabled()); if (!PageSlab(page)) { slab_err(s, page, "Not a valid slab page"); return 0; } maxobj = (PAGE_SIZE << compound_order(page)) / s->size; if (page->objects > maxobj) { slab_err(s, page, "objects %u > ma...
DoS
0
static int check_slab(struct kmem_cache *s, struct page *page) { int maxobj; VM_BUG_ON(!irqs_disabled()); if (!PageSlab(page)) { slab_err(s, page, "Not a valid slab page"); return 0; } maxobj = (PAGE_SIZE << compound_order(page)) / s->size; if (page->objects > maxobj) { slab_err(s, page, "objects %u > ma...
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,806
static inline int check_valid_pointer(struct kmem_cache *s, struct page *page, const void *object) { void *base; if (!object) return 1; base = page_address(page); if (object < base || object >= base + page->objects * s->size || (object - base) % s->size) { return 0; } return 1; }
DoS
0
static inline int check_valid_pointer(struct kmem_cache *s, struct page *page, const void *object) { void *base; if (!object) return 1; base = page_address(page); if (object < base || object >= base + page->objects * s->size || (object - base) % s->size) { return 0; } return 1; }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,807
static int count_free(struct page *page) { return page->objects - page->inuse; }
DoS
0
static int count_free(struct page *page) { return page->objects - page->inuse; }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,808
static int count_inuse(struct page *page) { return page->inuse; }
DoS
0
static int count_inuse(struct page *page) { return page->inuse; }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,809
static unsigned long count_partial(struct kmem_cache_node *n, int (*get_count)(struct page *)) { unsigned long flags; unsigned long x = 0; struct page *page; spin_lock_irqsave(&n->list_lock, flags); list_for_each_entry(page, &n->partial, lru) x += get_count(page); spin_unlock_irqrestore(&n->list_lock, fla...
DoS
0
static unsigned long count_partial(struct kmem_cache_node *n, int (*get_count)(struct page *)) { unsigned long flags; unsigned long x = 0; struct page *page; spin_lock_irqsave(&n->list_lock, flags); list_for_each_entry(page, &n->partial, lru) x += get_count(page); spin_unlock_irqrestore(&n->list_lock, fla...
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,810
static int count_total(struct page *page) { return page->objects; }
DoS
0
static int count_total(struct page *page) { return page->objects; }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,811
static ssize_t cpu_slabs_show(struct kmem_cache *s, char *buf) { return show_slab_objects(s, buf, SO_CPU); }
DoS
0
static ssize_t cpu_slabs_show(struct kmem_cache *s, char *buf) { return show_slab_objects(s, buf, SO_CPU); }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,812
static struct kmem_cache *create_kmalloc_cache(struct kmem_cache *s, const char *name, int size, gfp_t gfp_flags) { unsigned int flags = 0; if (gfp_flags & SLUB_DMA) flags = SLAB_CACHE_DMA; down_write(&slub_lock); if (!kmem_cache_open(s, gfp_flags, name, size, ARCH_KMALLOC_MINALIGN, flags, NULL)) go...
DoS
0
static struct kmem_cache *create_kmalloc_cache(struct kmem_cache *s, const char *name, int size, gfp_t gfp_flags) { unsigned int flags = 0; if (gfp_flags & SLUB_DMA) flags = SLAB_CACHE_DMA; down_write(&slub_lock); if (!kmem_cache_open(s, gfp_flags, name, size, ARCH_KMALLOC_MINALIGN, flags, NULL)) go...
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,813
static char *create_unique_id(struct kmem_cache *s) { char *name = kmalloc(ID_STR_LENGTH, GFP_KERNEL); char *p = name; BUG_ON(!name); *p++ = ':'; /* * First flags affecting slabcache operations. We will only * get here for aliasable slabs so we do not need to support * too many flags. The flags here must c...
DoS
0
static char *create_unique_id(struct kmem_cache *s) { char *name = kmalloc(ID_STR_LENGTH, GFP_KERNEL); char *p = name; BUG_ON(!name); *p++ = ':'; /* * First flags affecting slabcache operations. We will only * get here for aliasable slabs so we do not need to support * too many flags. The flags here must c...
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,814
static ssize_t ctor_show(struct kmem_cache *s, char *buf) { if (s->ctor) { int n = sprint_symbol(buf, (unsigned long)s->ctor); return n + sprintf(buf + n, "\n"); } return 0; }
DoS
0
static ssize_t ctor_show(struct kmem_cache *s, char *buf) { if (s->ctor) { int n = sprint_symbol(buf, (unsigned long)s->ctor); return n + sprintf(buf + n, "\n"); } return 0; }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,815
static void deactivate_slab(struct kmem_cache *s, struct kmem_cache_cpu *c) { struct page *page = c->page; int tail = 1; if (page->freelist) stat(c, DEACTIVATE_REMOTE_FREES); /* * Merge cpu freelist into slab freelist. Typically we get here * because both freelists are empty. So this is unlikely * to occur...
DoS
0
static void deactivate_slab(struct kmem_cache *s, struct kmem_cache_cpu *c) { struct page *page = c->page; int tail = 1; if (page->freelist) stat(c, DEACTIVATE_REMOTE_FREES); /* * Merge cpu freelist into slab freelist. Typically we get here * because both freelists are empty. So this is unlikely * to occur...
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,816
static inline void dec_slabs_node(struct kmem_cache *s, int node, int objects) { struct kmem_cache_node *n = get_node(s, node); atomic_long_dec(&n->nr_slabs); atomic_long_sub(objects, &n->total_objects); }
DoS
0
static inline void dec_slabs_node(struct kmem_cache *s, int node, int objects) { struct kmem_cache_node *n = get_node(s, node); atomic_long_dec(&n->nr_slabs); atomic_long_sub(objects, &n->total_objects); }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,817
static inline void dec_slabs_node(struct kmem_cache *s, int node, int objects) {}
DoS
0
static inline void dec_slabs_node(struct kmem_cache *s, int node, int objects) {}
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,818
static ssize_t destroy_by_rcu_show(struct kmem_cache *s, char *buf) { return sprintf(buf, "%d\n", !!(s->flags & SLAB_DESTROY_BY_RCU)); }
DoS
0
static ssize_t destroy_by_rcu_show(struct kmem_cache *s, char *buf) { return sprintf(buf, "%d\n", !!(s->flags & SLAB_DESTROY_BY_RCU)); }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,819
static void discard_slab(struct kmem_cache *s, struct page *page) { dec_slabs_node(s, page_to_nid(page), page->objects); free_slab(s, page); }
DoS
0
static void discard_slab(struct kmem_cache *s, struct page *page) { dec_slabs_node(s, page_to_nid(page), page->objects); free_slab(s, page); }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,820
static noinline struct kmem_cache *dma_kmalloc_cache(int index, gfp_t flags) { struct kmem_cache *s; char *text; size_t realsize; s = kmalloc_caches_dma[index]; if (s) return s; /* Dynamically create dma cache */ if (flags & __GFP_WAIT) down_write(&slub_lock); else { if (!down_write_trylock(&slub_lock))...
DoS
0
static noinline struct kmem_cache *dma_kmalloc_cache(int index, gfp_t flags) { struct kmem_cache *s; char *text; size_t realsize; s = kmalloc_caches_dma[index]; if (s) return s; /* Dynamically create dma cache */ if (flags & __GFP_WAIT) down_write(&slub_lock); else { if (!down_write_trylock(&slub_lock))...
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,821
static struct kmem_cache_node *early_kmem_cache_node_alloc(gfp_t gfpflags, int node) { struct page *page; struct kmem_cache_node *n; unsigned long flags; BUG_ON(kmalloc_caches->size < sizeof(struct kmem_cache_node)); page = new_slab(kmalloc_caches, gfpflags, node); BUG_ON(!page); if (page_to_nid(pag...
DoS
0
static struct kmem_cache_node *early_kmem_cache_node_alloc(gfp_t gfpflags, int node) { struct page *page; struct kmem_cache_node *n; unsigned long flags; BUG_ON(kmalloc_caches->size < sizeof(struct kmem_cache_node)); page = new_slab(kmalloc_caches, gfpflags, node); BUG_ON(!page); if (page_to_nid(pag...
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,822
static inline void flush_slab(struct kmem_cache *s, struct kmem_cache_cpu *c) { stat(c, CPUSLAB_FLUSH); slab_lock(c->page); deactivate_slab(s, c); }
DoS
0
static inline void flush_slab(struct kmem_cache *s, struct kmem_cache_cpu *c) { stat(c, CPUSLAB_FLUSH); slab_lock(c->page); deactivate_slab(s, c); }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,823
static ssize_t free_calls_show(struct kmem_cache *s, char *buf) { if (!(s->flags & SLAB_STORE_USER)) return -ENOSYS; return list_locations(s, buf, TRACK_FREE); }
DoS
0
static ssize_t free_calls_show(struct kmem_cache *s, char *buf) { if (!(s->flags & SLAB_STORE_USER)) return -ENOSYS; return list_locations(s, buf, TRACK_FREE); }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,824
static int free_debug_processing(struct kmem_cache *s, struct page *page, void *object, void *addr) { if (!check_slab(s, page)) goto fail; if (!check_valid_pointer(s, page, object)) { slab_err(s, page, "Invalid object pointer 0x%p", object); goto fail; } if (on_freelist(s, page, object)) { object_er...
DoS
0
static int free_debug_processing(struct kmem_cache *s, struct page *page, void *object, void *addr) { if (!check_slab(s, page)) goto fail; if (!check_valid_pointer(s, page, object)) { slab_err(s, page, "Invalid object pointer 0x%p", object); goto fail; } if (on_freelist(s, page, object)) { object_er...
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,825
static inline int free_debug_processing(struct kmem_cache *s, struct page *page, void *object, void *addr) { return 0; }
DoS
0
static inline int free_debug_processing(struct kmem_cache *s, struct page *page, void *object, void *addr) { return 0; }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,826
static void free_kmem_cache_cpu(struct kmem_cache_cpu *c, int cpu) { if (c < per_cpu(kmem_cache_cpu, cpu) || c > per_cpu(kmem_cache_cpu, cpu) + NR_KMEM_CACHE_CPU) { kfree(c); return; } c->freelist = (void *)per_cpu(kmem_cache_cpu_free, cpu); per_cpu(kmem_cache_cpu_free, cpu) = c; }
DoS
0
static void free_kmem_cache_cpu(struct kmem_cache_cpu *c, int cpu) { if (c < per_cpu(kmem_cache_cpu, cpu) || c > per_cpu(kmem_cache_cpu, cpu) + NR_KMEM_CACHE_CPU) { kfree(c); return; } c->freelist = (void *)per_cpu(kmem_cache_cpu_free, cpu); per_cpu(kmem_cache_cpu_free, cpu) = c; }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,827
static void free_kmem_cache_cpus(struct kmem_cache *s) { int cpu; for_each_online_cpu(cpu) { struct kmem_cache_cpu *c = get_cpu_slab(s, cpu); if (c) { s->cpu_slab[cpu] = NULL; free_kmem_cache_cpu(c, cpu); } } }
DoS
0
static void free_kmem_cache_cpus(struct kmem_cache *s) { int cpu; for_each_online_cpu(cpu) { struct kmem_cache_cpu *c = get_cpu_slab(s, cpu); if (c) { s->cpu_slab[cpu] = NULL; free_kmem_cache_cpu(c, cpu); } } }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,828
static void free_kmem_cache_nodes(struct kmem_cache *s) { int node; for_each_node_state(node, N_NORMAL_MEMORY) { struct kmem_cache_node *n = s->node[node]; if (n && n != &s->local_node) kmem_cache_free(kmalloc_caches, n); s->node[node] = NULL; } }
DoS
0
static void free_kmem_cache_nodes(struct kmem_cache *s) { int node; for_each_node_state(node, N_NORMAL_MEMORY) { struct kmem_cache_node *n = s->node[node]; if (n && n != &s->local_node) kmem_cache_free(kmalloc_caches, n); s->node[node] = NULL; } }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,829
static void free_kmem_cache_nodes(struct kmem_cache *s) { }
DoS
0
static void free_kmem_cache_nodes(struct kmem_cache *s) { }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,830
static void free_partial(struct kmem_cache *s, struct kmem_cache_node *n) { unsigned long flags; struct page *page, *h; spin_lock_irqsave(&n->list_lock, flags); list_for_each_entry_safe(page, h, &n->partial, lru) { if (!page->inuse) { list_del(&page->lru); discard_slab(s, page); n->nr_partial--; } els...
DoS
0
static void free_partial(struct kmem_cache *s, struct kmem_cache_node *n) { unsigned long flags; struct page *page, *h; spin_lock_irqsave(&n->list_lock, flags); list_for_each_entry_safe(page, h, &n->partial, lru) { if (!page->inuse) { list_del(&page->lru); discard_slab(s, page); n->nr_partial--; } els...
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,831
static void free_slab(struct kmem_cache *s, struct page *page) { if (unlikely(s->flags & SLAB_DESTROY_BY_RCU)) { /* * RCU free overloads the RCU head over the LRU */ struct rcu_head *head = (void *)&page->lru; call_rcu(head, rcu_free_slab); } else __free_slab(s, page); }
DoS
0
static void free_slab(struct kmem_cache *s, struct page *page) { if (unlikely(s->flags & SLAB_DESTROY_BY_RCU)) { /* * RCU free overloads the RCU head over the LRU */ struct rcu_head *head = (void *)&page->lru; call_rcu(head, rcu_free_slab); } else __free_slab(s, page); }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,832
static inline struct kmem_cache_cpu *get_cpu_slab(struct kmem_cache *s, int cpu) { #ifdef CONFIG_SMP return s->cpu_slab[cpu]; #else return &s->cpu_slab; #endif }
DoS
0
static inline struct kmem_cache_cpu *get_cpu_slab(struct kmem_cache *s, int cpu) { #ifdef CONFIG_SMP return s->cpu_slab[cpu]; #else return &s->cpu_slab; #endif }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,833
static inline void *get_freepointer(struct kmem_cache *s, void *object) { return *(void **)(object + s->offset); }
DoS
0
static inline void *get_freepointer(struct kmem_cache *s, void *object) { return *(void **)(object + s->offset); }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,834
static inline struct kmem_cache_node *get_node(struct kmem_cache *s, int node) { #ifdef CONFIG_NUMA return s->node[node]; #else return &s->local_node; #endif }
DoS
0
static inline struct kmem_cache_node *get_node(struct kmem_cache *s, int node) { #ifdef CONFIG_NUMA return s->node[node]; #else return &s->local_node; #endif }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,835
static struct page *get_object_page(const void *x) { struct page *page = virt_to_head_page(x); if (!PageSlab(page)) return NULL; return page; }
DoS
0
static struct page *get_object_page(const void *x) { struct page *page = virt_to_head_page(x); if (!PageSlab(page)) return NULL; return page; }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,836
static struct page *get_partial(struct kmem_cache *s, gfp_t flags, int node) { struct page *page; int searchnode = (node == -1) ? numa_node_id() : node; page = get_partial_node(get_node(s, searchnode)); if (page || (flags & __GFP_THISNODE)) return page; return get_any_partial(s, flags); }
DoS
0
static struct page *get_partial(struct kmem_cache *s, gfp_t flags, int node) { struct page *page; int searchnode = (node == -1) ? numa_node_id() : node; page = get_partial_node(get_node(s, searchnode)); if (page || (flags & __GFP_THISNODE)) return page; return get_any_partial(s, flags); }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,837
static struct page *get_partial_node(struct kmem_cache_node *n) { struct page *page; /* * Racy check. If we mistakenly see no partial slabs then we * just allocate an empty slab. If we mistakenly try to get a * partial slab and there is none available then get_partials() * will return NULL. */ if (!n || !...
DoS
0
static struct page *get_partial_node(struct kmem_cache_node *n) { struct page *page; /* * Racy check. If we mistakenly see no partial slabs then we * just allocate an empty slab. If we mistakenly try to get a * partial slab and there is none available then get_partials() * will return NULL. */ if (!n || !...
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,838
static struct kmem_cache *get_slab(size_t size, gfp_t flags) { int index; if (size <= 192) { if (!size) return ZERO_SIZE_PTR; index = size_index[(size - 1) / 8]; } else index = fls(size - 1); #ifdef CONFIG_ZONE_DMA if (unlikely((flags & SLUB_DMA))) return dma_kmalloc_cache(index, flags); #endif retu...
DoS
0
static struct kmem_cache *get_slab(size_t size, gfp_t flags) { int index; if (size <= 192) { if (!size) return ZERO_SIZE_PTR; index = size_index[(size - 1) / 8]; } else index = fls(size - 1); #ifdef CONFIG_ZONE_DMA if (unlikely((flags & SLUB_DMA))) return dma_kmalloc_cache(index, flags); #endif retu...
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,839
static struct track *get_track(struct kmem_cache *s, void *object, enum track_item alloc) { struct track *p; if (s->offset) p = object + s->offset + sizeof(void *); else p = object + s->inuse; return p + alloc; }
DoS
0
static struct track *get_track(struct kmem_cache *s, void *object, enum track_item alloc) { struct track *p; if (s->offset) p = object + s->offset + sizeof(void *); else p = object + s->inuse; return p + alloc; }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,840
static void __init init_alloc_cpu(void) { int cpu; for_each_online_cpu(cpu) init_alloc_cpu_cpu(cpu); }
DoS
0
static void __init init_alloc_cpu(void) { int cpu; for_each_online_cpu(cpu) init_alloc_cpu_cpu(cpu); }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,841
static void init_alloc_cpu_cpu(int cpu) { int i; if (cpu_isset(cpu, kmem_cach_cpu_free_init_once)) return; for (i = NR_KMEM_CACHE_CPU - 1; i >= 0; i--) free_kmem_cache_cpu(&per_cpu(kmem_cache_cpu, cpu)[i], cpu); cpu_set(cpu, kmem_cach_cpu_free_init_once); }
DoS
0
static void init_alloc_cpu_cpu(int cpu) { int i; if (cpu_isset(cpu, kmem_cach_cpu_free_init_once)) return; for (i = NR_KMEM_CACHE_CPU - 1; i >= 0; i--) free_kmem_cache_cpu(&per_cpu(kmem_cache_cpu, cpu)[i], cpu); cpu_set(cpu, kmem_cach_cpu_free_init_once); }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,842
static void init_kmem_cache_cpu(struct kmem_cache *s, struct kmem_cache_cpu *c) { c->page = NULL; c->freelist = NULL; c->node = 0; c->offset = s->offset / sizeof(void *); c->objsize = s->objsize; #ifdef CONFIG_SLUB_STATS memset(c->stat, 0, NR_SLUB_STAT_ITEMS * sizeof(unsigned)); #endif }
DoS
0
static void init_kmem_cache_cpu(struct kmem_cache *s, struct kmem_cache_cpu *c) { c->page = NULL; c->freelist = NULL; c->node = 0; c->offset = s->offset / sizeof(void *); c->objsize = s->objsize; #ifdef CONFIG_SLUB_STATS memset(c->stat, 0, NR_SLUB_STAT_ITEMS * sizeof(unsigned)); #endif }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,843
static int init_kmem_cache_nodes(struct kmem_cache *s, gfp_t gfpflags) { int node; int local_node; if (slab_state >= UP) local_node = page_to_nid(virt_to_page(s)); else local_node = 0; for_each_node_state(node, N_NORMAL_MEMORY) { struct kmem_cache_node *n; if (local_node == node) n = &s->local_node; ...
DoS
0
static int init_kmem_cache_nodes(struct kmem_cache *s, gfp_t gfpflags) { int node; int local_node; if (slab_state >= UP) local_node = page_to_nid(virt_to_page(s)); else local_node = 0; for_each_node_state(node, N_NORMAL_MEMORY) { struct kmem_cache_node *n; if (local_node == node) n = &s->local_node; ...
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,844
static int init_kmem_cache_nodes(struct kmem_cache *s, gfp_t gfpflags) { init_kmem_cache_node(&s->local_node); return 1; }
DoS
0
static int init_kmem_cache_nodes(struct kmem_cache *s, gfp_t gfpflags) { init_kmem_cache_node(&s->local_node); return 1; }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,845
static void init_object(struct kmem_cache *s, void *object, int active) { u8 *p = object; if (s->flags & __OBJECT_POISON) { memset(p, POISON_FREE, s->objsize - 1); p[s->objsize - 1] = POISON_END; } if (s->flags & SLAB_RED_ZONE) memset(p + s->objsize, active ? SLUB_RED_ACTIVE : SLUB_RED_INACTIVE, s->in...
DoS
0
static void init_object(struct kmem_cache *s, void *object, int active) { u8 *p = object; if (s->flags & __OBJECT_POISON) { memset(p, POISON_FREE, s->objsize - 1); p[s->objsize - 1] = POISON_END; } if (s->flags & SLAB_RED_ZONE) memset(p + s->objsize, active ? SLUB_RED_ACTIVE : SLUB_RED_INACTIVE, s->in...
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,846
static void init_tracking(struct kmem_cache *s, void *object) { if (!(s->flags & SLAB_STORE_USER)) return; set_track(s, object, TRACK_FREE, NULL); set_track(s, object, TRACK_ALLOC, NULL); }
DoS
0
static void init_tracking(struct kmem_cache *s, void *object) { if (!(s->flags & SLAB_STORE_USER)) return; set_track(s, object, TRACK_FREE, NULL); set_track(s, object, TRACK_ALLOC, NULL); }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,847
void kfree(const void *x) { struct page *page; void *object = (void *)x; if (unlikely(ZERO_OR_NULL_PTR(x))) return; page = virt_to_head_page(x); if (unlikely(!PageSlab(page))) { put_page(page); return; } slab_free(page->slab, page, object, __builtin_return_address(0)); }
DoS
0
void kfree(const void *x) { struct page *page; void *object = (void *)x; if (unlikely(ZERO_OR_NULL_PTR(x))) return; page = virt_to_head_page(x); if (unlikely(!PageSlab(page))) { put_page(page); return; } slab_free(page->slab, page, object, __builtin_return_address(0)); }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,848
static void *kmalloc_large_node(size_t size, gfp_t flags, int node) { struct page *page = alloc_pages_node(node, flags | __GFP_COMP, get_order(size)); if (page) return page_address(page); else return NULL; }
DoS
0
static void *kmalloc_large_node(size_t size, gfp_t flags, int node) { struct page *page = alloc_pages_node(node, flags | __GFP_COMP, get_order(size)); if (page) return page_address(page); else return NULL; }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,849
void *kmem_cache_alloc(struct kmem_cache *s, gfp_t gfpflags) { return slab_alloc(s, gfpflags, -1, __builtin_return_address(0)); }
DoS
0
void *kmem_cache_alloc(struct kmem_cache *s, gfp_t gfpflags) { return slab_alloc(s, gfpflags, -1, __builtin_return_address(0)); }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,850
static inline int kmem_cache_close(struct kmem_cache *s) { int node; flush_all(s); /* Attempt to free all objects */ free_kmem_cache_cpus(s); for_each_node_state(node, N_NORMAL_MEMORY) { struct kmem_cache_node *n = get_node(s, node); free_partial(s, n); if (n->nr_partial || slabs_node(s, node)) return ...
DoS
0
static inline int kmem_cache_close(struct kmem_cache *s) { int node; flush_all(s); /* Attempt to free all objects */ free_kmem_cache_cpus(s); for_each_node_state(node, N_NORMAL_MEMORY) { struct kmem_cache_node *n = get_node(s, node); free_partial(s, n); if (n->nr_partial || slabs_node(s, node)) return ...
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,851
struct kmem_cache *kmem_cache_create(const char *name, size_t size, size_t align, unsigned long flags, void (*ctor)(struct kmem_cache *, void *)) { struct kmem_cache *s; down_write(&slub_lock); s = find_mergeable(size, align, flags, name, ctor); if (s) { int cpu; s->refcount++; /* * Adjust the object...
DoS
0
struct kmem_cache *kmem_cache_create(const char *name, size_t size, size_t align, unsigned long flags, void (*ctor)(struct kmem_cache *, void *)) { struct kmem_cache *s; down_write(&slub_lock); s = find_mergeable(size, align, flags, name, ctor); if (s) { int cpu; s->refcount++; /* * Adjust the object...
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,852
void kmem_cache_destroy(struct kmem_cache *s) { down_write(&slub_lock); s->refcount--; if (!s->refcount) { list_del(&s->list); up_write(&slub_lock); if (kmem_cache_close(s)) { printk(KERN_ERR "SLUB %s: %s called for cache that " "still has objects.\n", s->name, __func__); dump_stack(); } sysfs_sl...
DoS
0
void kmem_cache_destroy(struct kmem_cache *s) { down_write(&slub_lock); s->refcount--; if (!s->refcount) { list_del(&s->list); up_write(&slub_lock); if (kmem_cache_close(s)) { printk(KERN_ERR "SLUB %s: %s called for cache that " "still has objects.\n", s->name, __func__); dump_stack(); } sysfs_sl...
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,853
static unsigned long kmem_cache_flags(unsigned long objsize, unsigned long flags, const char *name, void (*ctor)(struct kmem_cache *, void *)) { /* * Enable debugging if selected on the kernel commandline. */ if (slub_debug && (!slub_debug_slabs || strncmp(slub_debug_slabs, name, strlen(slub_debug_slabs)) ...
DoS
0
static unsigned long kmem_cache_flags(unsigned long objsize, unsigned long flags, const char *name, void (*ctor)(struct kmem_cache *, void *)) { /* * Enable debugging if selected on the kernel commandline. */ if (slub_debug && (!slub_debug_slabs || strncmp(slub_debug_slabs, name, strlen(slub_debug_slabs)) ...
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,854
void kmem_cache_free(struct kmem_cache *s, void *x) { struct page *page; page = virt_to_head_page(x); slab_free(s, page, x, __builtin_return_address(0)); }
DoS
0
void kmem_cache_free(struct kmem_cache *s, void *x) { struct page *page; page = virt_to_head_page(x); slab_free(s, page, x, __builtin_return_address(0)); }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,855
const char *kmem_cache_name(struct kmem_cache *s) { return s->name; }
DoS
0
const char *kmem_cache_name(struct kmem_cache *s) { return s->name; }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,856
static int kmem_cache_open(struct kmem_cache *s, gfp_t gfpflags, const char *name, size_t size, size_t align, unsigned long flags, void (*ctor)(struct kmem_cache *, void *)) { memset(s, 0, kmem_size); s->name = name; s->ctor = ctor; s->objsize = size; s->align = align; s->flags = kmem_cache_flags(size, flag...
DoS
0
static int kmem_cache_open(struct kmem_cache *s, gfp_t gfpflags, const char *name, size_t size, size_t align, unsigned long flags, void (*ctor)(struct kmem_cache *, void *)) { memset(s, 0, kmem_size); s->name = name; s->ctor = ctor; s->objsize = size; s->align = align; s->flags = kmem_cache_flags(size, flag...
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,857
static void kmem_cache_release(struct kobject *kobj) { struct kmem_cache *s = to_slab(kobj); kfree(s); }
DoS
0
static void kmem_cache_release(struct kobject *kobj) { struct kmem_cache *s = to_slab(kobj); kfree(s); }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,858
unsigned int kmem_cache_size(struct kmem_cache *s) { return s->objsize; }
DoS
0
unsigned int kmem_cache_size(struct kmem_cache *s) { return s->objsize; }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,859
int kmem_ptr_validate(struct kmem_cache *s, const void *object) { struct page *page; page = get_object_page(object); if (!page || s != page->slab) /* No slab or wrong slab */ return 0; if (!check_valid_pointer(s, page, object)) return 0; /* * We could also check if the object is on the slabs freelist. ...
DoS
0
int kmem_ptr_validate(struct kmem_cache *s, const void *object) { struct page *page; page = get_object_page(object); if (!page || s != page->slab) /* No slab or wrong slab */ return 0; if (!check_valid_pointer(s, page, object)) return 0; /* * We could also check if the object is on the slabs freelist. ...
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,860
size_t ksize(const void *object) { struct page *page; struct kmem_cache *s; if (unlikely(object == ZERO_SIZE_PTR)) return 0; page = virt_to_head_page(object); if (unlikely(!PageSlab(page))) return PAGE_SIZE << compound_order(page); s = page->slab; #ifdef CONFIG_SLUB_DEBUG /* * Debugging requires use o...
DoS
0
size_t ksize(const void *object) { struct page *page; struct kmem_cache *s; if (unlikely(object == ZERO_SIZE_PTR)) return 0; page = virt_to_head_page(object); if (unlikely(!PageSlab(page))) return PAGE_SIZE << compound_order(page); s = page->slab; #ifdef CONFIG_SLUB_DEBUG /* * Debugging requires use o...
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,861
static void list_slab_objects(struct kmem_cache *s, struct page *page, const char *text) { #ifdef CONFIG_SLUB_DEBUG void *addr = page_address(page); void *p; DECLARE_BITMAP(map, page->objects); bitmap_zero(map, page->objects); slab_err(s, page, "%s", text); slab_lock(page); for_each_free_object(p, s, pag...
DoS
0
static void list_slab_objects(struct kmem_cache *s, struct page *page, const char *text) { #ifdef CONFIG_SLUB_DEBUG void *addr = page_address(page); void *p; DECLARE_BITMAP(map, page->objects); bitmap_zero(map, page->objects); slab_err(s, page, "%s", text); slab_lock(page); for_each_free_object(p, s, pag...
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,862
static inline int lock_and_freeze_slab(struct kmem_cache_node *n, struct page *page) { if (slab_trylock(page)) { list_del(&page->lru); n->nr_partial--; SetSlabFrozen(page); return 1; } return 0; }
DoS
0
static inline int lock_and_freeze_slab(struct kmem_cache_node *n, struct page *page) { if (slab_trylock(page)) { list_del(&page->lru); n->nr_partial--; SetSlabFrozen(page); return 1; } return 0; }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,863
static struct page *new_slab(struct kmem_cache *s, gfp_t flags, int node) { struct page *page; void *start; void *last; void *p; BUG_ON(flags & GFP_SLAB_BUG_MASK); page = allocate_slab(s, flags & (GFP_RECLAIM_MASK | GFP_CONSTRAINT_MASK), node); if (!page) goto out; inc_slabs_node(s, page_to_nid(page), pa...
DoS
0
static struct page *new_slab(struct kmem_cache *s, gfp_t flags, int node) { struct page *page; void *start; void *last; void *p; BUG_ON(flags & GFP_SLAB_BUG_MASK); page = allocate_slab(s, flags & (GFP_RECLAIM_MASK | GFP_CONSTRAINT_MASK), node); if (!page) goto out; inc_slabs_node(s, page_to_nid(page), pa...
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,864
static inline int node_match(struct kmem_cache_cpu *c, int node) { #ifdef CONFIG_NUMA if (node != -1 && c->node != node) return 0; #endif return 1; }
DoS
0
static inline int node_match(struct kmem_cache_cpu *c, int node) { #ifdef CONFIG_NUMA if (node != -1 && c->node != node) return 0; #endif return 1; }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,865
static void object_err(struct kmem_cache *s, struct page *page, u8 *object, char *reason) { slab_bug(s, "%s", reason); print_trailer(s, page, object); }
DoS
0
static void object_err(struct kmem_cache *s, struct page *page, u8 *object, char *reason) { slab_bug(s, "%s", reason); print_trailer(s, page, object); }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,866
static ssize_t object_size_show(struct kmem_cache *s, char *buf) { return sprintf(buf, "%d\n", s->objsize); }
DoS
0
static ssize_t object_size_show(struct kmem_cache *s, char *buf) { return sprintf(buf, "%d\n", s->objsize); }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,867
static ssize_t objects_partial_show(struct kmem_cache *s, char *buf) { return show_slab_objects(s, buf, SO_PARTIAL|SO_OBJECTS); }
DoS
0
static ssize_t objects_partial_show(struct kmem_cache *s, char *buf) { return show_slab_objects(s, buf, SO_PARTIAL|SO_OBJECTS); }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,868
static ssize_t objects_show(struct kmem_cache *s, char *buf) { return show_slab_objects(s, buf, SO_ALL|SO_OBJECTS); }
DoS
0
static ssize_t objects_show(struct kmem_cache *s, char *buf) { return show_slab_objects(s, buf, SO_ALL|SO_OBJECTS); }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,869
static ssize_t objs_per_slab_show(struct kmem_cache *s, char *buf) { return sprintf(buf, "%d\n", oo_objects(s->oo)); }
DoS
0
static ssize_t objs_per_slab_show(struct kmem_cache *s, char *buf) { return sprintf(buf, "%d\n", oo_objects(s->oo)); }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,870
static int on_freelist(struct kmem_cache *s, struct page *page, void *search) { int nr = 0; void *fp = page->freelist; void *object = NULL; unsigned long max_objects; while (fp && nr <= page->objects) { if (fp == search) return 1; if (!check_valid_pointer(s, page, fp)) { if (object) { object_err(s, ...
DoS
0
static int on_freelist(struct kmem_cache *s, struct page *page, void *search) { int nr = 0; void *fp = page->freelist; void *object = NULL; unsigned long max_objects; while (fp && nr <= page->objects) { if (fp == search) return 1; if (!check_valid_pointer(s, page, fp)) { if (object) { object_err(s, ...
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,871
static inline struct kmem_cache_order_objects oo_make(int order, unsigned long size) { struct kmem_cache_order_objects x = { (order << 16) + (PAGE_SIZE << order) / size }; return x; }
DoS
0
static inline struct kmem_cache_order_objects oo_make(int order, unsigned long size) { struct kmem_cache_order_objects x = { (order << 16) + (PAGE_SIZE << order) / size }; return x; }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,872
static inline int oo_objects(struct kmem_cache_order_objects x) { return x.x & ((1 << 16) - 1); }
DoS
0
static inline int oo_objects(struct kmem_cache_order_objects x) { return x.x & ((1 << 16) - 1); }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,873
static inline int oo_order(struct kmem_cache_order_objects x) { return x.x >> 16; }
DoS
0
static inline int oo_order(struct kmem_cache_order_objects x) { return x.x >> 16; }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,874
static ssize_t order_show(struct kmem_cache *s, char *buf) { return sprintf(buf, "%d\n", oo_order(s->oo)); }
DoS
0
static ssize_t order_show(struct kmem_cache *s, char *buf) { return sprintf(buf, "%d\n", oo_order(s->oo)); }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,875
static ssize_t order_store(struct kmem_cache *s, const char *buf, size_t length) { int order = simple_strtoul(buf, NULL, 10); if (order > slub_max_order || order < slub_min_order) return -EINVAL; calculate_sizes(s, order); return length; }
DoS
0
static ssize_t order_store(struct kmem_cache *s, const char *buf, size_t length) { int order = simple_strtoul(buf, NULL, 10); if (order > slub_max_order || order < slub_min_order) return -EINVAL; calculate_sizes(s, order); return length; }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,876
static ssize_t partial_show(struct kmem_cache *s, char *buf) { return show_slab_objects(s, buf, SO_PARTIAL); }
DoS
0
static ssize_t partial_show(struct kmem_cache *s, char *buf) { return show_slab_objects(s, buf, SO_PARTIAL); }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,877
static ssize_t poison_show(struct kmem_cache *s, char *buf) { return sprintf(buf, "%d\n", !!(s->flags & SLAB_POISON)); }
DoS
0
static ssize_t poison_show(struct kmem_cache *s, char *buf) { return sprintf(buf, "%d\n", !!(s->flags & SLAB_POISON)); }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,878
static ssize_t poison_store(struct kmem_cache *s, const char *buf, size_t length) { if (any_slab_objects(s)) return -EBUSY; s->flags &= ~SLAB_POISON; if (buf[0] == '1') s->flags |= SLAB_POISON; calculate_sizes(s, -1); return length; }
DoS
0
static ssize_t poison_store(struct kmem_cache *s, const char *buf, size_t length) { if (any_slab_objects(s)) return -EBUSY; s->flags &= ~SLAB_POISON; if (buf[0] == '1') s->flags |= SLAB_POISON; calculate_sizes(s, -1); return length; }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,879
static void print_page_info(struct page *page) { printk(KERN_ERR "INFO: Slab 0x%p objects=%u used=%u fp=0x%p flags=0x%04lx\n", page, page->objects, page->inuse, page->freelist, page->flags); }
DoS
0
static void print_page_info(struct page *page) { printk(KERN_ERR "INFO: Slab 0x%p objects=%u used=%u fp=0x%p flags=0x%04lx\n", page, page->objects, page->inuse, page->freelist, page->flags); }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,880
static void print_slabinfo_header(struct seq_file *m) { seq_puts(m, "slabinfo - version: 2.1\n"); seq_puts(m, "# name <active_objs> <num_objs> <objsize> " "<objperslab> <pagesperslab>"); seq_puts(m, " : tunables <limit> <batchcount> <sharedfactor>"); seq_puts(m, " : slabdata <active_slabs> <num_slabs>...
DoS
0
static void print_slabinfo_header(struct seq_file *m) { seq_puts(m, "slabinfo - version: 2.1\n"); seq_puts(m, "# name <active_objs> <num_objs> <objsize> " "<objperslab> <pagesperslab>"); seq_puts(m, " : tunables <limit> <batchcount> <sharedfactor>"); seq_puts(m, " : slabdata <active_slabs> <num_slabs>...
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,881
static void print_track(const char *s, struct track *t) { if (!t->addr) return; printk(KERN_ERR "INFO: %s in ", s); __print_symbol("%s", (unsigned long)t->addr); printk(" age=%lu cpu=%u pid=%d\n", jiffies - t->when, t->cpu, t->pid); }
DoS
0
static void print_track(const char *s, struct track *t) { if (!t->addr) return; printk(KERN_ERR "INFO: %s in ", s); __print_symbol("%s", (unsigned long)t->addr); printk(" age=%lu cpu=%u pid=%d\n", jiffies - t->when, t->cpu, t->pid); }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,882
static void print_tracking(struct kmem_cache *s, void *object) { if (!(s->flags & SLAB_STORE_USER)) return; print_track("Allocated", get_track(s, object, TRACK_ALLOC)); print_track("Freed", get_track(s, object, TRACK_FREE)); }
DoS
0
static void print_tracking(struct kmem_cache *s, void *object) { if (!(s->flags & SLAB_STORE_USER)) return; print_track("Allocated", get_track(s, object, TRACK_ALLOC)); print_track("Freed", get_track(s, object, TRACK_FREE)); }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,883
static void print_trailer(struct kmem_cache *s, struct page *page, u8 *p) { unsigned int off; /* Offset of last byte */ u8 *addr = page_address(page); print_tracking(s, p); print_page_info(page); printk(KERN_ERR "INFO: Object 0x%p @offset=%tu fp=0x%p\n\n", p, p - addr, get_freepointer(s, p)); if (p > addr ...
DoS
0
static void print_trailer(struct kmem_cache *s, struct page *page, u8 *p) { unsigned int off; /* Offset of last byte */ u8 *addr = page_address(page); print_tracking(s, p); print_page_info(page); printk(KERN_ERR "INFO: Object 0x%p @offset=%tu fp=0x%p\n\n", p, p - addr, get_freepointer(s, p)); if (p > addr ...
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,884
static void process_slab(struct loc_track *t, struct kmem_cache *s, struct page *page, enum track_item alloc) { void *addr = page_address(page); DECLARE_BITMAP(map, page->objects); void *p; bitmap_zero(map, page->objects); for_each_free_object(p, s, page->freelist) set_bit(slab_index(p, s, addr), map); for_...
DoS
0
static void process_slab(struct loc_track *t, struct kmem_cache *s, struct page *page, enum track_item alloc) { void *addr = page_address(page); DECLARE_BITMAP(map, page->objects); void *p; bitmap_zero(map, page->objects); for_each_free_object(p, s, page->freelist) set_bit(slab_index(p, s, addr), map); for_...
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,885
static void rcu_free_slab(struct rcu_head *h) { struct page *page; page = container_of((struct list_head *)h, struct page, lru); __free_slab(page->slab, page); }
DoS
0
static void rcu_free_slab(struct rcu_head *h) { struct page *page; page = container_of((struct list_head *)h, struct page, lru); __free_slab(page->slab, page); }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,886
static ssize_t reclaim_account_show(struct kmem_cache *s, char *buf) { return sprintf(buf, "%d\n", !!(s->flags & SLAB_RECLAIM_ACCOUNT)); }
DoS
0
static ssize_t reclaim_account_show(struct kmem_cache *s, char *buf) { return sprintf(buf, "%d\n", !!(s->flags & SLAB_RECLAIM_ACCOUNT)); }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,887
static ssize_t reclaim_account_store(struct kmem_cache *s, const char *buf, size_t length) { s->flags &= ~SLAB_RECLAIM_ACCOUNT; if (buf[0] == '1') s->flags |= SLAB_RECLAIM_ACCOUNT; return length; }
DoS
0
static ssize_t reclaim_account_store(struct kmem_cache *s, const char *buf, size_t length) { s->flags &= ~SLAB_RECLAIM_ACCOUNT; if (buf[0] == '1') s->flags |= SLAB_RECLAIM_ACCOUNT; return length; }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,888
static ssize_t red_zone_show(struct kmem_cache *s, char *buf) { return sprintf(buf, "%d\n", !!(s->flags & SLAB_RED_ZONE)); }
DoS
0
static ssize_t red_zone_show(struct kmem_cache *s, char *buf) { return sprintf(buf, "%d\n", !!(s->flags & SLAB_RED_ZONE)); }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,889
static ssize_t remote_node_defrag_ratio_show(struct kmem_cache *s, char *buf) { return sprintf(buf, "%d\n", s->remote_node_defrag_ratio / 10); }
DoS
0
static ssize_t remote_node_defrag_ratio_show(struct kmem_cache *s, char *buf) { return sprintf(buf, "%d\n", s->remote_node_defrag_ratio / 10); }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,890
static ssize_t remote_node_defrag_ratio_store(struct kmem_cache *s, const char *buf, size_t length) { int n = simple_strtoul(buf, NULL, 10); if (n < 100) s->remote_node_defrag_ratio = n * 10; return length; }
DoS
0
static ssize_t remote_node_defrag_ratio_store(struct kmem_cache *s, const char *buf, size_t length) { int n = simple_strtoul(buf, NULL, 10); if (n < 100) s->remote_node_defrag_ratio = n * 10; return length; }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,891
static void remove_full(struct kmem_cache *s, struct page *page) { struct kmem_cache_node *n; if (!(s->flags & SLAB_STORE_USER)) return; n = get_node(s, page_to_nid(page)); spin_lock(&n->list_lock); list_del(&page->lru); spin_unlock(&n->list_lock); }
DoS
0
static void remove_full(struct kmem_cache *s, struct page *page) { struct kmem_cache_node *n; if (!(s->flags & SLAB_STORE_USER)) return; n = get_node(s, page_to_nid(page)); spin_lock(&n->list_lock); list_del(&page->lru); spin_unlock(&n->list_lock); }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,892
static void remove_partial(struct kmem_cache *s, struct page *page) { struct kmem_cache_node *n = get_node(s, page_to_nid(page)); spin_lock(&n->list_lock); list_del(&page->lru); n->nr_partial--; spin_unlock(&n->list_lock); }
DoS
0
static void remove_partial(struct kmem_cache *s, struct page *page) { struct kmem_cache_node *n = get_node(s, page_to_nid(page)); spin_lock(&n->list_lock); list_del(&page->lru); n->nr_partial--; spin_unlock(&n->list_lock); }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,893
static void resiliency_test(void) { u8 *p; printk(KERN_ERR "SLUB resiliency testing\n"); printk(KERN_ERR "-----------------------\n"); printk(KERN_ERR "A. Corruption after allocation\n"); p = kzalloc(16, GFP_KERNEL); p[16] = 0x12; printk(KERN_ERR "\n1. kmalloc-16: Clobber Redzone/next pointer" " 0x12->0x%p\...
DoS
0
static void resiliency_test(void) { u8 *p; printk(KERN_ERR "SLUB resiliency testing\n"); printk(KERN_ERR "-----------------------\n"); printk(KERN_ERR "A. Corruption after allocation\n"); p = kzalloc(16, GFP_KERNEL); p[16] = 0x12; printk(KERN_ERR "\n1. kmalloc-16: Clobber Redzone/next pointer" " 0x12->0x%p\...
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,894
static void resiliency_test(void) {};
DoS
0
static void resiliency_test(void) {};
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,895
static void restore_bytes(struct kmem_cache *s, char *message, u8 data, void *from, void *to) { slab_fix(s, "Restoring 0x%p-0x%p=0x%x\n", from, to - 1, data); memset(from, data, to - from); }
DoS
0
static void restore_bytes(struct kmem_cache *s, char *message, u8 data, void *from, void *to) { slab_fix(s, "Restoring 0x%p-0x%p=0x%x\n", from, to - 1, data); memset(from, data, to - from); }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,896
static void *s_next(struct seq_file *m, void *p, loff_t *pos) { return seq_list_next(p, &slab_caches, pos); }
DoS
0
static void *s_next(struct seq_file *m, void *p, loff_t *pos) { return seq_list_next(p, &slab_caches, pos); }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,897
static int s_show(struct seq_file *m, void *p) { unsigned long nr_partials = 0; unsigned long nr_slabs = 0; unsigned long nr_inuse = 0; unsigned long nr_objs = 0; unsigned long nr_free = 0; struct kmem_cache *s; int node; s = list_entry(p, struct kmem_cache, list); for_each_online_node(node) { struct kmem_...
DoS
0
static int s_show(struct seq_file *m, void *p) { unsigned long nr_partials = 0; unsigned long nr_slabs = 0; unsigned long nr_inuse = 0; unsigned long nr_objs = 0; unsigned long nr_free = 0; struct kmem_cache *s; int node; s = list_entry(p, struct kmem_cache, list); for_each_online_node(node) { struct kmem_...
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,898
static void *s_start(struct seq_file *m, loff_t *pos) { loff_t n = *pos; down_read(&slub_lock); if (!n) print_slabinfo_header(m); return seq_list_start(&slab_caches, *pos); }
DoS
0
static void *s_start(struct seq_file *m, loff_t *pos) { loff_t n = *pos; down_read(&slub_lock); if (!n) print_slabinfo_header(m); return seq_list_start(&slab_caches, *pos); }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null
19,899
static void s_stop(struct seq_file *m, void *p) { up_read(&slub_lock); }
DoS
0
static void s_stop(struct seq_file *m, void *p) { up_read(&slub_lock); }
@@ -22,6 +22,7 @@ #include <linux/debugobjects.h> #include <linux/kallsyms.h> #include <linux/memory.h> +#include <linux/math64.h> /* * Lock order: @@ -3621,12 +3622,10 @@ static int list_locations(struct kmem_cache *s, char *buf, len += sprintf(buf + len, "<not-available>"); if (l->sum_time != l->min_...
CWE-189
null
null