Skip to content
Snippets Groups Projects
Commit 127c03cd authored by Dominik Brodowski's avatar Dominik Brodowski
Browse files

pcmcia: avoid buffer overflow in pcmcia_setup_isa_irq


NR_IRQS may be as low as 16, causing a (harmless?) buffer overflow in
pcmcia_setup_isa_irq():

static u8 pcmcia_used_irq[NR_IRQS];

...

		if ((try < 32) && pcmcia_used_irq[irq])
			continue;

This is read-only, so if this address would be non-zero, it would just
mean we would not attempt an IRQ >= NR_IRQS -- which would fail anyway!
And as request_irq() fails for an irq >= NR_IRQS, the setting code path:

			pcmcia_used_irq[irq]++;

is never reached as well.

Reported-by: default avatarChristoph Fritz <chf.fritz@googlemail.com>
CC: stable@kernel.org
Signed-off-by: default avatarDominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: default avatarChristoph Fritz <chf.fritz@googlemail.com>
parent 0f52e86d
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment