Skip to content

Commit

Permalink
fix oops on rmmod capidrv
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Karsten Keil authored and Linus Torvalds committed Jan 25, 2008
1 parent 4991408 commit eb36f4f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/isdn/capi/capidrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, " ??? ");
}
Expand Down

0 comments on commit eb36f4f

Please sign in to comment.