Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932745AbcKHTs6 (ORCPT ); Tue, 8 Nov 2016 14:48:58 -0500 Received: from smtprelay0141.hostedemail.com ([216.40.44.141]:51259 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752512AbcKHTsz (ORCPT ); Tue, 8 Nov 2016 14:48:55 -0500 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::::::::,RULES_HIT:41:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:1801:1963:2393:2553:2559:2562:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:4605:5007:6261:7875:7903:10004:10400:10450:10455:10848:10967:11026:11232:11233:11658:11914:12043:12114:12296:12438:12663:12740:12760:13069:13311:13357:13439:14181:14659:14721:19904:19999:21080:21212:30051:30054:30060:30070: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:2,LUA_SUMMARY:none X-HE-Tag: class67_4d8d5dcbcad57 X-Filterd-Recvd-Size: 3059 Date: Tue, 8 Nov 2016 14:48:51 -0500 From: Steven Rostedt To: Andy Lutomirski Cc: Linus Torvalds , Linux Kernel Mailing List , Ingo Molnar , Andrew Morton , Roland McGrath , Oleg Nesterov , "linux-arch@vger.kernel.org" , Peter Zijlstra Subject: Re: [RFC][ATCH 1/3] ptrace: Remove maxargs from task_current_syscall() Message-ID: <20161108144851.7a35c37d@gandalf.local.home> In-Reply-To: References: <20161107212634.529267342@goodmis.org> <20161107213233.466776454@goodmis.org> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.31; 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 Content-Length: 1688 Lines: 36 On Tue, 8 Nov 2016 08:20:48 -0800 Andy Lutomirski wrote: > On Tue, Nov 8, 2016 at 8:16 AM, Linus Torvalds > wrote: > > So I definitely approve of the change, but I wonder if we should go > > one step further: > > > > On Mon, Nov 7, 2016 at 1:26 PM, Steven Rostedt wrote: > >> > >> extern int task_current_syscall(struct task_struct *target, long *callno, > >> - unsigned long args[6], unsigned int maxargs, > >> - unsigned long *sp, unsigned long *pc); > >> + unsigned long args[6], unsigned long *sp, > >> + unsigned long *pc); > > > > The thing is, in C, having an array in a function declaration is > > pretty much exactly the same as just having a pointer, so from a type > > checking standpoint it doesn't really help all that much (but from a > > "human documentation" side the "args[6]" is much better than "*args"). > > > > However, what would really help type checking is making it a > > structure. And maybe that structure could just contain "callno", "sp" > > and "pc" too? That would not only fix the type checking, it would make > > the calling convention even cleaner. Just have one single structure > > that contains all the relevant data. > > I would propose calling this 'struct seccomp_data'. I'm assuming you mean to use the existing seccomp_data? But isn't that already defined as a user structure? Thus, we can't add sp and pc to it. I can change syscall_get_arguments() to take the seccomp_data as an input, and just fill in the arguments directly. -- Steve