diff --git a/sys/kern/sysv_msg.c b/sys/kern/sysv_msg.c --- a/sys/kern/sysv_msg.c +++ b/sys/kern/sysv_msg.c @@ -1438,7 +1438,8 @@ } mtx_unlock(&msq_mtx); #ifdef COMPAT_FREEBSD32 - if (SV_CURPROC_FLAG(SV_ILP32)) { + if (SV_CURPROC_FLAG(SV_ILP32) && + SV_CURPROC_ABI() == SV_ABI_FREEBSD) { bzero(&tmsqk32, sizeof(tmsqk32)); freebsd32_ipcperm_out(&tmsqk.u.msg_perm, &tmsqk32.u.msg_perm); diff --git a/sys/kern/sysv_sem.c b/sys/kern/sysv_sem.c --- a/sys/kern/sysv_sem.c +++ b/sys/kern/sysv_sem.c @@ -1547,7 +1547,8 @@ } mtx_unlock(&sema_mtx[i]); #ifdef COMPAT_FREEBSD32 - if (SV_CURPROC_FLAG(SV_ILP32)) { + if (SV_CURPROC_FLAG(SV_ILP32) && + SV_CURPROC_ABI() == SV_ABI_FREEBSD) { bzero(&tsemak32, sizeof(tsemak32)); freebsd32_ipcperm_out(&tsemak.u.sem_perm, &tsemak32.u.sem_perm); diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c --- a/sys/kern/sysv_shm.c +++ b/sys/kern/sysv_shm.c @@ -1062,7 +1062,8 @@ tshmseg.u.shm_perm.key = IPC_PRIVATE; } #ifdef COMPAT_FREEBSD32 - if (SV_CURPROC_FLAG(SV_ILP32)) { + if (SV_CURPROC_FLAG(SV_ILP32) && + SV_CURPROC_ABI() == SV_ABI_FREEBSD) { bzero(&tshmseg32, sizeof(tshmseg32)); freebsd32_ipcperm_out(&tshmseg.u.shm_perm, &tshmseg32.u.shm_perm);