From owner-freebsd-amd64@FreeBSD.ORG Fri Sep 16 21:00:32 2005 Return-Path: X-Original-To: freebsd-amd64@hub.freebsd.org Delivered-To: freebsd-amd64@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0B63116A41F for ; Fri, 16 Sep 2005 21:00:32 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4DF2043D58 for ; Fri, 16 Sep 2005 21:00:30 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j8GL0Uj9071420 for ; Fri, 16 Sep 2005 21:00:30 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j8GL0TnE071419; Fri, 16 Sep 2005 21:00:30 GMT (envelope-from gnats) Resent-Date: Fri, 16 Sep 2005 21:00:30 GMT Resent-Message-Id: <200509162100.j8GL0TnE071419@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-amd64@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Phil Regnauld Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 741E516A41F for ; Fri, 16 Sep 2005 20:57:36 +0000 (GMT) (envelope-from regnauld@catpipe.net) Received: from moof.catpipe.net (moof.catpipe.net [195.249.214.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id EBB7E43D60 for ; Fri, 16 Sep 2005 20:57:27 +0000 (GMT) (envelope-from regnauld@catpipe.net) Received: from localhost (localhost [127.0.0.1]) by localhost.catpipe.net (Postfix) with ESMTP id 3D89F1B3CA for ; Fri, 16 Sep 2005 22:57:26 +0200 (CEST) Received: from moof.catpipe.net ([127.0.0.1]) by localhost (moof.catpipe.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 42009-01 for ; Fri, 16 Sep 2005 22:57:21 +0200 (CEST) Received: from vinyl.catpipe.net (vinyl.catpipe.net [195.249.214.189]) by moof.catpipe.net (Postfix) with ESMTP id AACE11B3AF for ; Fri, 16 Sep 2005 22:57:15 +0200 (CEST) Received: by vinyl.catpipe.net (Postfix, from userid 1006) id AB5B339827; Fri, 16 Sep 2005 22:53:34 +0200 (CEST) Message-Id: <20050916205334.AB5B339827@vinyl.catpipe.net> Date: Fri, 16 Sep 2005 22:53:34 +0200 (CEST) From: Phil Regnauld To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: amd64/86229: Missing recvmsg syscall in freebsd32 API causes sshd crash on amd64 X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Phil Regnauld List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2005 21:00:32 -0000 >Number: 86229 >Category: amd64 >Synopsis: Missing recvmsg syscall in freebsd32 API causes sshd crash on amd64 >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-amd64 >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Sep 16 21:00:29 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Phil Regnauld >Release: FreeBSD 5.4-STABLE amd64 >Organization: catpipe Systems ApS >Environment: System: FreeBSD j2 5.4-STABLE FreeBSD 5.4-STABLE #0: Thu Sep 15 21:21:01 CEST 2005 admin@j2:/usr/obj/usr/src/sys/JAIL amd64 >Description: recvmsg(2) is not implemented in the freebsd32 compatibility layer. >From /sys/compat/freebsd32/syscalls.master: ; XXX implement 27 AUE_NULL UNIMPL recvmsg This is a problem when trying to run, among others sshd from i386/4-STABLE or 5-STABLE (for example in a jail): if privilege separation (the default) is used, then recvmsg is called by the child after the fork. The missing syscall causes a termination of sshd with SIGSYS (12): 14143 sshd CALL recvmsg 14143 sshd RET recvmsg -1 errno 78 Function not implemented [...] 14143 sshd PSIG SIGSYS SIG_DFL This is a problem as both i386 and amd64 are Tier 1 platforms, and the non availability of recvmsg() can be a problem for many applications. >How-To-Repeat: Compile the following statically on 5.x/i386 or 4.x/i386 system and execute on an amd64 system with "options COMPAT_IA32" in the kernel. #include #include #include #include int main(void) { fprintf(stderr, "moo1\n"); recvmsg(0, 0, 0); fprintf(stderr, "moo2\n"); err(1, "moo"); return 0; } >Fix: No known fix. In the case of sshd, disable privilege separation in /etc/ssh/sshd_config (not necessary if logging in as root). >Release-Note: >Audit-Trail: >Unformatted: