Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758023AbXLQSFq (ORCPT ); Mon, 17 Dec 2007 13:05:46 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754310AbXLQSFi (ORCPT ); Mon, 17 Dec 2007 13:05:38 -0500 Received: from nf-out-0910.google.com ([64.233.182.190]:35968 "EHLO nf-out-0910.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753474AbXLQSFh (ORCPT ); Mon, 17 Dec 2007 13:05:37 -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=VCy5Hfzu+LB1dVem+UrSDzFwnQpcMjSxB3DO11CBAaB/yGPsrIsmGl0h2CpmjZlDXt/I98oethiPi9ARuSviXmsqWYREHg7kDru+cXm8wAB7hOIfADjMUW+CynOlMTWRTQhXc2R+99OesHeDyWngfLqEpkwkwOzAdZ55V7aKIV4= Message-ID: <2c0942db0712171005w65bbb512p71a4f9b1fc65c6a7@mail.gmail.com> Date: Mon, 17 Dec 2007 10:05:35 -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: <20071217185557.0b501e23.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> X-Google-Sender-Auth: 2e0aa21163f45541 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 527 Lines: 12 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. -- 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/