Skip to contentSkip to conversation

IA-32 support patch: msgsnd/msgrcv return value off by 4

PATCH Applied Arun Sharma 2 participants 2 messages Jun 24, 2003 – Jun 30, 2003

lore
Share & tools
lore
#0 lore raw

The return value of do_sys32_msgsnd() is off by 4. This seems to be a bug inherited from sparc64, fixed in the x86_64 tree in 2.5.

Please apply to both 2.4 and 2.5 trees.

-Arun

arch/ia64/ia32/sys_ia32.c renamed from arch/ia64/ia32/sys_ia32.c- +3 -3
@@ -2262,7 +2262,7 @@
 static int
 do_sys32_msgsnd (int first, int second, int third, void *uptr)
 {
-	struct msgbuf *p = kmalloc(second + sizeof(struct msgbuf) + 4, GFP_USER);
+	struct msgbuf *p = kmalloc(second + sizeof(struct msgbuf), GFP_USER);
 	struct msgbuf32 *up = (struct msgbuf32 *)uptr;
 	mm_segment_t old_fs;
 	int err;
@@ -2304,12 +2304,12 @@
 		msgtyp = ipck.msgtyp;
 	}
 	err = -ENOMEM;
-	p = kmalloc(second + sizeof(struct msgbuf) + 4, GFP_USER);
+	p = kmalloc(second + sizeof(struct msgbuf), GFP_USER);
 	if (!p)
 		goto out;
 	old_fs = get_fs();
 	set_fs(KERNEL_DS);
-	err = sys_msgrcv(first, p, second + 4, msgtyp, third);
+	err = sys_msgrcv(first, p, second, msgtyp, third);
 	set_fs(old_fs);
 	if (err < 0)
 		goto free_then_out;
#1 lore raw
Quoted 4 lines · Arun Sharma

The return value of do_sys32_msgsnd() is off by 4. This seems to be a bug inherited from sparc64, fixed in the x86_64 tree in 2.5.

Please apply to both 2.4 and 2.5 trees.

Applied to 2.4 (and David put it in 2.5 as well).