From owner-freebsd-emulation Thu Nov 23 7:22:56 2000 Delivered-To: freebsd-emulation@freebsd.org Received: from mass.osd.bsdi.com (adsl-63-202-178-138.dsl.snfc21.pacbell.net [63.202.178.138]) by hub.freebsd.org (Postfix) with ESMTP id 86EB637B479 for ; Thu, 23 Nov 2000 07:22:54 -0800 (PST) Received: from mass.osd.bsdi.com (localhost [127.0.0.1]) by mass.osd.bsdi.com (8.11.0/8.11.1) with ESMTP id eANFRpF00909; Thu, 23 Nov 2000 07:27:52 -0800 (PST) (envelope-from msmith@mass.osd.bsdi.com) Message-Id: <200011231527.eANFRpF00909@mass.osd.bsdi.com> X-Mailer: exmh version 2.1.1 10/15/1999 To: Jonathan Lemon Cc: marcel@cup.hp.com, emulation@freebsd.org Subject: Re: "Bogon" Discovered in linux.ko syscall-mapping In-reply-to: Your message of "Wed, 22 Nov 2000 20:39:46 CST." <200011230239.eAN2dkB87509@prism.flugsvamp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 23 Nov 2000 07:27:51 -0800 From: Mike Smith Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > >You're probably right. We can't map Linux' reboot to FreeBSDs as is. > > Yeah. I have a simplistic linux wrapper for the reboot call somewhere, > I should dig it up and commit it. The real problem, actually, is not this at all. The problem is that we assume that an unbranded static ELF binary is a FreeBSD binary (this is wrong), and attempt to execute it as such. Most linux binaries make syscall 55 (fcntl) pretty early on (I think it may even be in the glibc startup). Unfortunately, 55 is reboot in the BSD syscall table. If you're running the Linux binary as root, you die. The correct fix is to not execute unbranded ELF binaries as FreeBSD binaries. FreeBSD binaries are always branded, so this is not a problem. -- ... every activity meets with opposition, everyone who acts has his rivals and unfortunately opponents also. But not because people want to be opponents, rather because the tasks and relationships force people to take different points of view. [Dr. Fritz Todt] V I C T O R Y N O T V E N G E A N C E To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message