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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120409175412.8358.59542.stgit@localhost6.localdomain6>
Date:	Mon, 09 Apr 2012 21:54:12 +0400
From:	Stanislav Kinsbursky <skinsbursky@...allels.com>
To:	akpm@...ux-foundation.org
Cc:	serge.hallyn@...onical.com, dhowells@...hat.com, arnd@...db.de,
	lucas.demarchi@...fusion.mobi, linux-kernel@...r.kernel.org,
	criu@...nvz.org, mtk.manpages@...il.com
Subject: [PATCH 3/4] ipc: handle MSG_PEEK_ALL flag if
 CONFIG_CHECKPOINT_RESTORE is dropped

Return -ENOSYS, if user called sys_msgrcv() with MSG_PEEK_ALL flag set and
checkpoint/restore code wasn't compiled.

---
 ipc/compat.c |    5 ++++-
 ipc/msg.c    |    4 ++++
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/ipc/compat.c b/ipc/compat.c
index bb9350d..0163aa1 100644
--- a/ipc/compat.c
+++ b/ipc/compat.c
@@ -377,7 +377,10 @@ long compat_sys_msgrcv(int first, int second, int msgtyp, int third,
 		return -EINVAL;
 	if (second < 0)
 		return -EINVAL;
-
+#ifndef CONFIG_CHECKPOINT_RESTORE
+	if (third & MSG_PEEK_ALL)
+		return -ENOSYS;
+#endif
 	if (!version) {
 		struct compat_ipc_kludge ipck;
 		if (!uptr)
diff --git a/ipc/msg.c b/ipc/msg.c
index 8d63cc7..9d8f249 100644
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -819,6 +819,10 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp,
 
 	if (msqid < 0 || (long) bufsz < 0)
 		return -EINVAL;
+#ifndef CONFIG_CHECKPOINT_RESTORE
+	if (msgflg & MSG_PEEK_ALL)
+		return -ENOSYS;
+#endif
 	mode = convert_mode(&msgtyp, msgflg);
 	ns = current->nsproxy->ipc_ns;
 

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