mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Gerd v. Egidy" <gerd.von.egidy@intra2net.com>
To: linux-kernel@vger.kernel.org
Cc: stable@kernel.org
Subject: Re: [PATCH] fix oops on rmmod capidrv
Date: Tue, 29 Apr 2008 15:27:29 +0200	[thread overview]
Message-ID: <200804291527.29611.gerd.von.egidy@intra2net.com> (raw)
In-Reply-To: <200801241750.14669.gerd.von.egidy@intra2net.com>

Hi,

my patch below was added to 2.6.23.15 and linus tree that became 2.6.25, but 
was too late for 2.6.24. So if you consider another stable release for 2.6.24 
you might want to add that patch too.

Kind regards,

Gerd

Fix overwriting the stack with the version string
(it is currently 10 bytes + zero) when unloading the
capidrv module. Safeguard against overwriting it
should the version string grow in the future.

Should fix Kernel Bug Tracker Bug 9696.

Signed-off-by: Gerd v. Egidy <gerd.von.egidy@intra2net.com>
Acked-by: Karsten Keil <kkeil@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

--- a/drivers/isdn/capi/capidrv.c
+++ b/drivers/isdn/capi/capidrv.c
@@ -2306,13 +2306,14 @@ static int __init capidrv_init(void)
 
 static void __exit capidrv_exit(void)
 {
-	char rev[10];
+	char rev[32];
 	char *p;
 
 	if ((p = strchr(revision, ':')) != 0) {
-		strcpy(rev, p + 1);
-		p = strchr(rev, '$');
-		*p = 0;
+		strncpy(rev, p + 1, sizeof(rev));
+		rev[sizeof(rev)-1] = 0;
+		if ((p = strchr(rev, '$')) != 0)
+			*p = 0;
 	} else {
 		strcpy(rev, " ??? ");
 	}


-- 
Address (better: trap) for people I really don't want to get mail from:
joanne@cactusamerica.com

  reply	other threads:[~2008-04-29 13:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-24 16:50 Gerd v. Egidy
2008-04-29 13:27 ` Gerd v. Egidy [this message]
2008-04-29 16:50   ` [stable] " Greg KH

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=200804291527.29611.gerd.von.egidy@intra2net.com \
    --to=gerd.von.egidy@intra2net.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@kernel.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

all inboxes | Powered by JetHome®