From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 764F4C17441 for ; Mon, 11 Nov 2019 18:35:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5046A2173B for ; Mon, 11 Nov 2019 18:35:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573497333; bh=WdSQ5vWXEyP8ro0z4UkL//M/o1Kxc67vm1QhRJiAKvk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=YZiqSMjivgDEJ1/oqVEnkyEKz7ltwrKaK1pdHz0cg+kVLgfmw5GiZs//0TUj9layH hnlWc2EZtVr7he/YFDfuCBb2MQLbFL+NRVFLBpGbi92oY7WyywGtuNrXkkvDpXRYfX IYGQhm8s9eK92EtwlDuI6aAopb8M5Bip8MTM3gH8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727945AbfKKSfb (ORCPT ); Mon, 11 Nov 2019 13:35:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:53414 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728535AbfKKSfb (ORCPT ); Mon, 11 Nov 2019 13:35:31 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 330B520656; Mon, 11 Nov 2019 18:35:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573497329; bh=WdSQ5vWXEyP8ro0z4UkL//M/o1Kxc67vm1QhRJiAKvk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k9h1jiQNwBd/2ssE8kZWquTIXHkzhQ/wHxYE7zSLw28jIMwID3mOYyot52PgRpSke e9GLW4UGuYBm1BQsVDRGd1P3c+EICz1BGFXqGOWSya3V+8vJlG7oXQkyXxJOmuPLaH 58sYuHt0rGLuE2D/X3Y/XMRYNYmZIfjuKu20YC58= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michal Hocko , Waiman Long , Mel Gorman , Vlastimil Babka , Rafael Aquini , David Rientjes , Andrew Morton , David Hildenbrand , Johannes Weiner , Roman Gushchin , Konstantin Khlebnikov , Jann Horn , Song Liu , Linus Torvalds Subject: [PATCH 4.14 017/105] mm, vmstat: hide /proc/pagetypeinfo from normal users Date: Mon, 11 Nov 2019 19:27:47 +0100 Message-Id: <20191111181432.592761389@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191111181421.390326245@linuxfoundation.org> References: <20191111181421.390326245@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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. Link: http://lkml.kernel.org/r/20191025072610.18526-2-mhocko@kernel.org 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 Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- mm/vmstat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -1951,7 +1951,7 @@ void __init init_mm_internals(void) #endif #ifdef CONFIG_PROC_FS proc_create("buddyinfo", 0444, NULL, &buddyinfo_file_operations); - proc_create("pagetypeinfo", 0444, NULL, &pagetypeinfo_file_operations); + proc_create("pagetypeinfo", 0400, NULL, &pagetypeinfo_file_operations); proc_create("vmstat", 0444, NULL, &vmstat_file_operations); proc_create("zoneinfo", 0444, NULL, &zoneinfo_file_operations); #endif