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]
Message-ID: <20181206175708.GB11808@roeck-us.net>
Date:   Thu, 6 Dec 2018 09:57:08 -0800
From:   Guenter Roeck <linux@...ck-us.net>
To:     Jerry Hoemann <jerry.hoemann@....com>
Cc:     wim@...ux-watchdog.org, linux-watchdog@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/3] watchdog/hpwdt: Exclude via blacklist

On Wed, Dec 05, 2018 at 05:42:21PM -0700, Jerry Hoemann wrote:
> Instead of having explicit if statments excluding devices,
> use a pci_device_id table of devices to blacklist.
> 
> Signed-off-by: Jerry Hoemann <jerry.hoemann@....com>

Reviewed-by: Guenter Roeck <linux@...ck-us.net>

> ---
>  drivers/watchdog/hpwdt.c | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c
> index 9356230..eecd014 100644
> --- a/drivers/watchdog/hpwdt.c
> +++ b/drivers/watchdog/hpwdt.c
> @@ -50,6 +50,10 @@
>  };
>  MODULE_DEVICE_TABLE(pci, hpwdt_devices);
>  
> +static const struct pci_device_id hpwdt_blacklist[] = {
> +	{ PCI_DEVICE_SUB(PCI_VENDOR_ID_HP, 0x3306, PCI_VENDOR_ID_HP, 0x1979) }, /* auxilary iLO */
> +	{0},			/* terminate list */
> +};
>  
>  /*
>   *	Watchdog operations
> @@ -274,12 +278,10 @@ static int hpwdt_init_one(struct pci_dev *dev,
>  		return -ENODEV;
>  	}
>  
> -	/*
> -	 * Ignore all auxilary iLO devices with the following PCI ID
> -	 */
> -	if (dev->subsystem_vendor == PCI_VENDOR_ID_HP &&
> -	    dev->subsystem_device == 0x1979)
> +	if (pci_match_id(hpwdt_blacklist, dev)) {
> +		dev_dbg(&dev->dev, "Not supported on this device\n");
>  		return -ENODEV;
> +	}
>  
>  	if (pci_enable_device(dev)) {
>  		dev_warn(&dev->dev,
> -- 
> 1.8.3.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ