Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933607AbbKRXjy (ORCPT ); Wed, 18 Nov 2015 18:39:54 -0500 Received: from mail-lb0-f195.google.com ([209.85.217.195]:35399 "EHLO mail-lb0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756501AbbKRXjx (ORCPT ); Wed, 18 Nov 2015 18:39:53 -0500 To: linux-kernel@vger.kernel.org, Anton From: Andrey Utkin Subject: [RFC] In-kernel fuzz testing for apps X-Enigmail-Draft-Status: N1110 Message-ID: <564D0C30.8010009@gmail.com> Date: Thu, 19 Nov 2015 01:39:28 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="9xkCV71fNoAkSJ1l7kUfK4JvG8tPmcoFR" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3001 Lines: 71 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --9xkCV71fNoAkSJ1l7kUfK4JvG8tPmcoFR Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 possib= le; - 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 on= ce; - 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= =2E Thanks for your time and for any kind comment. --=20 OpenPGP usage is appreciated (it also helps your letter to bypass spam filters). To email me with encryption easily, go https://encrypt.to/0xC6FCDB11 --9xkCV71fNoAkSJ1l7kUfK4JvG8tPmcoFR Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCgAGBQJWTQwwAAoJENVqfNDG/NsRJ5kP/1M8qy3Aef+w9Hvo61NmXRvT thK5j0fYE0dDfSWu2fs0rQVFwXFLv2+ZSTbaxq04KqXNykCqJHimOFRSYUwSw3CT /9e++NZeu9AulOvEQiW7izCIeuZ/pFi/hWXJwrFcNjhab1J4ap4bh4eyfxYCnzrF BiSpikGK8iLdBih5fEPHY2tvQlyTI/Tq8NWnQO8n5eWyZ4rBGnSGvGIkgdigUHAT L3mpio0LJHaK+QlpLFpWVB7DCE+RBF64AX88aVSot4mKbbVvN4FmpLb2751HQYNg 5/fX0TSEIjD/qMQjSELYTHvCvUetc7GJZjKlFcsYf2t5QrLLMtc3uCswfEsVxPLS K9DfQleAct0wWb87aLXG8MtX7nDaO6Qxa6hNy187zhw6DZgBNab3FHqxFm0AZvCF WFLmJwuQ5rl0qZGWfUYkrrLfnjvrSztcMrM4Qi6rfUhat8dMrmz0eXgJgQz3NVRG jT5OEk087oYO1juZm81LZxYMGPNC1HL6NkCwUHAAHqlBB+cgcpduJ0wX7uFQSNz0 Fv6LeIGrX+iw1gW3PHjvYfxGVRInNKtKxNkjcLTrU9Qv6CrpbMuE1vqFrQgVYDI5 qVQdc0YiWoaN5XZ7UFhcNmY9KenOh/HmEIylfAtPX6PYLjYwUSLnExANmu6tWd6p kwB5VEUuiuQkM4NOVzLC =V6Qd -----END PGP SIGNATURE----- --9xkCV71fNoAkSJ1l7kUfK4JvG8tPmcoFR-- -- 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/