Source-Changes-HG archive

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

[src/trunk]: src/sys/kern in extent_alloc_subregion1(), check for EXTENT_ALIG...



details:   https://anonhg.NetBSD.org/src/rev/9c2f951fb3dd
branches:  trunk
changeset: 488005:9c2f951fb3dd
user:      mrg <mrg%NetBSD.org@localhost>
date:      Fri Jun 16 16:48:56 2000 +0000

description:
in extent_alloc_subregion1(), check for EXTENT_ALIGN() overflow when
doing the boundary-case check.  approved by thorpej.

diffstat:

 sys/kern/subr_extent.c |  12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diffs (33 lines):

diff -r d04cab0b63c8 -r 9c2f951fb3dd sys/kern/subr_extent.c
--- a/sys/kern/subr_extent.c    Fri Jun 16 16:33:06 2000 +0000
+++ b/sys/kern/subr_extent.c    Fri Jun 16 16:48:56 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_extent.c,v 1.31 2000/06/06 17:32:50 thorpej Exp $ */
+/*     $NetBSD: subr_extent.c,v 1.32 2000/06/16 16:48:56 mrg Exp $     */
 
 /*-
  * Copyright (c) 1996, 1998 The NetBSD Foundation, Inc.
@@ -673,7 +673,10 @@
                                    boundary, dontcross);
 #endif
 
-                               if (newend > dontcross) {
+                               /* Check for overflow */
+                               if (dontcross < ex->ex_start)
+                                       dontcross = ex->ex_end;
+                               else if (newend > dontcross) {
                                        /*
                                         * Candidate region crosses boundary.
                                         * Throw away the leading part and see
@@ -764,7 +767,10 @@
                            boundary, dontcross);
 #endif
 
-                       if (newend > dontcross) {
+                       /* Check for overflow */
+                       if (dontcross < ex->ex_start)
+                               dontcross = ex->ex_end;
+                       else if (newend > dontcross) {
                                /*
                                 * Candidate region crosses boundary.
                                 * Throw away the leading part and see



Home | Main Index | Thread Index | Old Index