lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <1240862795.29485.64.camel@nimitz>
Date:	Mon, 27 Apr 2009 13:06:35 -0700
From:	Dave Hansen <dave@...ux.vnet.ibm.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	ebmunson@...ibm.com, kosaki.motohiro@...fujitsu.com,
	linux-mm@...ck.org, linux-kernel@...r.kernel.org, mel@....ul.ie,
	cl@...ux-foundation.org
Subject: Re: [PATCH] Display 0 in meminfo for Committed_AS when value
	underflows

On Mon, 2009-04-27 at 12:52 -0700, Andrew Morton wrote:
> On Mon, 27 Apr 2009 09:15:14 -0700
> Dave Hansen <dave@...ux.vnet.ibm.com> wrote:
> > On Mon, 2009-04-27 at 17:10 +0100, Eric B Munson wrote:
> > > Splitting this patch from the chunk that addresses the cause of the underflow
> > > because the solution still requires some discussion.
> > > 
> > > Dave Hansen reported that under certain cirumstances the Committed_AS value
> > > can underflow which causes extremely large numbers to be displayed in
> > > meminfo.  This patch adds an underflow check to meminfo_proc_show() for the
> > > Committed_AS value.  Most fields in /proc/meminfo already have an underflow
> > > check, this brings Committed_AS into line.
> > 
> > Yeah, this is the right fix for now until we can iron out the base
> > issues.  Eric, I think this may also be a candidate for -stable.
> > 
> > Signed-off-by: Dave Hansen <dave@...ux.vnet.ibm.com>
> 
> I cannot find Eric's original patch anywhere.  Did some demented MTA munch it?

Here's the version that I got.  My guess would be that your copy is
sitting in some IBM mail server's queue right now.  It might show up in
a couple of days. :)

---

Andrew,

Please merge the following patch.

Splitting this patch from the chunk that addresses the cause of the underflow
because the solution still requires some discussion.

Dave Hansen reported that under certain cirumstances the Committed_AS value
can underflow which causes extremely large numbers to be displayed in
meminfo.  This patch adds an underflow check to meminfo_proc_show() for the
Committed_AS value.  Most fields in /proc/meminfo already have an underflow
check, this brings Committed_AS into line.

Reported-by: Dave Hansen <dave@...ux.vnet.ibm.com>
From: KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
Signed-off-by: Eric B Munson <ebmunson@...ibm.com>
---
 fs/proc/meminfo.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c
index 74ea974..facb9fb 100644
--- a/fs/proc/meminfo.c
+++ b/fs/proc/meminfo.c
@@ -22,7 +22,7 @@ void __attribute__((weak)) arch_report_meminfo(struct seq_file *m)
 static int meminfo_proc_show(struct seq_file *m, void *v)
 {
 	struct sysinfo i;
-	unsigned long committed;
+	long committed;
 	unsigned long allowed;
 	struct vmalloc_info vmi;
 	long cached;
@@ -36,6 +36,8 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
 	si_meminfo(&i);
 	si_swapinfo(&i);
 	committed = atomic_long_read(&vm_committed_space);
+	if (committed < 0)
+		committed = 0;
 	allowed = ((totalram_pages - hugetlb_total_pages())
 		* sysctl_overcommit_ratio / 100) + total_swap_pages;

-- 
1.6.1.2


-- Dave

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ