Skip to content

Commit 86fea8b

Browse files
Jing Xiatorvalds
authored andcommitted
mm/mm_init.c: report kasan-tag information stored in page->flags
The pageflags_layout_usage shows incorrect message by means of mminit_loglevel when Kasan runs in the mode of software tag-based enabled with CONFIG_KASAN_SW_TAGS. This patch corrects it and reports kasan-tag information. Signed-off-by: Jing Xia <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Cc: Chunyan Zhang <[email protected]> Cc: Orson Zhai <[email protected]> Cc: Andrey Ryabinin <[email protected]> Cc: Alexander Potapenko <[email protected]> Cc: Dmitry Vyukov <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
1 parent 9380ce2 commit 86fea8b

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

mm/mm_init.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,26 +67,30 @@ void __init mminit_verify_pageflags_layout(void)
6767
unsigned long or_mask, add_mask;
6868

6969
shift = 8 * sizeof(unsigned long);
70-
width = shift - SECTIONS_WIDTH - NODES_WIDTH - ZONES_WIDTH - LAST_CPUPID_SHIFT;
70+
width = shift - SECTIONS_WIDTH - NODES_WIDTH - ZONES_WIDTH
71+
- LAST_CPUPID_SHIFT - KASAN_TAG_WIDTH;
7172
mminit_dprintk(MMINIT_TRACE, "pageflags_layout_widths",
72-
"Section %d Node %d Zone %d Lastcpupid %d Flags %d\n",
73+
"Section %d Node %d Zone %d Lastcpupid %d Kasantag %d Flags %d\n",
7374
SECTIONS_WIDTH,
7475
NODES_WIDTH,
7576
ZONES_WIDTH,
7677
LAST_CPUPID_WIDTH,
78+
KASAN_TAG_WIDTH,
7779
NR_PAGEFLAGS);
7880
mminit_dprintk(MMINIT_TRACE, "pageflags_layout_shifts",
79-
"Section %d Node %d Zone %d Lastcpupid %d\n",
81+
"Section %d Node %d Zone %d Lastcpupid %d Kasantag %d\n",
8082
SECTIONS_SHIFT,
8183
NODES_SHIFT,
8284
ZONES_SHIFT,
83-
LAST_CPUPID_SHIFT);
85+
LAST_CPUPID_SHIFT,
86+
KASAN_TAG_WIDTH);
8487
mminit_dprintk(MMINIT_TRACE, "pageflags_layout_pgshifts",
85-
"Section %lu Node %lu Zone %lu Lastcpupid %lu\n",
88+
"Section %lu Node %lu Zone %lu Lastcpupid %lu Kasantag %lu\n",
8689
(unsigned long)SECTIONS_PGSHIFT,
8790
(unsigned long)NODES_PGSHIFT,
8891
(unsigned long)ZONES_PGSHIFT,
89-
(unsigned long)LAST_CPUPID_PGSHIFT);
92+
(unsigned long)LAST_CPUPID_PGSHIFT,
93+
(unsigned long)KASAN_TAG_PGSHIFT);
9094
mminit_dprintk(MMINIT_TRACE, "pageflags_layout_nodezoneid",
9195
"Node/Zone ID: %lu -> %lu\n",
9296
(unsigned long)(ZONEID_PGOFF + ZONEID_SHIFT),

0 commit comments

Comments
 (0)