[lkml]   [2019]   [Dec]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 3.16 121/136] mm, vmstat: hide /proc/pagetypeinfo from normal users
3.16.80-rc1 review patch.  If anyone has any objections, please let me know.


From: Michal Hocko <>

commit abaed0112c1db08be15a784a2c5c8a8b3063cdd3 upstream.

/proc/pagetypeinfo is a debugging tool to examine internal page
allocator state wrt to fragmentation. It is not very useful for any
other use so normal users really do not need to read this file.

Waiman Long has noticed that reading this file can have negative side
effects because zone->lock is necessary for gathering data and that a)
interferes with the page allocator and its users and b) can lead to hard
lockups on large machines which have very long free_list.

Reduce both issues by simply not exporting the file to regular users.

Fixes: 467c996c1e19 ("Print out statistics in relation to fragmentation avoidance to /proc/pagetypeinfo")
Signed-off-by: Michal Hocko <>
Reported-by: Waiman Long <>
Acked-by: Mel Gorman <>
Acked-by: Vlastimil Babka <>
Acked-by: Waiman Long <>
Acked-by: Rafael Aquini <>
Acked-by: David Rientjes <>
Reviewed-by: Andrew Morton <>
Cc: David Hildenbrand <>
Cc: Johannes Weiner <>
Cc: Roman Gushchin <>
Cc: Konstantin Khlebnikov <>
Cc: Jann Horn <>
Cc: Song Liu <>
Cc: Greg Kroah-Hartman <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings <>
mm/vmstat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -1318,7 +1318,7 @@ static int __init setup_vmstat(void)
proc_create("buddyinfo", S_IRUGO, NULL, &fragmentation_file_operations);
- proc_create("pagetypeinfo", S_IRUGO, NULL, &pagetypeinfo_file_ops);
+ proc_create("pagetypeinfo", 0400, NULL, &pagetypeinfo_file_ops);
proc_create("vmstat", S_IRUGO, NULL, &proc_vmstat_file_operations);
proc_create("zoneinfo", S_IRUGO, NULL, &proc_zoneinfo_file_operations);
 \ /
  Last update: 2019-12-17 01:53    [W:0.307 / U:6.396 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site