From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.seebs.net (mail.seebs.net [162.213.38.76]) by mail.openembedded.org (Postfix) with ESMTP id 61BC778803 for ; Sat, 24 Mar 2018 19:50:44 +0000 (UTC) Received: from seebsdell (unknown [24.196.59.174]) by mail.seebs.net (Postfix) with ESMTPSA id 38FE72E8938; Sat, 24 Mar 2018 14:50:46 -0500 (CDT) Date: Sat, 24 Mar 2018 14:50:44 -0500 From: Seebs To: Andre McCurdy Message-ID: <20180324145044.168f7e3f@seebsdell> In-Reply-To: References: <20180323112820.12bc94a4@seebsdell> <20180323114939.218c0607@seebsdell> <1521848850.11431.36.camel@linuxfoundation.org> <20180323185655.51d96c05@seebsdell> <1521894988.11431.42.camel@linuxfoundation.org> <20180324122357.668e6afc@seebsdell> <20180324132246.28c2f8cd@seebsdell> <20180324142427.53da953d@seebsdell> X-Mailer: Claws Mail 3.15.1-dirty (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Cc: Enrico Scholz , OE-core Subject: Re: pseudo: host user contamination X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2018 19:50:45 -0000 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Sat, 24 Mar 2018 12:42:45 -0700 Andre McCurdy wrote: > Right. The musl example is to show how it's possible to transparently > intercept and pass on any call to the syscall() ABI without > interpreting anything. Yes, if you don't need to interpret things, and aren't making additional other unrelated system calls after doing so. > Those details are all taken care of within the libc implementation of > syscall(). It's not something we need to care about at all in a > wrapper for it. I don't think that's correct. musl's call sequence: real_syscall() // sets a3 return pseudo's call sequence: various_setup() real_syscall() // sets a3 other system calls // also set a3 return In the case where pseudo is actually *disabled*, we just return right away after the real call. In every other case, we're making other calls some of which imply system calls, and those system calls could potentially overwrite things that the libc implementation of syscall took care of. (Mutex and signal mask operations.) So for that to work, I would in principle have to stash the value stored in, for instance, "a3", wait until after the other system calls, and then restore it. Unless *only* syscall() itself actually sets that register, and other system calls don't, and nothing else is using it either. -s