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: <1431984439-15008-1-git-send-email-joro@8bytes.org>
Date:	Mon, 18 May 2015 23:27:19 +0200
From:	Joerg Roedel <joro@...tes.org>
To:	Tony Luck <tony.luck@...el.com>, Fenghua Yu <fenghua.yu@...el.com>
Cc:	linux-ia64@...r.kernel.org, linux-kernel@...r.kernel.org,
	Joerg Roedel <jroedel@...e.de>
Subject: [PATCH] ia64: Return -ENOMEM in ia64_mmap_check() error case

From: Joerg Roedel <jroedel@...e.de>

The value -ENOMEM is the expected return code for mmap when
the address range verification failes on a MAP_FIXED
request, as stated in the specification:

	[ENOMEM]
	    MAP_FIXED was specified, and the range
	    [addr,addr+len) exceeds that allowed for the
	    address space of a process;

The ia64_mmap_check() function is part of that verification
and should return -ENOMEM too.

Signed-off-by: Joerg Roedel <jroedel@...e.de>
---
 arch/ia64/kernel/sys_ia64.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/ia64/kernel/sys_ia64.c b/arch/ia64/kernel/sys_ia64.c
index 41e33f8..e927023 100644
--- a/arch/ia64/kernel/sys_ia64.c
+++ b/arch/ia64/kernel/sys_ia64.c
@@ -124,7 +124,7 @@ int ia64_mmap_check(unsigned long addr, unsigned long len,
 	 */
 	roff = REGION_OFFSET(addr);
 	if ((len > RGN_MAP_LIMIT) || (roff > (RGN_MAP_LIMIT - len)))
-		return -EINVAL;
+		return -ENOMEM;
 	return 0;
 }
 
-- 
1.8.4.5

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