lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 17 Sep 2010 15:49:39 -0700
From:	Dmitry Torokhov <dmitry.torokhov@...il.com>
To:	Bjorn Helgaas <bjorn.helgaas@...com>
Cc:	Len Brown <lenb@...nel.org>, linux-kernel@...r.kernel.org,
	linux-acpi@...r.kernel.org, Matthew Garrett <mjg59@...f.ucam.org>
Subject: Re: [PATCH 1/2] PNPACPI: cope with invalid device IDs

On Friday, September 17, 2010 03:37:31 pm Bjorn Helgaas wrote:
> On Friday, June 04, 2010 08:24:04 pm Dmitry Torokhov wrote:
> > If primary ID (HID) is invalid try locating first valid ID on compatible
> > ID list before giving up.
> > 
> > This helps, for example, to recognize i8042 AUX port on Sony Vaio VPCZ1
> > which uses SNYSYN0003 as HID. Without the patch users are forced to
> > boot with i8042.nopnp to make use of their touchpads.
> 
> Sorry, we seem to have dropped the ball on this.  Looking at it again,
> 
> I have another question below:
> >  drivers/pnp/pnpacpi/core.c |   29 ++++++++++++++++++++++++-----
> >  1 files changed, 24 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c
> > index f7ff628..2029cb5 100644
> > --- a/drivers/pnp/pnpacpi/core.c
> > +++ b/drivers/pnp/pnpacpi/core.c
> > @@ -28,7 +28,7 @@
> > 
> >  #include "../base.h"
> >  #include "pnpacpi.h"
> > 
> > -static int num = 0;
> > +static int num;
> > 
> >  /* We need only to blacklist devices that have already an acpi driver
> >  that
> >  
> >   * can't use pnp layer. We don't need to blacklist device that are
> >   directly
> > 
> > @@ -157,11 +157,24 @@ struct pnp_protocol pnpacpi_protocol = {
> > 
> >  };
> >  EXPORT_SYMBOL(pnpacpi_protocol);
> > 
> > +static char *pnpacpi_get_id(struct acpi_device *device)
> > +{
> > +	struct acpi_hardware_id *id;
> > +
> > +	list_for_each_entry(id, &device->pnp.ids, list) {
> > +		if (ispnpidacpi(id->id))
> > +			return id->id;
> > +	}
> > +
> > +	return NULL;
> > +}
> > +
> > 
> >  static int __init pnpacpi_add_device(struct acpi_device *device)
> >  {
> >  
> >  	acpi_handle temp = NULL;
> >  	acpi_status status;
> >  	struct pnp_dev *dev;
> > 
> > +	char *pnpid;
> > 
> >  	struct acpi_hardware_id *id;
> >  	
> >  	/*
> > 
> > @@ -169,11 +182,17 @@ static int __init pnpacpi_add_device(struct
> > acpi_device *device)
> > 
> >  	 * driver should not be loaded.
> >  	 */
> >  	
> >  	status = acpi_get_handle(device->handle, "_CRS", &temp);
> > 
> > -	if (ACPI_FAILURE(status) || !ispnpidacpi(acpi_device_hid(device)) ||
> > -	    is_exclusive_device(device) || (!device->status.present))
> > +	if (ACPI_FAILURE(status))
> > +		return 0;
> > +
> > +	pnpid = pnpacpi_get_id(device);
> > +	if (!pnpid)
> > +		return 0;
> > +
> > +	if (!is_exclusive_device(device) || !device->status.present)
> > 
> >  		return 0;
> 
> Doesn't this change the sense of the is_exclusive_device() test?

Yes, it does, "!" shoudl be dropped.

OTOH maybe we should keep the "primary" ID as is (so SYNSYN0003 would
still be _the_ id) but only refuse device if none of it's IDs (neither
_HID nor _CID) satisfy ispnpidacpi() requirements.

Thanks.

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ