Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:90819 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 60917 invoked from network); 22 Jan 2016 04:03:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Jan 2016 04:03:52 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.160.181 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.160.181 mail-yk0-f181.google.com Received: from [209.85.160.181] ([209.85.160.181:35284] helo=mail-yk0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 78/00-59180-72AA1A65 for ; Thu, 21 Jan 2016 23:03:51 -0500 Received: by mail-yk0-f181.google.com with SMTP id s126so48479741ykf.2 for ; Thu, 21 Jan 2016 20:03:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=nh5PuKSVwp6JG6bjyWc/eqPwA+Lt8rEt3Khu8aZ4hNo=; b=sWtLg/Soedj73P//TGW19groWUXAmwFEijx+Zt6QS1GRQaIKBLYZqRO7yU65wwsaak o8vXMUG1ylzjONHPwFPj/CxpdTLTyO9pAu6u4DkhPiQde8fFPER2jAVxQkM/Oxjl10vb Bg/hoTbovb3McNRLYDhjMJDdACZCUlHv+nQzXgFUY/JeFJrDOYf2OIK7WvfhzoNONk/a RRIZM1KEeyL+s1b/44bnyBEm7BkIfq9LUjxNe0gX9ZhJhiNhfGzqsgyDEBl+S/Z6W6V1 idFZfnruon11lkSvg8xWkGskvz3niyKkrueH+7KlteWJOEh5x4gWlW/PDpcjUf3tyPux GgtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=nh5PuKSVwp6JG6bjyWc/eqPwA+Lt8rEt3Khu8aZ4hNo=; b=HOBxrCjfw3YzVKmguNk6HkbJOmRjZ6tBt5BaZYS0CEnMr+gHEw5jlngI0OtIe9uvIv 4wfRgkdHwzBLzALTSb1t8ycR0E5pyVNFYpTuPOQhlcgikPxrRiSVtauiAtLEXiCyAkNb c0CpKiZ1dmSmIkXaGW6UQTYvPKbM9II6k0R2IVI1rNggz4H+fJbjTOlyz98uB3q/6AhG 9GYWkxN5Ma363YYzW8k1u30U+jGI+M0H9VAj5PqNdYqVelxX2NzilyhDqM7pISGuF9TH /ayWxUxJvKG1ML9N92Z0AwqtHIYZFhG1NE7gdNxOjgk+C4J2+MpmN+G2Tv/lKzpULMK6 Z29w== X-Gm-Message-State: AG10YORW6I8Jmm/0x1XEl3BvrH8Huy/ykOS8UX+V2w8NU0yeQ7q7BSD5QgjtuRF5b77u9iRAm3p/rTRxtYKiSA== X-Received: by 10.37.20.195 with SMTP id 186mr441947ybu.60.1453435427532; Thu, 21 Jan 2016 20:03:47 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.129.88.139 with HTTP; Thu, 21 Jan 2016 20:03:08 -0800 (PST) In-Reply-To: <9D.00.64206.7C430A65@pb1.pair.com> References: <9D.00.64206.7C430A65@pb1.pair.com> Date: Fri, 22 Jan 2016 13:03:08 +0900 X-Google-Sender-Auth: 4MAAyFMOcmdvt9C7NEhxyHSV5nc Message-ID: To: Umberto Salsi Cc: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Severe safety fail in file access and stream filters From: yohgaki@ohgaki.net (Yasuo Ohgaki) Hi Umberto, On Thu, Jan 21, 2016 at 10:30 AM, Umberto Salsi wrote: > I recently discovered several failures in error detection involving > file access, stream compression and source inclusion that may bring the > program to process missing or invalid data (very severe safety bug) or > simply crash without apparent reason. I reported all these issues with > their test script trying to do as much as I can to really understand > what happen here. I think it's the time for some real internal expert > to take over these issues and kindly reply to the following questions: > > 1. Is there something very basic I'm missing? I'm doing something wrong? > > 2. If yes, what can I do to fix so that i/o errors can be detected? > > 3. If no, why i/o errors do not propagate through the engine, but are > mostly ignored? and why the user's program does not get signaled > about this, and keeps receiving empty strings or garbage instead? Plain file stream reads data by php_stdiop_read() http://lxr.php.net/xref/PHP_5_6/main/streams/plain_wrapper.c#338 As you can see there is no way to return errors from it. We need errno like error handling for PHP streams to propagate errors as well as more robust code for unexpected. So answer for 3 is "we need volunteers" for improvement, I suppose. Anyone? -- Yasuo Ohgaki yohgaki@ohgaki.net