Commit 28f063ab authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

zdtm: ipc_namespace: Bound min/max for mqueue/msg_max

Otherwise
 | 11:03:13.524: 19446: ERR: ipc_namespace.c:212: Can't write 0 into /proc/sys/fs/mqueue/msg_max (errno = 22 (Invalid argument))
 | 11:03:13.524: 19446: ERR: ipc_namespace.c:273: Failed to randomize ipc namespace tunables (errno = 22 (Invalid argument))
 | 11:03:13.524: 19446: ERR: ipc_namespace.c:336: Failed to randomize ipc ns before migration (errno = 22 (Invalid argument))
 | 11:03:13.527: 19445: ERR: test.c:298: Test exited with unexpectedly with code 1 (errno = 4 (Interrupted system call))

https://bugzilla.openvz.org/show_bug.cgi?id=2530Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Acked-by: 's avatarAndrew Vagin <avagin@parallels.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 50a20dfb
......@@ -265,7 +265,7 @@ static int rand_ipc_ns(void)
if (!ret)
ret = rand_ipc_sysctl("/proc/sys/fs/mqueue/queues_max", (((unsigned)lrand48()) % 1023) + 1);
if (!ret)
ret = rand_ipc_sysctl("/proc/sys/fs/mqueue/msg_max", (unsigned)lrand48() & (32768 * sizeof(void)/4 - 1));
ret = rand_ipc_sysctl("/proc/sys/fs/mqueue/msg_max", ((unsigned)lrand48() % 65536) + 1);
if (!ret)
ret = rand_ipc_sysctl("/proc/sys/fs/mqueue/msgsize_max", ((unsigned)lrand48() & (8192 * 128 - 1)) | 128);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment