Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern Fix stack allocation; limit delta to a quarter of t...
details: https://anonhg.NetBSD.org/src/rev/0f2bc225f576
branches: trunk
changeset: 345124:0f2bc225f576
user: christos <christos%NetBSD.org@localhost>
date: Sun May 08 20:01:56 2016 +0000
description:
Fix stack allocation; limit delta to a quarter of the stack size. This should
get rid of the random aborts.
diffstat:
sys/kern/kern_pax.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diffs (28 lines):
diff -r d9f8fe3fd938 -r 0f2bc225f576 sys/kern/kern_pax.c
--- a/sys/kern/kern_pax.c Sun May 08 20:00:21 2016 +0000
+++ b/sys/kern/kern_pax.c Sun May 08 20:01:56 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_pax.c,v 1.42 2016/05/08 01:28:09 christos Exp $ */
+/* $NetBSD: kern_pax.c,v 1.43 2016/05/08 20:01:56 christos Exp $ */
/*
* Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_pax.c,v 1.42 2016/05/08 01:28:09 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_pax.c,v 1.43 2016/05/08 20:01:56 christos Exp $");
#include "opt_pax.h"
@@ -564,7 +564,8 @@
rand = pax_aslr_rand;
#endif
u_long d = PAX_ASLR_DELTA(rand, PAX_ASLR_DELTA_STACK_LSB, len);
- u_long newminsaddr = (u_long)STACK_ALLOC(epp->ep_minsaddr, d);
+ d &= (*max_stack_size / 4) - 1;
+ u_long newminsaddr = (u_long)STACK_GROW(epp->ep_minsaddr, d);
PAX_DPRINTF("old minsaddr=%#jx delta=%#lx new minsaddr=%#lx",
(uintmax_t)epp->ep_minsaddr, d, newminsaddr);
epp->ep_minsaddr = (vaddr_t)newminsaddr;
Home |
Main Index |
Thread Index |
Old Index