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]
Date:	Tue, 22 Dec 2009 16:33:19 -0800
From:	"Smith, GeoffX" <geoffx.smith@...el.com>
To:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC:	"andi@...stfloor.org" <andi@...stfloor.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Michael Stone <michael@...top.org>
Subject: [PATCH] prctl: return MCE process flags through pointer

This patch fixes the semantics of prctl() option PR_MCE_KILL_GET 
to pass the return value through *arg2.

With this change, the option now follows the same conventions as the
other "get" options added since 2.6.0, and also brings it into
conformance with the advice in chapter 16 of Documentation/CodingStyle.

This prctl() option was only added within the last month, so there are
not any production applications to break.  This patch applies cleanly
to mainline and to 2.6.32.2 for backporting.

Signed-off-by:  Geoff Smith <geoffx.smith@...el.com>


diff --git a/kernel/sys.c b/kernel/sys.c
index 26a6b73..347021a 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -1570,13 +1570,16 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
 			error = 0;
 			break;
 		case PR_MCE_KILL_GET:
-			if (arg2 | arg3 | arg4 | arg5)
+			if (arg3 | arg4 | arg5)
 				return -EINVAL;
 			if (current->flags & PF_MCE_PROCESS)
-				error = (current->flags & PF_MCE_EARLY) ?
-					PR_MCE_KILL_EARLY : PR_MCE_KILL_LATE;
+				error = put_user(
+					(current->flags & PF_MCE_EARLY) ?
+					PR_MCE_KILL_EARLY : PR_MCE_KILL_LATE,
+					(unsigned long __user *)arg2);
 			else
-				error = PR_MCE_KILL_DEFAULT;
+				error = put_user(PR_MCE_KILL_DEFAULT,
+					(unsigned long __user *)arg2);
 			break;
 		default:
 			error = -EINVAL;
 				return -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