Module Name:    src
Committed By:   riz
Date:           Fri Jan  7 01:35:05 UTC 2011

Modified Files:
        src/sys/dev [netbsd-5]: rnd.c

Log Message:
Pull up following revision(s) (requested by pooka in ticket #1502):
        sys/dev/rnd.c: revision 1.79
Don't allow "goes to 11^H^Hhyperspace" len field for RNDADDATA.


To generate a diff of this commit:
cvs rdiff -u -r1.71.4.2 -r1.71.4.3 src/sys/dev/rnd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/rnd.c
diff -u src/sys/dev/rnd.c:1.71.4.2 src/sys/dev/rnd.c:1.71.4.3
--- src/sys/dev/rnd.c:1.71.4.2	Sun Nov 15 05:46:23 2009
+++ src/sys/dev/rnd.c	Fri Jan  7 01:35:05 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rnd.c,v 1.71.4.2 2009/11/15 05:46:23 snj Exp $	*/
+/*	$NetBSD: rnd.c,v 1.71.4.3 2011/01/07 01:35:05 riz Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rnd.c,v 1.71.4.2 2009/11/15 05:46:23 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rnd.c,v 1.71.4.3 2011/01/07 01:35:05 riz Exp $");
 
 #include <sys/param.h>
 #include <sys/ioctl.h>
@@ -636,6 +636,9 @@
 	case RNDADDDATA:
 		rnddata = (rnddata_t *)addr;
 
+		if (rnddata->len > sizeof(rnddata->data))
+			return E2BIG;
+
 		mutex_enter(&rndpool_mtx);
 		rndpool_add_data(&rnd_pool, rnddata->data, rnddata->len,
 		    rnddata->entropy);

Reply via email to