Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759279AbXLQSNA (ORCPT ); Mon, 17 Dec 2007 13:13:00 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755002AbXLQSMw (ORCPT ); Mon, 17 Dec 2007 13:12:52 -0500 Received: from nf-out-0910.google.com ([64.233.182.191]:47125 "EHLO nf-out-0910.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753733AbXLQSMv (ORCPT ); Mon, 17 Dec 2007 13:12:51 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=ODvFsBbIukiwnV/zICGFuS0NxNs63rX0HuKJS5C203nyYKkG0NNfzxZ2SPLQL10X+fY3Qd+quFnY4RNabkChQlY6MdPQGVPhQuAPcHZZrncDEZaLgWoHHbtlVPUniVXy6dUe547xmNtbVy/hq1M5UVElAhgqOsiaXX+d26udLc4= Message-ID: <2c0942db0712171012o613b2596x81f4a867e2b5c01@mail.gmail.com> Date: Mon, 17 Dec 2007 10:12:47 -0800 From: "Ray Lee" To: "Eric Dumazet" Subject: Re: Signed divides vs shifts (Re: [Security] /dev/urandom uses uninit bytes, leaks user data) Cc: "Linus Torvalds" , "Herbert Xu" , "John Reiser" , "Andrew Morton" , security@kernel.org, tytso@mit.edu, "Linux Kernel Mailing List" , mpm@selenic.com, linux-sparse@vger.kernel.org In-Reply-To: <20071217191017.117c61ff.dada1@cosmosbay.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20071217185557.0b501e23.dada1@cosmosbay.com> <2c0942db0712171005w65bbb512p71a4f9b1fc65c6a7@mail.gmail.com> <20071217191017.117c61ff.dada1@cosmosbay.com> X-Google-Sender-Auth: cf993f1b7bac71cb Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 916 Lines: 25 On Dec 17, 2007 10:10 AM, Eric Dumazet wrote: > On Mon, 17 Dec 2007 10:05:35 -0800 > "Ray Lee" wrote: > > > On Dec 17, 2007 9:55 AM, Eric Dumazet wrote: > > > - mid = (last - first) / 2 + first; > > > + while (low <= high) { > > > + mid = (low + high) / 2; > > > > I think you just introduced a bug. Think about what happens if > > low=high=MAX_LONG/2 + 1. > > > > Fortunatly this is not possible :) > > Hint : sizeof(struct exception_table_entry) is >= 8 > > so high is garanteed to be <= MAX_LONG/8 Ah, my bad. One of these days I'll learn to not post before coffee. -- 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/