From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754070AbcH3X2g (ORCPT ); Tue, 30 Aug 2016 19:28:36 -0400 Received: from smtprelay0204.hostedemail.com ([216.40.44.204]:39762 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752641AbcH3X2c (ORCPT ); Tue, 30 Aug 2016 19:28:32 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::,RULES_HIT:41:355:379:541:560:599:800:960:968:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:3873:3874:4250:5007:6119:6261:7875:7903:8660:10004:10400:10848:10967:11026:11232:11658:11914:12043:12438:12740:13069:13148:13161:13229:13230:13311:13357:13439:14096:14097:14181:14659:14721:21080:21212:21324:30034:30054:30060:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: chalk40_65e19f4672047 X-Filterd-Recvd-Size: 3375 Date: Tue, 30 Aug 2016 19:28:18 -0400 From: Steven Rostedt To: Andy Lutomirski Cc: Linux API , Ingo Molnar , open list , Linux MIPS Mailing List , Marcin Nowakowski Subject: Re: [PATCH 1/2] tracing/syscalls: allow multiple syscall numbers per syscall Message-ID: <20160830192818.4e16a674@gandalf.local.home> In-Reply-To: References: <1472463007-6469-1-git-send-email-marcin.nowakowski@imgtec.com> <20160830152955.17633511@gandalf.local.home> <20160830165830.5e494c43@gandalf.local.home> <20160830180328.4e579db3@gandalf.local.home> <20160830183030.3e9f67f0@gandalf.local.home> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 30 Aug 2016 16:09:04 -0700 Andy Lutomirski wrote: > But none of this should be a problem at all for MIPS, right? AFAICT > the only problem for MIPS is that there *is* a mapping from metadata > to nr. If that mapping got removed, MIPS should just work, right? Wait, where's the mapping of metadata to nr. I don't see that, nor do I see a need for that. The issue is that we have metadata that expresses how to record a syscall, and we map syscall nr to metadata, because when tracing is active, the only thing we have to find that metadata is the syscall nr. Now if a syscall nr has more than one way to record (a single nr for multiple syscalls), then we get into trouble. That's why we have trouble with compat syscalls. The same number maps to different syscalls, and we don't know how to differentiate that. > > For x86 compat, I think that adding arch should be sufficient. > Specifically, rather than having just one enter_syscall_files array, > have one per audit arch. Then call syscall_get_arch() as well as > syscall_get_nr() and use both to lookup the metadata. AFAIK this > should work on all architectures, although you might need some arch > helpers to enumerate all the arches and their respective syscall > tables (and max syscall nrs). OK, if the regs can get us to the arch, then this might work. That is, perhaps we can have multiple tables (not really sure how to make that happen in an arch agnostic way), and then have two functions: trace_get_syscall_nr(current, regs) trace_get_syscall_arch(current, regs) Although, that "arch" may be confusing. -- Steve