Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Don't validate buffer size for tape I/O, this is al...



details:   https://anonhg.NetBSD.org/src/rev/03afad978a1c
branches:  trunk
changeset: 840360:03afad978a1c
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Thu Apr 04 12:26:45 2019 +0000

description:
Don't validate buffer size for tape I/O, this is already done by
the tape driver. Using MAXBSIZE as limit was also wrong on sun2 where
MAXBSIZE < MAXPHYS.

diffstat:

 sys/kern/kern_physio.c |  11 ++---------
 1 files changed, 2 insertions(+), 9 deletions(-)

diffs (32 lines):

diff -r 9d8a22390241 -r 03afad978a1c sys/kern/kern_physio.c
--- a/sys/kern/kern_physio.c    Thu Apr 04 11:49:06 2019 +0000
+++ b/sys/kern/kern_physio.c    Thu Apr 04 12:26:45 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_physio.c,v 1.94 2019/03/26 09:33:58 mlelstv Exp $ */
+/*     $NetBSD: kern_physio.c,v 1.95 2019/04/04 12:26:45 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -71,7 +71,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_physio.c,v 1.94 2019/03/26 09:33:58 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_physio.c,v 1.95 2019/04/04 12:26:45 mlelstv Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -317,13 +317,6 @@
                                 */
                                bp->b_bcount = MIN(MAXPHYS, iovp->iov_len);
                        } else {
-                               /*
-                                * Verify that buffer can handle size
-                                */
-                               if (iovp->iov_len > MAXBSIZE) {
-                                       error = EINVAL;
-                                       goto done;
-                               }
                                bp->b_bcount = iovp->iov_len;
                        }
                        bp->b_data = iovp->iov_base;



Home | Main Index | Thread Index | Old Index