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]
Date:	Wed, 24 Oct 2012 01:59:07 +0400
From:	Cyrill Gorcunov <gorcunov@...nvz.org>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Pavel Emelyanov <xemul@...allels.com>,
	LKML <linux-kernel@...r.kernel.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>
Subject: Re: [rfc 0/2] Introducing VmFlags field into smaps output

On Wed, Oct 24, 2012 at 01:46:39AM +0400, Cyrill Gorcunov wrote:
> 
> > Also...  what happens if there's an unrecognised bit set in `flags'? 
> > Memory corruption or code skew could cause this.  We emit a couple of
> > NULs into the procfs output, which I guess is an OK response to such a
> > condition.
> 
> That's indeed will produce some nil character on the screen. I guess we
> need some designited init here, say
> 
> 	[0 ... (BITS_PER_LONG-1)] = { {'-', '-'} },
> 	...
> 	[ilog2(VM_READ)]	= { {'r', 'd'} },
> 	...
> 	and so on, i'll update on top
> 

Andrew, could you please fold it on top of your
procfs-add-vmflags-field-in-smaps-output-v3-fix ?

(If this is inconvenient -- just give me a word and I'll
 squash everything in one new patch instead).
---
From: Cyrill Gorcunov <gorcunov@...nvz.org>
Subject: procfs-add-vmflags-field-in-smaps-output-v3-fix-on-top

Use designated init to assign "??" mnemonic on unknown flags.

Signed-off-by: Cyrill Gorcunov <gorcunov@...nvz.org>
Cc: Pavel Emelyanov <xemul@...allels.com>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Andrew Morton <akpm@...ux-foundation.org>
---
 fs/proc/task_mmu.c |    5 +++++
 1 file changed, 5 insertions(+)

Index: linux-2.6.git/fs/proc/task_mmu.c
===================================================================
--- linux-2.6.git.orig/fs/proc/task_mmu.c
+++ linux-2.6.git/fs/proc/task_mmu.c
@@ -488,6 +488,11 @@ static void show_smap_vma_flags(struct s
 	static const struct {
 		const char l[2];
 	} mnemonics[BITS_PER_LONG] = {
+		/*
+		 * In case if we meet a flag we don't know about.
+		 */
+		[0 ... (BITS_PER_LONG-1)] = { {'?', '?'} },
+
 		[ilog2(VM_READ)]	= { {'r', 'd'} },
 		[ilog2(VM_WRITE)]	= { {'w', 'r'} },
 		[ilog2(VM_EXEC)]	= { {'e', 'x'} },
--
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