diff options
author | Alexander Kabaev <kan@FreeBSD.org> | 2007-05-19 04:53:14 +0000 |
---|---|---|
committer | Alexander Kabaev <kan@FreeBSD.org> | 2007-05-19 04:53:14 +0000 |
commit | ee9f46615e42ef00718be3e76807d63d2b37c244 (patch) | |
tree | cdd8870b9c8f2a324e8212d4906223bc8c7df8a4 /sys/kern/kern_mib.c | |
parent | da3bcc92c1cdc1fb4253b1f9185d429a84564185 (diff) |
Add kern.arnd sysctl. SSP code uses it to initialize the stack guard
magic value.
Submitted by: Jeremie Le Hen <jeremie@le-hen.org>
Notes
Notes:
svn path=/head/; revision=169727
Diffstat (limited to 'sys/kern/kern_mib.c')
-rw-r--r-- | sys/kern/kern_mib.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/kern/kern_mib.c b/sys/kern/kern_mib.c index 707afd8490f1..5d14529f9813 100644 --- a/sys/kern/kern_mib.c +++ b/sys/kern/kern_mib.c @@ -152,6 +152,18 @@ SYSCTL_INT(_hw, HW_PAGESIZE, pagesize, CTLFLAG_RD, 0, PAGE_SIZE, "System memory page size"); static int +sysctl_kern_arnd(SYSCTL_HANDLER_ARGS) +{ + u_long val; + + arc4rand(&val, sizeof(val), 0); + return (sysctl_handle_long(oidp, &val, 0, req)); +} + +SYSCTL_PROC(_kern, KERN_ARND, arandom, CTLFLAG_RD, + 0, 0, sysctl_kern_arnd, "L", "arc4rand"); + +static int sysctl_hw_physmem(SYSCTL_HANDLER_ARGS) { u_long val; |