diff -ur linux-2.4.21/drivers/audit/syscall.c smp/drivers/audit/syscall.c --- linux-2.4.21/drivers/audit/syscall.c 2003-10-09 10:43:09.000000000 +0200 +++ smp/drivers/audit/syscall.c 2003-10-17 15:21:22.000000000 +0200 @@ -325,8 +325,8 @@ f(semop, T_int, T_array(struct sembuf, 2, SEMOPM), T_int), f(semctl, T_int, T_int, T_pointer(struct shmid_ds)), f(msgget, T_int, T_int), -f(msgsnd, T_int, T_opaque_t(2), T_size_t, T_int), -f(msgrcv, T_int, T_opaque_t(2), T_size_t, T_long, T_int), +f(msgsnd, T_int, T_pointer(struct msgbuf), T_size_t, T_int), +f(msgrcv, T_int, T_pointer(struct msgbuf), T_size_t, T_long, T_int), f(msgctl, T_int, T_int, T_pointer(struct msqid_ds)), #endif @@ -467,8 +467,8 @@ [SEMOP] = sc(3, T_int, T_array(struct sembuf, 2, SEMOPM), T_int), [SEMGET] = sc(3, T_int, T_int, T_int), [SEMCTL] = sc(4, T_int, T_int, T_int, T_any_ptr), -[MSGSND] = sc(4, T_int, T_opaque_t(2), T_size_t, T_int), -[MSGRCV] = sc(5, T_int, T_opaque_t(2), T_size_t, T_long, T_int), +[MSGSND] = sc(4, T_int, T_pointer(struct msgbuf), T_size_t, T_int), +[MSGRCV] = sc(5, T_int, T_pointer(struct msgbuf), T_size_t, T_long, T_int), [MSGGET] = sc(2, T_int, T_int), [MSGCTL] = sc(3, T_int, T_int, T_pointer(struct msqid_ds)), [SHMGET] = sc(3, T_int, T_int, T_int), @@ -499,17 +499,30 @@ /* Very special cases */ if (minor == MSGRCV && version == 0) { - /* backward compat, TBD */ - return 0; + struct ipc_kludge tmp, *arg; + + /* This is _so_ broken */ + arg = (struct ipc_kludge *)(unsigned long) sc->raw_args[4]; + if (copy_from_user(&tmp, arg, sizeof(tmp))) + memset(&tmp, 0, sizeof(tmp)); + sc->raw_args[4] = (unsigned long) tmp.msgp; + sc->raw_args[5] = tmp.msgtyp; } else if (minor == SHMAT && version == 1) { - /* iBCS2 emulator, TBD */ - return 0; - } else { - reorder = ipc_reorder[minor]; - while (nargs < AUDIT_MAXARGS && reorder[nargs]) { - args[nargs] = sc->raw_args[reorder[nargs]]; - nargs++; - } + /* iBCS2 emulator, called from kernel space only; + * the difference between ver 0 and ver 1 + * is that in ver 1, the 3rd argument is in + * kernel space. But as that is an output only + * argument, we're not concerned. */ + } + + /* Reorder sys_ipc arguments to match system call + * signature. We should really do this sort of + * crap in user space. + */ + reorder = ipc_reorder[minor]; + while (nargs < AUDIT_MAXARGS && reorder[nargs]) { + args[nargs] = sc->raw_args[reorder[nargs]]; + nargs++; } for (n = 0; n < nargs; n++)