Add kern.arnd sysctl. SSP code uses it to initialize the stack guard

magic value.

Submitted by: Jeremie Le Hen <jeremie@le-hen.org>
This commit is contained in:
Alexander Kabaev 2007-05-19 04:53:14 +00:00
parent da3bcc92c1
commit ee9f46615e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=169727
2 changed files with 14 additions and 1 deletions

View File

@ -151,6 +151,18 @@ SYSCTL_INT(_hw, HW_BYTEORDER, byteorder, CTLFLAG_RD,
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)
{

View File

@ -390,7 +390,8 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry);
#define KERN_LOGSIGEXIT 34 /* int: do we log sigexit procs? */
#define KERN_IOV_MAX 35 /* int: value of UIO_MAXIOV */
#define KERN_HOSTUUID 36 /* string: host UUID identifier */
#define KERN_MAXID 37 /* number of valid kern ids */
#define KERN_ARND 37 /* int: from arc4rand() */
#define KERN_MAXID 38 /* number of valid kern ids */
#define CTL_KERN_NAMES { \
{ 0, 0 }, \