From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757049Ab2GESMj (ORCPT ); Thu, 5 Jul 2012 14:12:39 -0400 Received: from li9-11.members.linode.com ([67.18.176.11]:37005 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751066Ab2GESMg (ORCPT ); Thu, 5 Jul 2012 14:12:36 -0400 From: "Theodore Ts'o" To: Linux Kernel Developers List Cc: torvalds@linux-foundation.org, w@1wt.eu, ewust@umich.edu, zakir@umich.edu, greg@kroah.com, mpm@selenic.com, nadiah@cs.ucsd.edu, jhalderm@umich.edu, tglx@linutronix.de, davem@davemloft.net, "Theodore Ts'o" , stable@kernel.org Subject: [PATCH 04/10] usb: feed USB device information to the /dev/random driver Date: Thu, 5 Jul 2012 14:12:07 -0400 Message-Id: <1341511933-11169-5-git-send-email-tytso@mit.edu> X-Mailer: git-send-email 1.7.11.1.108.gb129051 In-Reply-To: <1341511933-11169-1-git-send-email-tytso@mit.edu> References: <1341511933-11169-1-git-send-email-tytso@mit.edu> X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on imap.thunk.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Send the USB device's serial, product, and manufacturer strings to the /dev/random driver to help seed its pools. Cc: Linus Torvalds Acked-by: Greg KH Signed-off-by: "Theodore Ts'o" Cc: stable@kernel.org --- drivers/usb/core/hub.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 25a7422..24d0870 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -2173,6 +2174,14 @@ int usb_new_device(struct usb_device *udev) /* Tell the world! */ announce_device(udev); + if (udev->serial) + add_device_randomness(udev->serial, strlen(udev->serial)); + if (udev->product) + add_device_randomness(udev->product, strlen(udev->product)); + if (udev->manufacturer) + add_device_randomness(udev->manufacturer, + strlen(udev->manufacturer)); + device_enable_async_suspend(&udev->dev); /* -- 1.7.11.1.108.gb129051