Commit 8bc1d217 authored by Julia Lawall's avatar Julia Lawall Committed by Greg Kroah-Hartman

USB: wusb: check CHID is all zeros before stopping the host

An incorrect sizeof() resulted in only 4 (or 8) octets of the CHID being
checked instead of all 16 octets.  A randomly generated CHID had a
probability of being unable to start a WUSB host of less than 1 in
2 billion.
Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
Signed-off-by: default avatarDavid Vrabel <david.vrabel@csr.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 319c3ea4
...@@ -263,7 +263,7 @@ int wusbhc_chid_set(struct wusbhc *wusbhc, const struct wusb_ckhdid *chid) ...@@ -263,7 +263,7 @@ int wusbhc_chid_set(struct wusbhc *wusbhc, const struct wusb_ckhdid *chid)
{ {
int result = 0; int result = 0;
if (memcmp(chid, &wusb_ckhdid_zero, sizeof(chid)) == 0) if (memcmp(chid, &wusb_ckhdid_zero, sizeof(*chid)) == 0)
chid = NULL; chid = NULL;
mutex_lock(&wusbhc->mutex); mutex_lock(&wusbhc->mutex);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment