Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752779AbcKGKia (ORCPT ); Mon, 7 Nov 2016 05:38:30 -0500 Received: from mx2.suse.de ([195.135.220.15]:46770 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752731AbcKGKi1 (ORCPT ); Mon, 7 Nov 2016 05:38:27 -0500 Date: Mon, 7 Nov 2016 11:38:20 +0100 From: Cyril Hrubis To: Dmitry Vyukov Cc: linux-api@vger.kernel.org, LKML , mtk.manpages@gmail.com, Thomas Gleixner , Sasha Levin , Mathieu Desnoyers , scientist@fb.com, Steven Rostedt , Arnd Bergmann , carlos@redhat.com, syzkaller , Kostya Serebryany , Mike Frysinger , Dave Jones , Tavis Ormandy Subject: Re: Formal description of system call interface Message-ID: <20161107103819.GA11374@rei.lan> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1688 Lines: 37 Hi! > We identified a surprisingly large number of potential users for such > descriptions: > - fuzzers (syzkaller, trinity, iknowthis) > - strace/syscall tracepoints (capturing indirect arguments and > printing human-readable info) > - generation of entry points for C libraries (glibc, liblinux > (raw syscalls), Go runtime, clang/gcc sanitizers) > - valgrind/sanitizers checking of input/output values of syscalls > - seccomp filters (minijail, libseccomp) need to know interfaces > to generate wrappers > - safety certification (requires syscall specifications) > - man pages (could provide actual syscall interface rather than > glibc wrapper interface, it was noted that possible errno values > is an important part here) > - generation of syscall argument validation in kernel (fast version > is enabled all the time, extended is optional) I was thinking of generating LTP testcases from a well defined format for quite some time. Maybe that would be a good way how to keep the descriptions to match the reality. LTP test would however need a bit more information that just syscall parameter anotation. We would need also description of the expected return value in some cases, annotating it as "returns fd" or "zero on success" would be good enough for basic tests. Better testing would need to describe the "side efect" as well (file was created, filesystem mounted, etc.) then we could write a classes of verify functions, something as check_file_exits() and use them to check the results accordingly. I'm not sure if something like this is really doable or in the scope of this project, but it may be worth a try. -- Cyril Hrubis chrubis@suse.cz