Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754489AbcKUQ7S (ORCPT ); Mon, 21 Nov 2016 11:59:18 -0500 Received: from mx2.suse.de ([195.135.220.15]:33174 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753813AbcKUQ7P (ORCPT ); Mon, 21 Nov 2016 11:59:15 -0500 Date: Mon, 21 Nov 2016 17:58:53 +0100 From: Cyril Hrubis To: Dmitry Vyukov Cc: syzkaller , Linux API , LKML , Michael Kerrisk-manpages , Thomas Gleixner , Sasha Levin , Mathieu Desnoyers , scientist@fb.com, Arnd Bergmann , "Carlos O'Donell" , Kostya Serebryany , Mike Frysinger , Dave Jones , Tavis Ormandy Subject: Re: Formal description of system call interface Message-ID: <20161121165853.GC27353@rei.lan> References: <20161107103819.GA11374@rei.lan> <20161121103752.70ad1418@gandalf.local.home> 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: 1516 Lines: 32 Hi! > > Looking ahead into the future, I was also thinking that if this becomes > > robust, we could also start an integration specification, that could > > describe how different system calls interact with each other. Like > > open() to read(), write() and close(). > > > > But this is just an idea that popped in my head while reading this > > thread. We want to start small first, but still could keep this in the > > back of our minds for future enhancements. > > > FWIW syzkaller does something along these lines. > It has notion of 'resources' and of input/output arguments. > Then it can figure out that e.g. open creates fd's, so it should be called > before any reads/writes (provided that we want to pass in valid fd's). > It does not have notion of "destructors" for resources (e.g. close > destroys the passed in resource). But it should be easy to describe. Logical extension would be to teach it that creat(), for instance, returns file descriptor and creates a file as a side effect. That file then could be used for a stat() or unlink() concurently, etc. But we should also consider that not all file descriptors or files are equal, so we may end up with some classes of files and file descriptors some of them suitable for different subsets of operations. I think that defining classes of objects and defining how syscalls transform their state may yield something usable. But that would require some serious thinking and a few trial and error implementations. -- Cyril Hrubis chrubis@suse.cz