Commit eb36f4fc authored by Karsten Keil's avatar Karsten Keil Committed by Linus Torvalds

fix oops on rmmod capidrv

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: default avatarGerd v. Egidy <gerd.von.egidy@intra2net.com>
Acked-by: default avatarKarsten Keil <kkeil@suse.de>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 49914084
......@@ -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, " ??? ");
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment