From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/12216 Path: news.gmane.org!.POSTED!not-for-mail From: ardi Newsgroups: gmane.linux.lib.musl.general Subject: Easiest way of capturing syscalls, all-architectures-wide? Date: Thu, 7 Dec 2017 14:19:24 +0100 Message-ID: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1512652783 8439 195.159.176.226 (7 Dec 2017 13:19:43 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 7 Dec 2017 13:19:43 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-12232-gllmg-musl=m.gmane.org@lists.openwall.com Thu Dec 07 14:19:38 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1eMw5N-0001vj-5x for gllmg-musl@m.gmane.org; Thu, 07 Dec 2017 14:19:38 +0100 Original-Received: (qmail 21911 invoked by uid 550); 7 Dec 2017 13:19:38 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 21871 invoked from network); 7 Dec 2017 13:19:37 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=4vSonAzIt4bYEWk7B4MRkPUyp33jHImVriSLtscSRVI=; b=WDowFYytdz5+5plSOd94zb4M0QYH7wOI70k3j0ptPJFfQeUrGShVwkQOBwTThqbMGh 2oH7wtPTcB5RHX9DKH5nz+WKPbLv9D7yw/uUACfO0q2Eh6DGRRGfJd67qJrn2cmo6UzW E5K1+KLVMOOpghpPyi/JfyB3Yttms7ek/FH/bQvY3TciAFLYhR5tTMDuEoY54KgwdEsd t6SdWZ7qwNm96w/6A5yrWcGpdnIGC+G8PeTk5+KYs5Jfq+fEQWnd3zPboeXBbJLZSLzP BiBwPy1+c9PkSXAgwYue4gOQewKCDnXBxbEJNzfgqIJ4dZwmX+miSDmOlBYXh+/vuDu1 ijmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=4vSonAzIt4bYEWk7B4MRkPUyp33jHImVriSLtscSRVI=; b=YQ7LiSszi/Ng9auSVd4u30udoX/EsSFk6PFeQTqgTC5ZoKuEoCTmyizIl/Lx/ECAn8 wJu9AfXODpUBhRxIpiT9qpFaCV0PKkoQqNCqVi400UxXuAI9pO+CO4IDAhMUTY5ks87S qCTPI14iCvUQJC62W38NfuJD5r3PgmJN4EkvW0vDqPQD43HKRBePCIx3TjwxUO6Siedh aJTLjALHFKuPik2pszmU05WbzXZMzHMKfcTFOjRY1tlc6UQNmtUNvkvkiH6dZiQe1MGL bEogVi6IXCIVzuMS1MxX1HF5faOgKPEDRnBZhD5DAHdFGZyx1eTPeYVvnknCZ9rkYJ4X t6Rw== X-Gm-Message-State: AKGB3mKxKsnJph3W5sDSafVanyEJEbgc4KaJio12D7kWg1uBgl4+47iV sYAYONXdmKP7Eq9mMFurC5isweqwiff/j91hPyOPGw== X-Google-Smtp-Source: AGs4zMbxfyFtaE5rtmSDhHAWTjqL1nMRAOudab+8t8yNTLxLU+OGH2p0B5CwQRWFSpQ7rJE+cqom6dvMxTYfviPl7Vg= X-Received: by 10.99.95.133 with SMTP id t127mr2241053pgb.368.1512652764870; Thu, 07 Dec 2017 05:19:24 -0800 (PST) Xref: news.gmane.org gmane.linux.lib.musl.general:12216 Archived-At: Is there some place (some header, I suppose) where I could redefine the syscall interface in a global way, for all CPU architectures, and redirect all syscalls to a custom implementation of the Linux call table? For this scenario I'm thinking in totally bypassing the arch-dependent assembly syscall code, and redirect it to a C-written interface. Can this be done in an smart way that would involve perhaps just editing one file? Maybe you have this feature already implemented for your testing purposes, but it's disabled in release builds? (I'm asking this for not reinventing the wheel in case you already have this feature) I'm looking at src/internal/syscall.h in this very same moment, and it looks like the redirection can be done there, but... would this capture all syscalls, or maybe some parts of musl might still be issuing syscalls that don't go through src/internal/syscall.h ? Also, is there an easy way of disabling the build of the assembly syscall code, just to be 100% confident that I build without the risk of doing direct syscalls? Thanks!! ardi