Skip to content

Commit b5da920

Browse files
author
deraadt
committed
On user/kernel shared page table machines, do not let processes map their
own page 0, as discussed with miod (and many others previously, including art and toby). On sparc, make this __LDPGSZ because PAGE_SIZE is non-constant ok miod tedu
1 parent 62202a9 commit b5da920

File tree

8 files changed

+16
-16
lines changed

8 files changed

+16
-16
lines changed

sys/arch/alpha/include/vmparam.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: vmparam.h,v 1.14 2005/04/11 15:12:59 deraadt Exp $ */
1+
/* $OpenBSD: vmparam.h,v 1.15 2008/06/24 21:24:01 deraadt Exp $ */
22
/* $NetBSD: vmparam.h,v 1.18 2000/05/22 17:13:54 thorpej Exp $ */
33

44
/*
@@ -102,7 +102,7 @@
102102
*/
103103

104104
/* user/kernel map constants */
105-
#define VM_MIN_ADDRESS ((vaddr_t)ALPHA_USEG_BASE) /* 0 */
105+
#define VM_MIN_ADDRESS ((vaddr_t)PAGE_SIZE)
106106
#define VM_MAXUSER_ADDRESS ((vaddr_t)(ALPHA_USEG_END + 1L)) /* 4T */
107107
#define VM_MAX_ADDRESS VM_MAXUSER_ADDRESS
108108
#define VM_MIN_KERNEL_ADDRESS ((vaddr_t)ALPHA_K1SEG_BASE)

sys/arch/amd64/include/vmparam.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: vmparam.h,v 1.8 2008/06/10 02:55:39 weingart Exp $ */
1+
/* $OpenBSD: vmparam.h,v 1.9 2008/06/24 21:24:03 deraadt Exp $ */
22
/* $NetBSD: vmparam.h,v 1.1 2003/04/26 18:39:49 fvdl Exp $ */
33

44
/*-
@@ -88,7 +88,7 @@
8888
*/
8989

9090
/* user/kernel map constants */
91-
#define VM_MIN_ADDRESS 0
91+
#define VM_MIN_ADDRESS PAGE_SIZE
9292
#define VM_MAXUSER_ADDRESS 0x00007f7fffffc000
9393
#define VM_MAX_ADDRESS 0x00007fbfdfeff000
9494
#define VM_MIN_KERNEL_ADDRESS 0xffff800000000000

sys/arch/arm/include/vmparam.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: vmparam.h,v 1.3 2005/04/11 15:13:01 deraadt Exp $ */
1+
/* $OpenBSD: vmparam.h,v 1.4 2008/06/24 21:24:03 deraadt Exp $ */
22
/* $NetBSD: vmparam.h,v 1.18 2003/05/21 18:04:44 thorpej Exp $ */
33

44
/*
@@ -91,7 +91,7 @@
9191
/*
9292
* Mach derived constants
9393
*/
94-
#define VM_MIN_ADDRESS ((vaddr_t) 0x00001000)
94+
#define VM_MIN_ADDRESS ((vaddr_t) PAGE_SIZE)
9595
#define VM_MAXUSER_ADDRESS ((vaddr_t) ARM_KERNEL_BASE)
9696
#define VM_MAX_ADDRESS VM_MAXUSER_ADDRESS
9797

sys/arch/i386/include/vmparam.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: vmparam.h,v 1.39 2007/06/01 18:57:02 miod Exp $ */
1+
/* $OpenBSD: vmparam.h,v 1.40 2008/06/24 21:24:03 deraadt Exp $ */
22
/* $NetBSD: vmparam.h,v 1.15 1994/10/27 04:16:34 cgd Exp $ */
33

44
/*-
@@ -96,7 +96,7 @@
9696
#define DEADBEEF1 0xefffaabb /* pool's filler */
9797

9898
/* user/kernel map constants */
99-
#define VM_MIN_ADDRESS ((vaddr_t)0)
99+
#define VM_MIN_ADDRESS ((vaddr_t)PAGE_SIZE)
100100
#define VM_MAXUSER_ADDRESS ((vaddr_t)((PDSLOT_PTE<<PDSHIFT) - USPACE))
101101
#define VM_MAX_ADDRESS ((vaddr_t)((PDSLOT_PTE<<PDSHIFT) + \
102102
(PDSLOT_PTE<<PGSHIFT)))

sys/arch/sh/include/vmparam.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: vmparam.h,v 1.4 2007/09/02 21:18:08 hshoexer Exp $ */
1+
/* $OpenBSD: vmparam.h,v 1.5 2008/06/24 21:24:03 deraadt Exp $ */
22
/* $NetBSD: vmparam.h,v 1.17 2006/03/04 01:55:03 uwe Exp $ */
33

44
/*-
@@ -42,7 +42,7 @@
4242
#include <sys/queue.h>
4343

4444
/* Virtual address map. */
45-
#define VM_MIN_ADDRESS ((vaddr_t)0)
45+
#define VM_MIN_ADDRESS ((vaddr_t)PAGE_SIZE)
4646
#define VM_MAXUSER_ADDRESS ((vaddr_t)0x7ffff000)
4747
#define VM_MAX_ADDRESS ((vaddr_t)0x7ffff000)
4848
#define VM_MIN_KERNEL_ADDRESS ((vaddr_t)0xc0000000)

sys/arch/sh/sh/trap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: trap.c,v 1.12 2007/03/15 10:22:29 art Exp $ */
1+
/* $OpenBSD: trap.c,v 1.13 2008/06/24 21:24:03 deraadt Exp $ */
22
/* $NetBSD: exception.c,v 1.32 2006/09/04 23:57:52 uwe Exp $ */
33
/* $NetBSD: syscall.c,v 1.6 2006/03/07 07:21:50 thorpej Exp $ */
44

@@ -510,7 +510,7 @@ cachectl(struct proc *p, struct trapframe *tf)
510510
va = (vaddr_t)tf->tf_r4;
511511
len = (vsize_t)tf->tf_r5;
512512

513-
if (/* va < VM_MIN_ADDRESS || */ va >= VM_MAXUSER_ADDRESS ||
513+
if (va < VM_MIN_ADDRESS || va >= VM_MAXUSER_ADDRESS ||
514514
va + len <= va || va + len >= VM_MAXUSER_ADDRESS)
515515
len = 0;
516516

sys/arch/sparc/include/vmparam.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: vmparam.h,v 1.31 2005/04/17 18:47:48 miod Exp $ */
1+
/* $OpenBSD: vmparam.h,v 1.32 2008/06/24 21:24:03 deraadt Exp $ */
22
/* $NetBSD: vmparam.h,v 1.13 1997/07/12 16:20:03 perry Exp $ */
33

44
/*
@@ -89,7 +89,7 @@
8989
* IO space virtual base, which must be the same as VM_MAX_KERNEL_ADDRESS:
9090
* tread with care.
9191
*/
92-
#define VM_MIN_ADDRESS ((vaddr_t)0)
92+
#define VM_MIN_ADDRESS ((vaddr_t)__LDPGSZ)
9393
#define VM_MAX_ADDRESS ((vaddr_t)VM_MIN_KERNEL_ADDRESS)
9494
#define VM_MAXUSER_ADDRESS ((vaddr_t)VM_MIN_KERNEL_ADDRESS)
9595
#define VM_MIN_KERNEL_ADDRESS ((vaddr_t)KERNBASE)

sys/arch/vax/include/vmparam.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: vmparam.h,v 1.28 2007/04/22 10:05:51 miod Exp $ */
1+
/* $OpenBSD: vmparam.h,v 1.29 2008/06/24 21:24:03 deraadt Exp $ */
22
/* $NetBSD: vmparam.h,v 1.32 2000/03/07 00:05:59 matt Exp $ */
33

44
/*-
@@ -97,7 +97,7 @@
9797
#define vax_trunc_page(x) ((vaddr_t)(x) & ~VAX_PGOFSET)
9898

9999
/* user/kernel map constants */
100-
#define VM_MIN_ADDRESS ((vaddr_t)0)
100+
#define VM_MIN_ADDRESS ((vaddr_t)PAGE_SIZE)
101101
#define VM_MAXUSER_ADDRESS ((vaddr_t)KERNBASE)
102102
#define VM_MAX_ADDRESS ((vaddr_t)KERNBASE)
103103
#define VM_MIN_KERNEL_ADDRESS ((vaddr_t)KERNBASE)

0 commit comments

Comments
 (0)