Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Feb 1997 08:00:59 -0800 (PST)
From:      Mike Pritchard <mpp>
To:        gdonl@tsc.tdk.com, mpp, freebsd-bugs
Subject:   Re: kern/2675
Message-ID:  <199702061600.IAA04384@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
Synopsis: lkmcioctl() is not consistent and careful with module names

State-Changed-From-To: open-analyzed
State-Changed-By: mpp
State-Changed-When: Thu Feb 6 07:59:15 PST 1997
State-Changed-Why: 
At least following patches should probably be applied.
Note:  I can't test them, so I'm not taking resposibility for this
PR.

Index: kern_lkm.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/kern_lkm.c,v
retrieving revision 1.33
diff -u -r1.33 kern_lkm.c
--- kern_lkm.c	1997/01/14 06:43:23	1.33
+++ kern_lkm.c	1997/02/06 15:46:44
@@ -424,7 +424,9 @@
 			 * Copy name and lookup id from all loaded
 			 * modules.
 			 */
-		 	copystr(statp->name, istr, MAXLKMNAME-1, NULL);
+		 	err = copyinstr(statp->name, istr, MAXLKMNAME-1, NULL);
+			if (err)
+				break;
 			/*
 			 * look up id...
 			 */
@@ -469,7 +471,7 @@
 		statp->ver	= curp->private.lkm_any->lkm_ver;
 		copystr(curp->private.lkm_any->lkm_name,
 			  statp->name,
-			  MAXLKMNAME - 2,
+			  MAXLKMNAME - 1,
 			  NULL);
 
 		break;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199702061600.IAA04384>