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: <20160122175332.GA11004@localhost>
Date:	Fri, 22 Jan 2016 11:53:32 -0600
From:	Bjorn Helgaas <helgaas@...nel.org>
To:	"Rafael J. Wysocki" <rafael@...nel.org>
Cc:	Cao jin <caoj.fnst@...fujitsu.com>,
	"Rafael J. Wysocki" <rjw@...ysocki.net>,
	Chen Fan <chen.fan.fnst@...fujitsu.com>,
	ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Len Brown <lenb@...nel.org>, izumi.taku@...fujitsu.com,
	wency@...fujitsu.com, Bjorn Helgaas <bhelgaas@...gle.com>,
	Linux PCI <linux-pci@...r.kernel.org>,
	Jiang Liu <jiang.liu@...ux.intel.com>
Subject: Re: [PATCH] pci: fix unavailable irq number 255 reported by BIOS

On Thu, Jan 21, 2016 at 11:58:26PM +0100, Rafael J. Wysocki wrote:
> On Thu, Jan 21, 2016 at 3:41 PM, Cao jin <caoj.fnst@...fujitsu.com> wrote:
> > Hi,
> >
> >     IMHO, I think maybe modification on i801_smbus driver is easier.
> >
> >     Because when i801_smbus request_irq using pci_dev->irq, this
> > pci_dev->irq seems still holds the value read from register(
> > pci_setup_device->pci_read_irq), if the value is 255, it is invalid in
> > register,
> 
> Right.
> 
> Which is why the PCI core should not leak it into the driver's ->probe callback.

Is there a reserved IRQ value we could use to mean "invalid"?

I guess we have NR_IRQS as a ceiling, so the range of valid IRQs would be
[0 .. NR_IRQS - 1].  It looks like irq_desc() and a few drivers already
rely on NR_IRQS being the bound:

  lpc32xx_kscan_probe
  lpc32xx_nand_probe
  pcmcia_setup_isa_irq
  lpc32xx_rtc_probe
  apbuart_verify_port
  ar933x_uart_verify_port
  lqasc_verify_port

So I guess we could use ~0 as "invalid IRQ", and maybe the PCI core could
set dev->irq to ~0 in these cases, and drivers like i801_smbus could check
for that.  Maybe a wrapper like irq_valid() would be useful.

Bjorn

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ