[{"id":1774230,"web_url":"http://patchwork.ozlabs.org/comment/1774230/","msgid":"<87poag88r7.fsf@steelpick.2x.cz>","list_archive_url":null,"date":"2017-09-24T14:35:24","subject":"Re: [LEDE-DEV] [PATCH procd 16/17] utrace: Support non-contiguous\n\tsyscall numbers","submitter":{"id":14651,"url":"http://patchwork.ozlabs.org/api/people/14651/","name":"Michal Sojka","email":"sojkam1@fel.cvut.cz"},"content":"On Tue, Sep 12 2017, Michal Sojka wrote:\n> ARM architecture does not have its system call numbers contiguous. So\n> far, utrace ignored the non-contiguous system calls, but it makes it\n> difficult to setup seccomp whitelists. This patch adds support for\n> these extra out-of-range syscalls.\n\nThis patch is buggy. I'll send fixed patch soon. The diff between this\nand new patch is:\n\ndiff --git a/trace/trace.c b/trace/trace.c\nindex 2621430..6fb9335 100644\n--- a/trace/trace.c\n+++ b/trace/trace.c\n@@ -193,7 +193,7 @@ static void tracer_cb(struct uloop_process *c, int ret)\n                                 int syscall = ptrace(PTRACE_PEEKUSER, c->pid, reg_syscall_nr);\n                                 int i = syscall_index(syscall);\n                                 if (i >= 0) {\n-                                        syscall_count[syscall]++;\n+                                        syscall_count[i]++;\n                                         if (debug)\n                                                 fprintf(stderr, \"%s()\\n\", syscall_name(syscall));\n                                 } else if (debug) {\n\n\n-Michal","headers":{"Return-Path":"<lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org; spf=none (mailfrom)\n\tsmtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133;\n\thelo=bombadil.infradead.org;\n\tenvelope-from=lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org header.b=\"Blo5vqS4\"; \n\tdkim-atps=neutral"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y0VT66RpZz9sDB\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 25 Sep 2017 00:48:26 +1000 (AEST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dw8Cf-00075g-Di; Sun, 24 Sep 2017 14:48:17 +0000","from smtpx.feld.cvut.cz ([147.32.192.33])\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dw80a-0008BJ-UT\n\tfor lede-dev@lists.infradead.org; Sun, 24 Sep 2017 14:35:51 +0000","from localhost (unknown [192.168.200.7])\n\tby smtpx.feld.cvut.cz (Postfix) with ESMTP id CDDC3DC338;\n\tSun, 24 Sep 2017 16:35:25 +0200 (CEST)","from smtpx.feld.cvut.cz ([192.168.200.6])\n\tby localhost (styx.feld.cvut.cz [192.168.200.7]) (amavisd-new,\n\tport 10054)\n\twith ESMTP id S3Wj5Zo0mLzY; Sun, 24 Sep 2017 16:35:24 +0200 (CEST)","from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34])\n\tby smtpx.feld.cvut.cz (Postfix) with ESMTP id 7E4D6DC27C;\n\tSun, 24 Sep 2017 16:35:24 +0200 (CEST)","from wsh by steelpick.2x.cz with local (Exim 4.89)\n\t(envelope-from <sojkam1@fel.cvut.cz>)\n\tid 1dw80C-0003Tg-6N; Sun, 24 Sep 2017 16:35:24 +0200"],"DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:Message-ID:Date:\n\tReferences:In-Reply-To:To:From:Reply-To:Cc:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=UeOIg6jLdT1zPKtX3+c+q/17jIk1j6Y1ipmXrFsSBmg=;\n\tb=Blo5vqS40PQ6vs\n\tz5wjxUiCfNrZTHp0fi+qBH3epdfRm5ytlwCYsBDMrUOix61JuonYsSJ6EFkKOWfvN1l4A3nxJAHuP\n\tA2L1mIm0O/rr5kz8DKZzQbwJkKwz26yywh32n6oO4VZJSsJeIFN+Q5xuY5N3L1OBIKKiDSYGYj39G\n\tDi3acnWMOaxHhJXXHI2rBvoSWeOKYEPvqTQu0haw8A9zX4WTctSisqGfc7KJyUz+KxG7USxHa6KrY\n\tzuKCqjruWYMybcFiPItctehy6HzpIcXgx4QMFw6pEh81X6cGeSAbQR+hFR+LZ7rXCHjlm4Chc/Q/O\n\tWUlbG2pESmbG8f5VPLVQ==;","X-Virus-Scanned":"IMAP STYX AMAVIS","From":"Michal Sojka <sojkam1@fel.cvut.cz>","To":"lede-dev@lists.infradead.org, John Crispin <john@phrozen.org>","In-Reply-To":"<20170912111250.31576-19-sojkam1@fel.cvut.cz>","References":"<20170912111250.31576-1-sojkam1@fel.cvut.cz>\n\t<20170912111250.31576-19-sojkam1@fel.cvut.cz>","Date":"Sun, 24 Sep 2017 16:35:24 +0200","Message-ID":"<87poag88r7.fsf@steelpick.2x.cz>","MIME-Version":"1.0","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170924_073549_361196_89D500DE ","X-CRM114-Status":"UNSURE (   6.11  )","X-CRM114-Notice":"Please train this message.","X-Spam-Score":"-4.2 (----)","X-Spam-Report":"SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-4.2 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/,\n\tmedium trust [147.32.192.33 listed in list.dnswl.org]\n\t-0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay\n\tdomain\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]","Subject":"Re: [LEDE-DEV] [PATCH procd 16/17] utrace: Support non-contiguous\n\tsyscall numbers","X-BeenThere":"lede-dev@lists.infradead.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<lede-dev.lists.infradead.org>","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/lede-dev>,\n\t<mailto:lede-dev-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/lede-dev/>","List-Post":"<mailto:lede-dev@lists.infradead.org>","List-Help":"<mailto:lede-dev-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/lede-dev>,\n\t<mailto:lede-dev-request@lists.infradead.org?subject=subscribe>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"\"Lede-dev\" <lede-dev-bounces@lists.infradead.org>","Errors-To":"lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"}}]