summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarsten Keil <kkeil@suse.de>2008-01-25 11:55:28 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2008-05-01 14:48:59 -0700
commitd86fc5ca7bb6b952151e7e671349d312060f20d7 (patch)
tree8f26b72ee6c080ed65b422d5513b8aa5fd4bb338
parent1a825fd5424d59bdd791491a952ede2f99dae24c (diff)
downloadkernel-common-d86fc5ca7bb6b952151e7e671349d312060f20d7.tar.gz
kernel-common-d86fc5ca7bb6b952151e7e671349d312060f20d7.tar.bz2
kernel-common-d86fc5ca7bb6b952151e7e671349d312060f20d7.zip
fix oops on rmmod capidrv
commit eb36f4fc019835cecf0788907f6cab774508087b upstream. 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>
-rw-r--r--drivers/isdn/capi/capidrv.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/isdn/capi/capidrv.c b/drivers/isdn/capi/capidrv.c
index 48c1775ef5b3..cb42b690b45e 100644
--- a/drivers/isdn/capi/capidrv.c
+++ b/drivers/isdn/capi/capidrv.c
@@ -2332,13 +2332,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, " ??? ");
}