mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] fix oops on rmmod capidrv
@ 2008-01-24 16:50 Gerd v. Egidy
  2008-04-29 13:27 ` Gerd v. Egidy
  0 siblings, 1 reply; 3+ messages in thread
From: Gerd v. Egidy @ 2008-01-24 16:50 UTC (permalink / raw)
  To: linux-kernel; +Cc: kkeil, kai.germaschewski, isdn4linux

Hi,

I think the patch below fixes a long-standing bug on rmmod capidrv. Please 
apply.

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>

diff -r -u linux-2.6.23.orig/drivers/isdn/capi/capidrv.c 
linux-2.6.23/drivers/isdn/capi/capidrv.c
--- linux-2.6.23.orig/drivers/isdn/capi/capidrv.c	Tue Oct  9 22:31:38 2007
+++ linux-2.6.23/drivers/isdn/capi/capidrv.c	Thu Jan 24 16:47:55 2008
@@ -2306,13 +2306,14 @@
 
 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, " ??? ");
 	}

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] fix oops on rmmod capidrv
  2008-01-24 16:50 [PATCH] fix oops on rmmod capidrv Gerd v. Egidy
@ 2008-04-29 13:27 ` Gerd v. Egidy
  2008-04-29 16:50   ` [stable] " Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Gerd v. Egidy @ 2008-04-29 13:27 UTC (permalink / raw)
  To: linux-kernel; +Cc: stable

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [stable] [PATCH] fix oops on rmmod capidrv
  2008-04-29 13:27 ` Gerd v. Egidy
@ 2008-04-29 16:50   ` Greg KH
  0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2008-04-29 16:50 UTC (permalink / raw)
  To: Gerd v. Egidy; +Cc: linux-kernel, stable

On Tue, Apr 29, 2008 at 03:27:29PM +0200, Gerd v. Egidy wrote:
> 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.

Now added to the queue.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-04-29 17:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-24 16:50 [PATCH] fix oops on rmmod capidrv Gerd v. Egidy
2008-04-29 13:27 ` Gerd v. Egidy
2008-04-29 16:50   ` [stable] " Greg KH

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®