From owner-freebsd-security@FreeBSD.ORG Sat Apr 26 06:41:39 2014 Return-Path: Delivered-To: freebsd-security@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2FDF5ADC for ; Sat, 26 Apr 2014 06:41:39 +0000 (UTC) Received: from mail-qa0-x22d.google.com (mail-qa0-x22d.google.com [IPv6:2607:f8b0:400d:c00::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CE8AB1A29 for ; Sat, 26 Apr 2014 06:41:38 +0000 (UTC) Received: by mail-qa0-f45.google.com with SMTP id cm18so4498084qab.32 for ; Fri, 25 Apr 2014 23:41:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type; bh=Q/7aM8k7+cIG7KueUhamINTecNfdmxKX/WMoz5RbigE=; b=V0WR9Olfbzp/YyJBrQlj9qtMA0+Rx6oDyiIRn05o7gUQRMxZlA5nXyugegG5+xLMRJ FolUjDdqDkyITpCZ06nN+e7Gh5h0rtq0xDo9UYCfhsPreAOlJilzXFVhcQXE/qFSaagk CiL+iIaUjd0pB5zIgTDaaRaO2V9sb7eGEBE7nXYeTcCs/egmtzr4lyLrHR/vRahbnrkB NIPRAL+kUGpOJcTKrYZHSNkLGp+s+7HoYpN1EfMHWZaomFYuBtHUp7JGdrQN031uLTet q3X1eypDBbY9Jgt7LIAnVpI2XWjVVPzBOZ0nI6gFeJqchA3jj5m3e1KWmIOmjPMGIEvR xaYQ== MIME-Version: 1.0 X-Received: by 10.224.147.77 with SMTP id k13mr17722201qav.64.1398494497987; Fri, 25 Apr 2014 23:41:37 -0700 (PDT) Sender: benlaurie@gmail.com Received: by 10.96.162.196 with HTTP; Fri, 25 Apr 2014 23:41:37 -0700 (PDT) In-Reply-To: <20140425213846.GC9479@glaze.hydra> References: <86zjj9mivi.fsf@nine.des.no> <32060.1398457484@server1.tristatelogic.com> <36500.1398458797@critter.freebsd.dk> <20140425213846.GC9479@glaze.hydra> Date: Sat, 26 Apr 2014 07:41:37 +0100 X-Google-Sender-Auth: l_mXVRuANRy5A7MOakOzl9rULu4 Message-ID: Subject: Re: OpenSSL static analysis, was: De Raadt + FBSD + OpenSSH + hole? From: Ben Laurie To: "freebsd-security@freebsd.org security" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-security@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "Security issues \[members-only posting\]" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2014 06:41:39 -0000 On 25 April 2014 22:38, Chad Perrin wrote: > On Fri, Apr 25, 2014 at 09:52:25PM +0100, Ben Laurie wrote: >> On 25 April 2014 21:46, Poul-Henning Kamp wrote: >> > In message >> > , Ben Laurie writes: >> >>On 25 April 2014 21:24, Ronald F. Guilmette wrote: >> >>> Separately, a code example of the following general form was discussed: >> >>> >> >>> if (condition) variable = value1; >> >>> if (!condition) variable = value2; >> >>> use (variable); >> >>> >> > >> >>One better answer would be to have a way to annotate that after the >> >>two conditionals you assert that |variable| is initialised. Then a >> >>future, smarter static analyzer can attempt to prove you wrong. >> > >> > The way you do that *IS* to assert that the variable is indeed >> > set to something you can use. >> >> That only works if there's at least one illegal value, though. And you >> know what it is :-) > > With the proposed initialization value of -1, you could at least assert > that it is no longer -1, which at least indicates you have done > *something* to it in your code -- which, I believe, solves the problem > the code analyzer actually "intended" to point out, which is that it > might be possible for a variable to be used without any value assigned > to it (thus potentially reading garbage from a variable). Only if -1 cannot be either value1 or value2, that's my point. > > >> > >> > If your "security" source code does not have at least 10% assert >> > lines, you're not really serious about security. >> >> People get really pissed off when I put asserts into OpenSSL. >> >> Perhaps they'll have a different opinion now. > > . . . or maybe we'll all end up using LibreSSL in the not-to-distant > future and it will not matter any longer (for some definition of "we" > that does not include banks running "secure" software on VMS past its > epoch). Or Windows or Linux or ... > > -- > Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ] > _______________________________________________ > freebsd-security@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-security > To unsubscribe, send any mail to "freebsd-security-unsubscribe@freebsd.org"