projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c75288a
)
kasan: call kasan_malloc() from __kmalloc_*track_caller()
author
Peter Collingbourne
<pcc@google.com>
Wed, 14 Sep 2022 02:00:01 +0000
(19:00 -0700)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Wed, 28 Sep 2022 09:11:44 +0000
(11:11 +0200)
commit
5373b8a09d6e037ee0587cb5d9fe4cc09077deeb
upstream.
We were failing to call kasan_malloc() from __kmalloc_*track_caller()
which was causing us to sometimes fail to produce KASAN error reports
for allocations made using e.g. devm_kcalloc(), as the KASAN poison was
not being initialized. Fix it.
Signed-off-by: Peter Collingbourne <pcc@google.com>
Cc: <stable@vger.kernel.org> # 5.15
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
mm/slub.c
patch
|
blob
|
history
diff --git
a/mm/slub.c
b/mm/slub.c
index 519bbbad7b2f6fef3bca6c42a8e3c38ad00a62f5..6ebaff4967555a7ea591c7217fd3f6e5c09e1789 100644
(file)
--- a/
mm/slub.c
+++ b/
mm/slub.c
@@
-4920,6
+4920,8
@@
void *__kmalloc_track_caller(size_t size, gfp_t gfpflags, unsigned long caller)
/* Honor the call site pointer we received. */
trace_kmalloc(caller, ret, size, s->size, gfpflags);
+ ret = kasan_kmalloc(s, ret, size, gfpflags);
+
return ret;
}
EXPORT_SYMBOL(__kmalloc_track_caller);
@@
-4951,6
+4953,8
@@
void *__kmalloc_node_track_caller(size_t size, gfp_t gfpflags,
/* Honor the call site pointer we received. */
trace_kmalloc_node(caller, ret, size, s->size, gfpflags, node);
+ ret = kasan_kmalloc(s, ret, size, gfpflags);
+
return ret;
}
EXPORT_SYMBOL(__kmalloc_node_track_caller);