diff options
author | Theodore Ts'o <tytso@mit.edu> | 2012-07-04 11:22:20 -0400 |
---|---|---|
committer | Paul Gortmaker <paul.gortmaker@windriver.com> | 2012-08-17 15:36:08 -0400 |
commit | ec0b0f6434c99db2c51cbdfcfc62b1daeca47b96 (patch) | |
tree | 3010ad148ef76e344f1dcdf88e9c53c8f0d78658 /drivers | |
parent | 327fb10ff1a3a59679e3cc36fe795c913300e80e (diff) |
usb: feed USB device information to the /dev/random driver
commit b04b3156a20d395a7faa8eed98698d1e17a36000 upstream.
Send the USB device's serial, product, and manufacturer strings to the
/dev/random driver to help seed its pools.
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Acked-by: Greg KH <greg@kroah.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/core/hub.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 40815d00e05e..953269f83ef8 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -23,6 +23,7 @@ #include <linux/mutex.h> #include <linux/freezer.h> #include <linux/pm_runtime.h> +#include <linux/random.h> #include <asm/uaccess.h> #include <asm/byteorder.h> @@ -1827,6 +1828,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); /* Register the device. The device driver is responsible * for configuring the device and invoking the add-device |