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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20091114044153.GB2416@hack>
Date:	Sat, 14 Nov 2009 12:41:53 +0800
From:	Américo Wang <xiyou.wangcong@...il.com>
To:	steve@...idescorp.com
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] procfs: Use proper units for noMMU statm

On Fri, Nov 13, 2009 at 07:52:14PM -0600, steve@...idescorp.com wrote:
>On no-MMU systems, sizes reported in /proc/n/statm have units of bytes. 
>Per Documentation/filesystems/proc.txt, these values should be in pages.
>
>Signed-off-by: Steven J. Magnani <steve@...idescorp.com>
>---
>diff -uprN a/fs/proc/task_nommu.c b/fs/proc/task_nommu.c
>--- a/fs/proc/task_nommu.c	2009-11-13 16:48:14.000000000 -0600
>+++ b/fs/proc/task_nommu.c	2009-11-13 16:51:09.000000000 -0600
>@@ -110,8 +110,11 @@ int task_statm(struct mm_struct *mm, int
> 		}
> 	}
> 
>-	size += (*text = mm->end_code - mm->start_code);
>-	size += (*data = mm->start_stack - mm->start_data);
>+	size >>= PAGE_SHIFT;
>+	*text = (PAGE_ALIGN(mm->end_code) - (mm->start_code & PAGE_MASK))
>+		>> PAGE_SHIFT;
>+	*data = (mm->start_stack - mm->start_data) >> PAGE_SHIFT;

Are '->start_stack' and '->start_data' already page aligned on NOMMU arch?

If yes, this patch looks good.


>+	size += *text + *data;
> 	up_read(&mm->mmap_sem);
> 	*resident = size;
> 	return size;
>
>--
>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/

-- 
Live like a child, think like the god.
 
--
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