-/* $OpenBSD: library.c,v 1.78 2016/08/08 21:59:20 guenther Exp $ */
+/* $OpenBSD: library.c,v 1.79 2016/08/12 20:39:01 deraadt Exp $ */
/*
* Copyright (c) 2002 Dale Rahn
}
case PT_OPENBSD_RANDOMIZE:
- _dl_randombuf((char *)(phdp->p_vaddr + loff),
+ _dl_arc4randombuf((char *)(phdp->p_vaddr + loff),
phdp->p_memsz);
break;
-/* $OpenBSD: library_mquery.c,v 1.55 2016/08/08 21:59:20 guenther Exp $ */
+/* $OpenBSD: library_mquery.c,v 1.56 2016/08/12 20:39:01 deraadt Exp $ */
/*
* Copyright (c) 2002 Dale Rahn
phdp = (Elf_Phdr *)(hbuf + ehdr->e_phoff);
for (i = 0; i < ehdr->e_phnum; i++, phdp++) {
if (phdp->p_type == PT_OPENBSD_RANDOMIZE)
- _dl_randombuf((char *)(phdp->p_vaddr + LOFF),
+ _dl_arc4randombuf((char *)(phdp->p_vaddr + LOFF),
phdp->p_memsz);
else if (phdp->p_type == PT_GNU_RELRO) {
relro_addr = phdp->p_vaddr + LOFF;
-/* $OpenBSD: loader.c,v 1.163 2016/08/08 21:59:20 guenther Exp $ */
+/* $OpenBSD: loader.c,v 1.164 2016/08/12 20:39:01 deraadt Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
for (loop = 1; loop < libcount; loop++) {
unsigned int rnd;
int cur;
- rnd = _dl_random();
+ rnd = _dl_arc4random();
rnd = rnd % (loop+1);
cur = randomlist[rnd];
randomlist[rnd] = randomlist[loop];
-/* $OpenBSD: malloc.c,v 1.8 2016/05/19 18:50:01 guenther Exp $ */
+/* $OpenBSD: malloc.c,v 1.9 2016/08/12 20:39:01 deraadt Exp $ */
/*
* Copyright (c) 2008, 2010, 2011 Otto Moerbeek <otto@drijf.net>
* Copyright (c) 2012 Matthew Dempsky <matthew@openbsd.org>
static void
rbytes_init(struct dir_info *d)
{
- _dl_randombuf(d->rbytes, sizeof(d->rbytes));
+ _dl_arc4randombuf(d->rbytes, sizeof(d->rbytes));
d->rbytesused = 0;
}
mopts.malloc_guard = MALLOC_PAGESIZE;
do {
- _dl_randombuf(&mopts.malloc_canary,
+ _dl_arc4randombuf(&mopts.malloc_canary,
sizeof(mopts.malloc_canary));
} while (mopts.malloc_canary == 0);
MALLOC_PAGESIZE, PROT_NONE);
d_avail = (DIR_INFO_RSZ - sizeof(*d)) >> MALLOC_MINSHIFT;
- _dl_randombuf(&tmp, sizeof(tmp));
+ _dl_arc4randombuf(&tmp, sizeof(tmp));
d = (struct dir_info *)(p + MALLOC_PAGESIZE +
((tmp % d_avail) << MALLOC_MINSHIFT)); /* not uniform */
-/* $OpenBSD: util.c,v 1.42 2016/08/05 15:42:05 tedu Exp $ */
+/* $OpenBSD: util.c,v 1.43 2016/08/12 20:39:01 deraadt Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
}
void
-_dl_randombuf(void *v, size_t buflen)
+_dl_arc4randombuf(void *v, size_t buflen)
{
static char bytes[256];
static u_int reserve;
}
u_int32_t
-_dl_random(void)
+_dl_arc4random(void)
{
u_int32_t rnd;
- _dl_randombuf(&rnd, sizeof(rnd));
+ _dl_arc4randombuf(&rnd, sizeof(rnd));
return (rnd);
}
-/* $OpenBSD: util.h,v 1.26 2014/06/21 08:00:23 otto Exp $ */
+/* $OpenBSD: util.h,v 1.27 2016/08/12 20:39:01 deraadt Exp $ */
/*
* Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
void _dl_vprintf(const char *fmt, va_list ap);
void _dl_fdprintf(int, const char *fmt, ...);
void _dl_show_objects(void);
-void _dl_randombuf(void *, size_t);
-u_int32_t _dl_random(void);
+void _dl_arc4randombuf(void *, size_t);
+u_int32_t _dl_arc4random(void);
ssize_t _dl_write(int fd, const char* buf, size_t len);
char * _dl_dirname(const char *path);
char *_dl_realpath(const char *path, char *resolved);