Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933747AbcKHVHD (ORCPT ); Tue, 8 Nov 2016 16:07:03 -0500 Received: from mail-ua0-f173.google.com ([209.85.217.173]:34902 "EHLO mail-ua0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933704AbcKHVG5 (ORCPT ); Tue, 8 Nov 2016 16:06:57 -0500 MIME-Version: 1.0 In-Reply-To: <20161108144851.7a35c37d@gandalf.local.home> References: <20161107212634.529267342@goodmis.org> <20161107213233.466776454@goodmis.org> <20161108144851.7a35c37d@gandalf.local.home> From: Andy Lutomirski Date: Tue, 8 Nov 2016 13:06:35 -0800 Message-ID: Subject: Re: [RFC][ATCH 1/3] ptrace: Remove maxargs from task_current_syscall() To: Steven Rostedt Cc: Andrew Morton , linux-arch , Oleg Nesterov , Ingo Molnar , Linux Kernel Mailing List , Peter Zijlstra , Roland McGrath , Linus Torvalds Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1796 Lines: 36 On Nov 8, 2016 11:48 AM, "Steven Rostedt" wrote: > > 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. pc is there. sp isn't, but that could be separate. Or you could embed seccomp_data in a bigger structure.