lkml.org 
[lkml]   [2012]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 3/4] ipc: handle MSG_PEEK_ALL flag if CONFIG_CHECKPOINT_RESTORE is dropped
From
Date
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;



\
 
 \ /
  Last update: 2012-04-09 19:57    [W:0.063 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site