[CentOS-devel] system call msgrcv() freom 32-bit application shows error: msgrcv: No message of desired type

Fri Apr 25 11:12:01 UTC 2014
Gabriella Schmidt <gsc at bruker.de>

The latest RHEL7 still shows the error   msgrcv: No message of desired type
if msgrcv() is called with negative arguments within 32-bit applications.
It is in Red Hat Bugzilla – Bug 1042807 but as we dont have RHN Support
anymore we cant take a ticket there.
I have tested the kernel-lt-3.10.37-1.el6.elrepo.x86_64 and kernel-ml-3.14.1-1.el6.elrepo.x86_64
on CentOS-6 and the 3.10.37 still show the problem, while its fixed in 3.14

The fix is very small ( see attachment ), but I dont know what is the
best way to get it fixed in the 3.10 kernels too.

-- 
Kind Regards

    Gabriella Schmidt
    -- NMR Software --
    Bruker BioSpin GmbH
-------------- next part --------------
diff --git a/ipc/compat.c b/ipc/compat.c
index 892f658..4d184dc 100644
--- a/ipc/compat.c
+++ b/ipc/compat.c
@@ -381,7 +381,7 @@ COMPAT_SYSCALL_DEFINE6(ipc, u32, call, int, first, int, second,
 			uptr = compat_ptr(ipck.msgp);
 			fifth = ipck.msgtyp;
 		}
-		return do_msgrcv(first, uptr, second, fifth, third,
+		return do_msgrcv(first, uptr, second, (int)fifth, third,
 				 compat_do_msg_fill);
 	}
 	case MSGGET: