Module Name:    src
Committed By:   rin
Date:           Mon Oct 11 14:36:05 UTC 2021

Modified Files:
        src/sys/arch/hpcarm/hpcarm: sa11x0_hpc_machdep.c

Log Message:
alloc_pages: panic if allocating beyond KERNEL_TEXT_BASE.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.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/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.c
diff -u src/sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.c:1.20 src/sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.c:1.21
--- src/sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.c:1.20	Mon Oct 11 14:33:31 2021
+++ src/sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.c	Mon Oct 11 14:36:05 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: sa11x0_hpc_machdep.c,v 1.20 2021/10/11 14:33:31 rin Exp $	*/
+/*	$NetBSD: sa11x0_hpc_machdep.c,v 1.21 2021/10/11 14:36:05 rin Exp $	*/
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sa11x0_hpc_machdep.c,v 1.20 2021/10/11 14:33:31 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sa11x0_hpc_machdep.c,v 1.21 2021/10/11 14:36:05 rin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_dram_pages.h"
@@ -286,6 +286,8 @@ init_sa11x0(int argc, char **argv, struc
     do {								\
 	(var) = freemempos;						\
 	freemempos += (np) * PAGE_SIZE;					\
+	if (freemempos > KERNEL_TEXT_BASE)				\
+		panic("%s: out of memory", __func__);			\
     } while (0)
 
 	valloc_pages(kernel_l1pt, L1_TABLE_SIZE / PAGE_SIZE);

Reply via email to