Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754374AbcKUPD3 (ORCPT ); Mon, 21 Nov 2016 10:03:29 -0500 Received: from mail-wm0-f47.google.com ([74.125.82.47]:35549 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753043AbcKUPD0 (ORCPT ); Mon, 21 Nov 2016 10:03:26 -0500 MIME-Version: 1.0 In-Reply-To: <20161107002839.GN5749@port70.net> References: <20161107002839.GN5749@port70.net> From: Dmitry Vyukov Date: Mon, 21 Nov 2016 16:03:04 +0100 Message-ID: Subject: Re: Formal description of system call interface To: syzkaller Cc: linux-api@vger.kernel.org, LKML , Michael Kerrisk-manpages , Thomas Gleixner , Sasha Levin , Mathieu Desnoyers , scientist@fb.com, Steven Rostedt , Arnd Bergmann , carlos@redhat.com, Kostya Serebryany , Mike Frysinger , Dave Jones , Tavis Ormandy 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: 1951 Lines: 50 On Mon, Nov 7, 2016 at 1:28 AM, Szabolcs Nagy wrote: > * Dmitry Vyukov [2016-11-06 14:39:28 -0800]: >> This is notes from the discussion we had at Linux Plumbers this week >> regarding providing a formal description of system calls (user API). > yes a database of the syscall abis would be useful > ..depending on the level of detail it has. > > (right now there is not even spec about what registers > the syscall entry point may clobber on the various abis > which would be useful to know when making syscalls) Hi Szabolcs, Level of detail is discus-sable. I would say that a detail is worth supporting if: 1. there is an intent to actually use in a foreseeable future 2. there is somebody who is ready to spend time describing the detail >> Action points: >> - polish DSL for description (must be extensible) >> - write a parser for DSL >> - provide definition for mm syscalls (mm is reasonably simple >> and self-contained) >> - see if we can do validation of mm arguments > > for all abi variants? e.g. mmap offset range is abi dependent. I don't think we draw exact line between what will be verified and will not. There are simpler predicates (e.g. memory is addressable) and more complex predicates (e.g. this flag can have this value iff that other flags is specified and a valid fd is passed in that field of a struct). >> For the reference, current syzkaller descriptions are in txt files here: >> https://github.com/google/syzkaller/tree/master/sys > ... >> Taking the opportunity, if you see that something is missing/wrong >> in the descriptions of the subsystem you care about, or if it is not >> described at all, fixes are welcome. > > abi variants are missing (abi variation makes a lot of > syscall interface related work painful). What exactly do you mean by "abi variants"? Is it architecture? What exactly needs to be added to the descriptions support "abi variants? Thanks