Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sat, 27 Oct 2001 00:23:17 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sat, 27 Oct 2001 00:23:08 -0400 Received: from mailgate5.cinetic.de ([217.72.192.165]:19095 "EHLO mailgate5.cinetic.de") by vger.kernel.org with ESMTP id ; Sat, 27 Oct 2001 00:23:00 -0400 Message-Id: Content-Type: text/plain; charset="iso-8859-15" From: =?iso-8859-15?q?Ren=E9=20Scharfe?= To: Linux Kernel Mailing List Subject: [PATCH] random.c bugfix Date: Sat, 27 Oct 2001 06:21:59 +0200 X-Mailer: KMail [version 1.3.1] Cc: Linus Torvalds , Alan Cox MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Hi, there's a bug in random.c, I think. The third argument of extract_entropy() is supposed to be the number of _bytes_ to extract, while nwords contains the number of _bytes_ we want. This seems to lead us to transfer n bytes of entropy and credit for n*4 bytes. Ren? --- linux-2.4.14-pre2/drivers/char/random.c Fri Oct 26 23:07:16 2001 +++ linux-2.4.14-pre2-rs/drivers/char/random.c Sat Oct 27 05:36:23 2001 @@ -1253,7 +1253,7 @@ r == sec_random_state ? "secondary" : "unknown", r->entropy_count, nbytes * 8); - extract_entropy(random_state, tmp, nwords, 0); + extract_entropy(random_state, tmp, nwords * 4, 0); add_entropy_words(r, tmp, nwords); credit_entropy_store(r, nwords * 32); } - 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/