Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758960AbbKSRZy (ORCPT ); Thu, 19 Nov 2015 12:25:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54519 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758886AbbKSRZx (ORCPT ); Thu, 19 Nov 2015 12:25:53 -0500 Subject: Re: [RFC] In-kernel fuzz testing for apps To: Andrey Utkin , linux-kernel@vger.kernel.org, Anton References: <564D0C30.8010009@gmail.com> From: Laura Abbott Message-ID: <564E061F.1010805@redhat.com> Date: Thu, 19 Nov 2015 09:25:51 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <564D0C30.8010009@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1848 Lines: 40 On 11/18/2015 03:39 PM, Andrey Utkin wrote: > Me and my friend have once talked about careful application development, > which includes awareness about all possible error conditions. > So we have collected ideas about making kernel (or, in some cases, libc) > "hostile" to careless application, and we present it so that the idea > doesn't get lost, and maybe even gets real if somebody wants some > features from the list. > > - (libc) crash instantly if memcpy detects regions overlapping; > - return EINTR as much as possible; > - send/recv/etc. returns EAGAIN on non-blocking sockets as much as possible; > - send/recv tend to result in short writes/reads, e.g. 1 byte at a time, > to break assumption about sending/receiving some "not-so-big" thing at once; > - let write return ENOSPC sometimes; > - scheduler behaves differently from common case (e.g. let it tend to > stop a thread at some syscalls); > - return allocation failures; > - make OOM killer manic! > - make clocks which are not monotonic to go backward frequently; > - pretend the time is 2038 year or later; > - (arguable) close syscall returns non-zero first time, or randomly; > - (arguable) special arch having NULL not all zero-bits. Actually I > don't believe it is feasible to make a lot of modern software to run in > such situation. > > These horrific modes should be enabled per-process or per-executable-file. > > Thanks for your time and for any kind comment. > Check out CONFIG_FAULT_INJECTION, lib/fault_inject.c . There are a few things there already. You could expand on that for other functionality. Thanks, Laura -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/