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: <20120925120852.GH14490@moon>
Date:	Tue, 25 Sep 2012 16:08:52 +0400
From:	Cyrill Gorcunov <gorcunov@...nvz.org>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	"Eric W. Biederman" <ebiederm@...ssion.com>,
	Mark Salter <msalter@...hat.com>,
	Kees Cook <keescook@...omium.org>,
	Pavel Emelyanov <xemul@...allels.com>
Subject: [PATCH] prctl: Use access_ok instead of TASK_SIZE in prctl_set_mm

Eric pointed that better to use access_ok instead
of TASK_SIZE for testing if address is allowed for
use.

Reported-by: "Eric W. Biederman" <ebiederm@...ssion.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@...nvz.org>
CC: Mark Salter <msalter@...hat.com>
CC: Kees Cook <keescook@...omium.org>
CC: Andrew Morton <akpm@...ux-foundation.org>
CC: Pavel Emelyanov <xemul@...allels.com>
---
 kernel/sys.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6.git/kernel/sys.c
===================================================================
--- linux-2.6.git.orig/kernel/sys.c
+++ linux-2.6.git/kernel/sys.c
@@ -1865,7 +1865,7 @@ static int prctl_set_mm(int opt, unsigne
 	if (opt == PR_SET_MM_EXE_FILE)
 		return prctl_set_mm_exe_file(mm, (unsigned int)addr);
 
-	if (addr >= TASK_SIZE || addr < mmap_min_addr)
+	if (!access_ok(VERIFY_READ, addr, sizeof(addr)) || addr < mmap_min_addr)
 		return -EINVAL;
 
 	error = -EINVAL;
--
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