Commit 0fe9a44
mm, page_owner: decouple freeing stack trace from debug_pagealloc
Commit 8974558 ("mm, page_owner, debug_pagealloc: save and dump
freeing stack trace") enhanced page_owner to also store freeing stack
trace, when debug_pagealloc is also enabled. KASAN would also like to
do this [1] to improve error reports to debug e.g. UAF issues.
Kirill has suggested that the freeing stack trace saving should be also
possible to be enabled separately from KASAN or debug_pagealloc, i.e.
with an extra boot option. Qian argued that we have enough options
already, and avoiding the extra overhead is not worth the complications
in the case of a debugging option. Kirill noted that the extra stack
handle in struct page_owner requires 0.1% of memory.
This patch therefore enables free stack saving whenever page_owner is
enabled, regardless of whether debug_pagealloc or KASAN is also enabled.
KASAN kernels booted with page_owner=on will thus benefit from the
improved error reports.
[1] https://bugzilla.kernel.org/show_bug.cgi?id=203967
[vbabka@suse.cz: v3]
Link: http://lkml.kernel.org/r/20191007091808.7096-3-vbabka@suse.cz
Link: http://lkml.kernel.org/r/20190930122916.14969-3-vbabka@suse.cz
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Reviewed-by: Qian Cai <cai@lca.pw>
Suggested-by: Dmitry Vyukov <dvyukov@google.com>
Suggested-by: Walter Wu <walter-zh.wu@mediatek.com>
Suggested-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Suggested-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Suggested-by: Qian Cai <cai@lca.pw>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>1 parent 5556cfe commit 0fe9a44
2 files changed
+10
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
44 | 47 | | |
45 | 48 | | |
46 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | 27 | | |
29 | | - | |
30 | 28 | | |
31 | 29 | | |
32 | | - | |
| 30 | + | |
33 | 31 | | |
34 | 32 | | |
35 | 33 | | |
| |||
44 | 42 | | |
45 | 43 | | |
46 | 44 | | |
47 | | - | |
| 45 | + | |
48 | 46 | | |
49 | 47 | | |
50 | 48 | | |
51 | 49 | | |
52 | 50 | | |
53 | 51 | | |
54 | 52 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
| 53 | + | |
59 | 54 | | |
60 | 55 | | |
61 | 56 | | |
| |||
84 | 79 | | |
85 | 80 | | |
86 | 81 | | |
87 | | - | |
| 82 | + | |
88 | 83 | | |
89 | 84 | | |
90 | 85 | | |
| |||
148 | 143 | | |
149 | 144 | | |
150 | 145 | | |
151 | | - | |
152 | 146 | | |
153 | 147 | | |
154 | 148 | | |
155 | | - | |
156 | | - | |
157 | | - | |
| 149 | + | |
158 | 150 | | |
159 | 151 | | |
160 | 152 | | |
161 | 153 | | |
162 | 154 | | |
163 | 155 | | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
| 156 | + | |
| 157 | + | |
170 | 158 | | |
171 | 159 | | |
172 | 160 | | |
| |||
450 | 438 | | |
451 | 439 | | |
452 | 440 | | |
453 | | - | |
454 | 441 | | |
455 | 442 | | |
456 | 443 | | |
| |||
459 | 446 | | |
460 | 447 | | |
461 | 448 | | |
462 | | - | |
463 | 449 | | |
464 | 450 | | |
465 | 451 | | |
| |||
0 commit comments