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-next>] [day] [month] [year] [list]
Message-Id: <1231345823-27376-1-git-send-email-cooloney@kernel.org>
Date:	Thu,  8 Jan 2009 00:30:23 +0800
From:	Bryan Wu <cooloney@...nel.org>
To:	dhowells@...hat.com
Cc:	linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
	Graf Yang <graf.yang@...log.com>,
	Bryan Wu <cooloney@...nel.org>
Subject: [PATCH 1/1] ramfs/nommu: fix bug - kernel crash when (nr != lpages)

From: Graf Yang <graf.yang@...log.com>

Avoiding kernel crash when (nr != lpages), and return -ENOMEM,
let the user space application handle this error.

Signed-off-by: Graf Yang <graf.yang@...log.com>
Signed-off-by: Bryan Wu <cooloney@...nel.org>
---
 fs/ramfs/file-nommu.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/fs/ramfs/file-nommu.c b/fs/ramfs/file-nommu.c
index 76acdbc..9311031 100644
--- a/fs/ramfs/file-nommu.c
+++ b/fs/ramfs/file-nommu.c
@@ -283,7 +283,8 @@ unsigned long ramfs_nommu_get_unmapped_area(struct file *file,
 	if (pages) {
 		ptr = pages;
 		for (loop = lpages; loop > 0; loop--)
-			put_page(*ptr++);
+			if (*ptr)
+				put_page(*ptr++);
 		kfree(pages);
 	}
 
-- 
1.5.6

--
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