public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Sebastian Gottschall (DD-WRT)" <s.gottschall@dd-wrt.com>
To: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: XHCI Bug discovered in 3.6-RC6 (solution included)
Date: Tue, 18 Sep 2012 02:51:57 +0200	[thread overview]
Message-ID: <5057C5AD.80609@dd-wrt.com> (raw)
In-Reply-To: <5057C55D.2060402@dd-wrt.com>

this following function is missing a important NULL check. if DMI is not 
available or not enabled in the kernel config (which is common in my 
case, since its a ARM Platform with XHCI support)
the xhci-hcd driver will crash due nullpointer access since 
dmi_get_system_info returns always NULL if DMI support is not enabled.

static bool compliance_mode_recovery_timer_quirk_check(void)
{
     const char *dmi_product_name, *dmi_sys_vendor;

     dmi_product_name = dmi_get_system_info(DMI_PRODUCT_NAME);
     dmi_sys_vendor = dmi_get_system_info(DMI_SYS_VENDOR);

     if (!(strstr(dmi_sys_vendor, "Hewlett-Packard")))
         return false;

     if (strstr(dmi_product_name, "Z420") ||
             strstr(dmi_product_name, "Z620") ||
             strstr(dmi_product_name, "Z820"))
         return true;

     return false;
}

proposed patch: simply add

  if (!dmi_sys_vendor || !dmi_product_name)
         return false;

even better. disable the whole quirk handling for this case if 
CONFIG_DMI is not set



-- 
Mit freundlichen Grüssen / Regards

Sebastian Gottschall / CTO

NewMedia-NET GmbH - DD-WRT
Firmensitz:  Berliner Ring 101, 64625 Bensheim
Registergericht: Amtsgericht Darmstadt, HRB 25473
Geschäftsführer: Peter Steinhäuser, Christian Scheele
http://www.dd-wrt.com
email: s.gottschall@dd-wrt.com
Tel.: +496251-582650 / Fax: +496251-5826565

-- 
Mit freundlichen Grüssen / Regards

Sebastian Gottschall / CTO

NewMedia-NET GmbH - DD-WRT
Firmensitz:  Berliner Ring 101, 64625 Bensheim
Registergericht: Amtsgericht Darmstadt, HRB 25473
Geschäftsführer: Peter Steinhäuser, Christian Scheele
http://www.dd-wrt.com
email:s.gottschall@dd-wrt.com
Tel.: +496251-582650 / Fax: +496251-5826565


       reply	other threads:[~2012-09-18  0:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5057C55D.2060402@dd-wrt.com>
2012-09-18  0:51 ` Sebastian Gottschall (DD-WRT) [this message]
2012-09-18 14:36   ` XHCI Bug discovered in 3.6-RC6 (solution included) Greg KH
2012-09-25  9:42     ` Vivek Gautam
2012-09-25 13:40       ` Greg KH
2012-09-26  4:37         ` Vivek Gautam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5057C5AD.80609@dd-wrt.com \
    --to=s.gottschall@dd-wrt.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox