public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Osterlund <petero2@telia.com>
To: Michal Piotrowski <michal.k.k.piotrowski@gmail.com>
Cc: Andrew Morton <akpm@osdl.org>, linux-kernel@vger.kernel.org
Subject: Re: 2.6.14-mm2 OOPS - packet writing
Date: 12 Nov 2005 14:52:58 +0100	[thread overview]
Message-ID: <m3fyq2ug5h.fsf@telia.com> (raw)
In-Reply-To: <6bffcb0e0511111601j6c53f646m@mail.gmail.com>

Michal Piotrowski <michal.k.k.piotrowski@gmail.com> writes:

> On 11/11/05, Andrew Morton <akpm@osdl.org> wrote:
> >
> > ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.14/2.6.14-mm2/
> 
> Oops while cat /proc/driver/pktcdvd/pktcdvd0
> 
> Linux version 2.6.14-mm2 (michal@debian) (gcc version 4.0.3 20051023

There is an old bug in the pkt_count_states() function that causes
stack corruption. When compiling with gcc 3.x or 2.x it is harmless,
but gcc 4 allocates local variables differently, which makes the bug
visible. Fixed by this patch.

Signed-off-by: Peter Osterlund <petero2@telia.com>
---

 drivers/block/pktcdvd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index 391ced8..b5f67b1 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -1188,7 +1188,7 @@ static void pkt_count_states(struct pktc
 	struct packet_data *pkt;
 	int i;
 
-	for (i = 0; i <= PACKET_NUM_STATES; i++)
+	for (i = 0; i < PACKET_NUM_STATES; i++)
 		states[i] = 0;
 
 	spin_lock(&pd->cdrw.active_list_lock);

-- 
Peter Osterlund - petero2@telia.com
http://web.telia.com/~u89404340

  reply	other threads:[~2005-11-12 13:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-12  0:01 2.6.14-mm2 OOPS - packet writing Michal Piotrowski
2005-11-12 13:52 ` Peter Osterlund [this message]
2005-11-12 22:28   ` Michal Piotrowski

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=m3fyq2ug5h.fsf@telia.com \
    --to=petero2@telia.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.k.k.piotrowski@gmail.com \
    /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