From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1N7e61-0006rW-BY for mharc-grub-devel@gnu.org; Mon, 09 Nov 2009 18:56:29 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N7e5y-0006qX-WE for grub-devel@gnu.org; Mon, 09 Nov 2009 18:56:27 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N7e5x-0006qJ-Uk for grub-devel@gnu.org; Mon, 09 Nov 2009 18:56:26 -0500 Received: from [199.232.76.173] (port=40890 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N7e5x-0006qG-QU for grub-devel@gnu.org; Mon, 09 Nov 2009 18:56:25 -0500 Received: from 75-63-108-1.uvs.hstntx.sbcglobal.net ([75.63.108.1]:59288 helo=ubuntu-mail.griffin.net) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N7e5x-0003Ao-CD for grub-devel@gnu.org; Mon, 09 Nov 2009 18:56:25 -0500 Received: from [192.168.0.157] by ubuntu-mail.griffin.net with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.67) (envelope-from ) id 1N7fRE-0001vx-PO for grub-devel@gnu.org; Mon, 09 Nov 2009 19:22:29 -0600 Message-ID: <4AF8AC18.1060206@griffin.net> Date: Mon, 09 Nov 2009 17:56:08 -0600 From: Darron Black User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: The development of GNU GRUB References: <4AF85568.7080105@duboucher.eu> <4AF86387.7090307@gmail.com> <4AF885EE.7000709@duboucher.eu> <4AF88AEF.8010102@gmail.com> <4AF88D14.2030108@duboucher.eu> <20091109220654.GA22226@thorin> <4AF89BC1.5040608@duboucher.eu> <4AF8A12B.1030908@griffin.net> <2e59e6970911091550l7b1d6f87r240c1dbe7de11ec1@mail.gmail.com> In-Reply-To: <2e59e6970911091550l7b1d6f87r240c1dbe7de11ec1@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam_score_int: -43 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) Subject: Re: Imminent bugfix release (1.97.1) X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2009 23:56:27 -0000 richardvoigt@gmail.com wrote: >> Hello, >> >> I'd be concerned about (s1 != s2). Depending on how efficiently this >> compiles, could not branch prediction make this faster for match vs. not >> match, etc?. I'd be worried about all the ways (and future ways) compilers >> might help us and introduce time differences. >> > > I was avoiding suggesting new conditionals for that reason, but didn't > see the one already there. Good find. > > >> I'd feel most comfortable with the time delay, but why not stick to complete >> artithmetic? >> > > I agree. But I think you've inverted the return value (strcmp returns > 0 on perfect match). > > Yeah, sorry. That'd be a slightly larger security hole, eh? I meant to just show the "acc |= (*s1 ^ *s2);" line, but I decided to throw the rest in for context and didn't really check it. I noticed that just AFTER sending. >> int i; >> int acc = 0; >> >> for(i=0;i> { >> acc |= (*s1 ^ *s2); >> >> if (*s1 == 0) >> break; >> } >> >> return (acc == 0); >> >> >> Also, these strcmp functions don't properly return < or >. Just = / !=. >> However, my context being so new is quite limited. >> >> >> Darron >> >> >> >> _______________________________________________ >> Grub-devel mailing list >> Grub-devel@gnu.org >> http://lists.gnu.org/mailman/listinfo/grub-devel >> >> > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel >