public inbox for linux-next@vger.kernel.org
 help / color / mirror / Atom feed
From: Dominik Brodowski <linux@dominikbrodowski.net>
To: Christoph Fritz <chf.fritz@googlemail.com>,
	linux-pcmcia@lists.infradead.org,
	linux-next <linux-next@vger.kernel.org>
Subject: Re: [PATCH] pcmcia: avoid buffer overflow in pcmcia_setup_isa_irq
Date: Tue, 3 Aug 2010 09:42:57 +0200	[thread overview]
Message-ID: <20100803074257.GA28420@comet.dominikbrodowski.net> (raw)
In-Reply-To: <20100803074022.GA28158@comet.dominikbrodowski.net>

The corresponding fix for 2.6.34 and earlier would be:

diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index 7c3d03b..cfcf868 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -41,7 +41,7 @@ module_param(io_speed, int, 0444);
 #ifdef CONFIG_PCMCIA_PROBE
 #include <asm/irq.h>
 /* mask of IRQs already reserved by other cards, we should avoid using them */
-static u8 pcmcia_used_irq[NR_IRQS];
+static u8 pcmcia_used_irq[32];
 #endif
 
 static int pcmcia_adjust_io_region(struct resource *res, unsigned long start,
@@ -768,6 +768,9 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
 		for (try = 0; try < 64; try++) {
 			irq = try % 32;
 
+			if (irq > NR_IRQS)
+				continue;
+
 			/* marked as available by driver, and not blocked by userspace? */
 			if (!((mask >> irq) & 1))
 				continue;

  reply	other threads:[~2010-08-03  7:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-03  0:38 [BUG -next] pcmcia: setup IRQ to be used by PCMCIA drivers at card insert Christoph Fritz
2010-08-03  6:17 ` Dominik Brodowski
2010-08-03 10:23   ` Christoph Fritz
2010-08-03  7:40 ` [PATCH] pcmcia: avoid buffer overflow in pcmcia_setup_isa_irq Dominik Brodowski
2010-08-03  7:42   ` Dominik Brodowski [this message]
2010-08-03 10:26   ` Christoph Fritz

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=20100803074257.GA28420@comet.dominikbrodowski.net \
    --to=linux@dominikbrodowski.net \
    --cc=chf.fritz@googlemail.com \
    --cc=linux-next@vger.kernel.org \
    --cc=linux-pcmcia@lists.infradead.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