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>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0703281636010.10857@sbz-30.cs.Helsinki.FI>
Date:	Wed, 28 Mar 2007 16:36:40 +0300 (EEST)
From:	Pekka J Enberg <penberg@...helsinki.fi>
To:	akpm@...ux-foundation.org
cc:	nickpiggin@...oo.com.au, linux-kernel@...r.kernel.org
Subject: [PATCH] revoke: break cow fixes

From: Pekka Enberg <penberg@...helsinki.fi>

As pointed out by Nick Piggin, __revoke_break_cow() only needs to do
down_read() and we must use vma_pages() for get_user_pages().

Cc: Nick Piggin <nickpiggin@...oo.com.au>
Signed-off-by: Pekka Enberg <penberg@...helsinki.fi>
---
 fs/revoke.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Index: uml-2.6/fs/revoke.c
===================================================================
--- uml-2.6.orig/fs/revoke.c	2007-03-28 12:25:29.000000000 +0300
+++ uml-2.6/fs/revoke.c	2007-03-28 12:54:49.000000000 +0300
@@ -184,7 +184,7 @@ static int __revoke_break_cow(struct tas
 	struct vm_area_struct *vma;
 	int err = 0;
 
-	down_write(&mm->mmap_sem);
+	down_read(&mm->mmap_sem);
 	for (vma = mm->mmap; vma != NULL; vma = vma->vm_next) {
 		int ret;
 
@@ -195,14 +195,13 @@ 	int err = 0;
 			continue;
 
 		ret = get_user_pages(tsk, tsk->mm, vma->vm_start,
-				     vma->vm_end-vma->vm_start, 1, 1, NULL,
-				     NULL);
+				     vma_pages(vma), 1, 1, NULL, NULL);
 		if (ret < 0) {
 			err = ret;
 			break;
 		}
 	}
-	up_write(&mm->mmap_sem);
+	up_read(&mm->mmap_sem);
 	return err;
 }
 
-
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