diff options
Diffstat (limited to 'libexec')
-rw-r--r-- | libexec/ld.so/alpha/ldasm.S | 3 | ||||
-rw-r--r-- | libexec/ld.so/alpha/syscall.h | 3 | ||||
-rw-r--r-- | libexec/ld.so/amd64/ldasm.S | 3 | ||||
-rw-r--r-- | libexec/ld.so/amd64/syscall.h | 3 | ||||
-rw-r--r-- | libexec/ld.so/arm/ldasm.S | 3 | ||||
-rw-r--r-- | libexec/ld.so/arm/syscall.h | 3 | ||||
-rw-r--r-- | libexec/ld.so/hppa/ldasm.S | 8 | ||||
-rw-r--r-- | libexec/ld.so/hppa/syscall.h | 3 | ||||
-rw-r--r-- | libexec/ld.so/i386/ldasm.S | 3 | ||||
-rw-r--r-- | libexec/ld.so/i386/syscall.h | 3 | ||||
-rw-r--r-- | libexec/ld.so/m88k/ldasm.S | 5 | ||||
-rw-r--r-- | libexec/ld.so/m88k/syscall.h | 3 | ||||
-rw-r--r-- | libexec/ld.so/mips64/ldasm.S | 3 | ||||
-rw-r--r-- | libexec/ld.so/mips64/syscall.h | 3 | ||||
-rw-r--r-- | libexec/ld.so/powerpc/ldasm.S | 3 | ||||
-rw-r--r-- | libexec/ld.so/powerpc/syscall.h | 3 | ||||
-rw-r--r-- | libexec/ld.so/sh/ldasm.S | 3 | ||||
-rw-r--r-- | libexec/ld.so/sh/syscall.h | 3 | ||||
-rw-r--r-- | libexec/ld.so/sparc/ldasm.S | 14 | ||||
-rw-r--r-- | libexec/ld.so/sparc/syscall.h | 3 | ||||
-rw-r--r-- | libexec/ld.so/sparc64/ldasm.S | 9 | ||||
-rw-r--r-- | libexec/ld.so/sparc64/syscall.h | 3 | ||||
-rw-r--r-- | libexec/ld.so/util.c | 6 |
23 files changed, 71 insertions, 25 deletions
diff --git a/libexec/ld.so/alpha/ldasm.S b/libexec/ld.so/alpha/ldasm.S index 1ce135d5c54..52e2bb01ba3 100644 --- a/libexec/ld.so/alpha/ldasm.S +++ b/libexec/ld.so/alpha/ldasm.S @@ -1,4 +1,4 @@ -/* $OpenBSD: ldasm.S,v 1.24 2014/07/05 17:03:19 miod Exp $ */ +/* $OpenBSD: ldasm.S,v 1.25 2014/07/06 07:28:36 otto Exp $ */ /* * Copyright (c) 2001 Niklas Hallqvist @@ -256,6 +256,7 @@ DL_SYSCALL(fcntl) DL_SYSCALL(fstat) DL_SYSCALL2(getcwd,__getcwd) DL_SYSCALL(getdents) +DL_SYSCALL(getentropy) DL_SYSCALL(gettimeofday) DL_SYSCALL_NOERR(issetugid) DL_SYSCALL(lstat) diff --git a/libexec/ld.so/alpha/syscall.h b/libexec/ld.so/alpha/syscall.h index 90d5c32dbb7..cc304c4ed15 100644 --- a/libexec/ld.so/alpha/syscall.h +++ b/libexec/ld.so/alpha/syscall.h @@ -1,4 +1,4 @@ -/* $OpenBSD: syscall.h,v 1.24 2014/07/05 21:54:51 miod Exp $ */ +/* $OpenBSD: syscall.h,v 1.25 2014/07/06 07:28:36 otto Exp $ */ /* * Copyright (c) 2001 Niklas Hallqvist @@ -41,6 +41,7 @@ int _dl_close(int); __dead int _dl_exit(int); +int _dl_getentropy(char *, size_t); int _dl_issetugid(void); void * _dl_mmap(void *, size_t, int, int, int, off_t); int _dl_mprotect(const void *, size_t, int); diff --git a/libexec/ld.so/amd64/ldasm.S b/libexec/ld.so/amd64/ldasm.S index 00b4e8cf3d2..19e703f750f 100644 --- a/libexec/ld.so/amd64/ldasm.S +++ b/libexec/ld.so/amd64/ldasm.S @@ -1,4 +1,4 @@ -/* $OpenBSD: ldasm.S,v 1.14 2013/12/23 22:13:03 kettenis Exp $ */ +/* $OpenBSD: ldasm.S,v 1.15 2014/07/06 07:28:36 otto Exp $ */ /* * Copyright (c) 2002,2004 Dale Rahn @@ -96,6 +96,7 @@ DL_SYSCALL(exit) DL_SYSCALL(readlink) DL_SYSCALL(lstat) DL_SYSCALL(utrace) +DL_SYSCALL(getentropy) DL_SYSCALL2(getcwd,__getcwd) DL_SYSCALL2(_syscall,__syscall) DL_SYSCALL2(sysctl,__sysctl) diff --git a/libexec/ld.so/amd64/syscall.h b/libexec/ld.so/amd64/syscall.h index 7fb15daa2b4..ab6e65653fb 100644 --- a/libexec/ld.so/amd64/syscall.h +++ b/libexec/ld.so/amd64/syscall.h @@ -1,4 +1,4 @@ -/* $OpenBSD: syscall.h,v 1.12 2014/07/05 21:54:51 miod Exp $ */ +/* $OpenBSD: syscall.h,v 1.13 2014/07/06 07:28:36 otto Exp $ */ /* * Copyright (c) 2001 Niklas Hallqvist @@ -58,6 +58,7 @@ int _dl_readlink(const char *, char *, size_t); int _dl_lstat(const char *, struct stat *); int _dl_getcwd(char *, size_t); int _dl_utrace(const char *, const void *, size_t); +int _dl_getentropy(char *, size_t); static inline off_t _dl_lseek(int fildes, off_t offset, int whence) diff --git a/libexec/ld.so/arm/ldasm.S b/libexec/ld.so/arm/ldasm.S index 93d43e9aad3..54b390fa4d6 100644 --- a/libexec/ld.so/arm/ldasm.S +++ b/libexec/ld.so/arm/ldasm.S @@ -1,4 +1,4 @@ -/* $OpenBSD: ldasm.S,v 1.13 2014/07/05 16:59:36 miod Exp $ */ +/* $OpenBSD: ldasm.S,v 1.14 2014/07/06 07:28:36 otto Exp $ */ /* * Copyright (c) 2004 Dale Rahn @@ -125,6 +125,7 @@ DL_SYSCALL(gettimeofday) DL_SYSCALL(readlink) DL_SYSCALL(lstat) DL_SYSCALL(utrace) +DL_SYSCALL(getentropy) DL_SYSCALL2(getcwd,__getcwd) DL_SYSCALL2(sysctl,__sysctl) diff --git a/libexec/ld.so/arm/syscall.h b/libexec/ld.so/arm/syscall.h index 131ffe522ed..a7ba238f940 100644 --- a/libexec/ld.so/arm/syscall.h +++ b/libexec/ld.so/arm/syscall.h @@ -1,4 +1,4 @@ -/* $OpenBSD: syscall.h,v 1.12 2014/07/05 21:54:51 miod Exp $ */ +/* $OpenBSD: syscall.h,v 1.13 2014/07/06 07:28:36 otto Exp $ */ /* * Copyright (c) 2001 Niklas Hallqvist @@ -58,6 +58,7 @@ int _dl_readlink(const char *, char *, size_t); int _dl_lstat(const char *, struct stat *); int _dl_getcwd(char *, size_t); int _dl_utrace(const char *, const void *, size_t); +int _dl_getentropy(char *, size_t); static inline off_t _dl_lseek(int fildes, off_t offset, int whence) diff --git a/libexec/ld.so/hppa/ldasm.S b/libexec/ld.so/hppa/ldasm.S index d44dd9dc4f9..ee0cc8a40f6 100644 --- a/libexec/ld.so/hppa/ldasm.S +++ b/libexec/ld.so/hppa/ldasm.S @@ -1,4 +1,4 @@ -/* $OpenBSD: ldasm.S,v 1.12 2013/12/23 13:57:44 kettenis Exp $ */ +/* $OpenBSD: ldasm.S,v 1.13 2014/07/06 07:28:36 otto Exp $ */ /* * Copyright (c) 2004 Michael Shalayeff @@ -272,6 +272,12 @@ ENTRY(_dl_utrace,0) nop EXIT(_dl_utrace) +ENTRY(_dl_getentropy,0) + SYSCALL(getentropy) + bv r0(rp) + nop +EXIT(_dl_getentropy) + ENTRY(_dl_sigprocmask,0) stw arg2, HPPA_FRAME_ARG(2)(sp) diff --git a/libexec/ld.so/hppa/syscall.h b/libexec/ld.so/hppa/syscall.h index 7fb15daa2b4..ab6e65653fb 100644 --- a/libexec/ld.so/hppa/syscall.h +++ b/libexec/ld.so/hppa/syscall.h @@ -1,4 +1,4 @@ -/* $OpenBSD: syscall.h,v 1.12 2014/07/05 21:54:51 miod Exp $ */ +/* $OpenBSD: syscall.h,v 1.13 2014/07/06 07:28:36 otto Exp $ */ /* * Copyright (c) 2001 Niklas Hallqvist @@ -58,6 +58,7 @@ int _dl_readlink(const char *, char *, size_t); int _dl_lstat(const char *, struct stat *); int _dl_getcwd(char *, size_t); int _dl_utrace(const char *, const void *, size_t); +int _dl_getentropy(char *, size_t); static inline off_t _dl_lseek(int fildes, off_t offset, int whence) diff --git a/libexec/ld.so/i386/ldasm.S b/libexec/ld.so/i386/ldasm.S index 76aa87a6795..e818076c964 100644 --- a/libexec/ld.so/i386/ldasm.S +++ b/libexec/ld.so/i386/ldasm.S @@ -1,4 +1,4 @@ -/* $OpenBSD: ldasm.S,v 1.16 2013/12/23 10:39:10 kettenis Exp $ */ +/* $OpenBSD: ldasm.S,v 1.17 2014/07/06 07:28:36 otto Exp $ */ /* * Copyright (c) 2002 Dale Rahn @@ -121,6 +121,7 @@ DL_SYSCALL(gettimeofday) DL_SYSCALL(readlink) DL_SYSCALL(lstat) DL_SYSCALL(utrace) +DL_SYSCALL(getentropy) DL_SYSCALL2(getcwd,__getcwd) DL_SYSCALL2(sysctl,__sysctl) DL_SYSCALL(getdents) diff --git a/libexec/ld.so/i386/syscall.h b/libexec/ld.so/i386/syscall.h index 3248ca9dbd8..f05f19fad20 100644 --- a/libexec/ld.so/i386/syscall.h +++ b/libexec/ld.so/i386/syscall.h @@ -1,4 +1,4 @@ -/* $OpenBSD: syscall.h,v 1.16 2014/07/05 21:54:51 miod Exp $ */ +/* $OpenBSD: syscall.h,v 1.17 2014/07/06 07:28:36 otto Exp $ */ /* * Copyright (c) 2001 Niklas Hallqvist @@ -58,6 +58,7 @@ int _dl_readlink(const char *, char *, size_t); int _dl_lstat(const char *, struct stat *); int _dl_getcwd(char *, size_t); int _dl_utrace(const char *, const void *, size_t); +int _dl_getentropy(char *, size_t); static inline off_t _dl_lseek(int fildes, off_t offset, int whence) diff --git a/libexec/ld.so/m88k/ldasm.S b/libexec/ld.so/m88k/ldasm.S index e138946d154..ccb957ea667 100644 --- a/libexec/ld.so/m88k/ldasm.S +++ b/libexec/ld.so/m88k/ldasm.S @@ -1,4 +1,4 @@ -/* $OpenBSD: ldasm.S,v 1.9 2014/07/05 16:59:36 miod Exp $ */ +/* $OpenBSD: ldasm.S,v 1.10 2014/07/06 07:28:36 otto Exp $ */ /* * Copyright (c) 2013 Miodrag Vallat. @@ -209,6 +209,9 @@ DL_SYSCALL(lstat) DL_SYSCALL(utrace) jmp %r1 +DL_SYSCALL(getentropy) + jmp %r1 + DL_SYSCALL2(getcwd,__getcwd) jmp %r1 diff --git a/libexec/ld.so/m88k/syscall.h b/libexec/ld.so/m88k/syscall.h index 50331e50efa..c5e29620ee9 100644 --- a/libexec/ld.so/m88k/syscall.h +++ b/libexec/ld.so/m88k/syscall.h @@ -1,4 +1,4 @@ -/* $OpenBSD: syscall.h,v 1.8 2014/07/05 21:54:51 miod Exp $ */ +/* $OpenBSD: syscall.h,v 1.9 2014/07/06 07:28:36 otto Exp $ */ /* * Copyright (c) 2001 Niklas Hallqvist @@ -58,6 +58,7 @@ int _dl_readlink(const char *, char *, size_t); int _dl_lstat(const char *, struct stat *); int _dl_getcwd(char *, size_t); int _dl_utrace(const char *, const void *, size_t); +int _dl_getentropy(char *, size_t); static inline off_t _dl_lseek(int fildes, off_t offset, int whence) diff --git a/libexec/ld.so/mips64/ldasm.S b/libexec/ld.so/mips64/ldasm.S index 278a316ef9f..34dd0173d0c 100644 --- a/libexec/ld.so/mips64/ldasm.S +++ b/libexec/ld.so/mips64/ldasm.S @@ -1,4 +1,4 @@ -/* $OpenBSD: ldasm.S,v 1.10 2014/07/05 17:05:08 miod Exp $ */ +/* $OpenBSD: ldasm.S,v 1.11 2014/07/06 07:28:36 otto Exp $ */ /* * Copyright (c) 1998-2002 Opsycon AB, Sweden. @@ -170,6 +170,7 @@ DL_SYSCALL(fcntl) DL_SYSCALL(fstat) DL_SYSCALL2(getcwd,__getcwd) DL_SYSCALL(getdents) +DL_SYSCALL(getentropy) DL_SYSCALL(gettimeofday) DL_SYSCALL_NOERR(issetugid) DL_SYSCALL(lstat) diff --git a/libexec/ld.so/mips64/syscall.h b/libexec/ld.so/mips64/syscall.h index 9eed4a531bf..cd608182f53 100644 --- a/libexec/ld.so/mips64/syscall.h +++ b/libexec/ld.so/mips64/syscall.h @@ -1,4 +1,4 @@ -/* $OpenBSD: syscall.h,v 1.14 2014/07/05 21:54:51 miod Exp $ */ +/* $OpenBSD: syscall.h,v 1.15 2014/07/06 07:28:36 otto Exp $ */ /* * Copyright (c) 1998-2002 Opsycon AB, Sweden. @@ -45,6 +45,7 @@ int _dl_fcntl(int, int, ...); int _dl_fstat(int, struct stat *); int _dl_getcwd(char *, size_t); ssize_t _dl_getdents(int, char *, size_t); +int _dl_getentropy(char *, size_t); int _dl_gettimeofday(struct timeval *, struct timezone *); int _dl_issetugid(void); int _dl_lstat(const char *, struct stat *); diff --git a/libexec/ld.so/powerpc/ldasm.S b/libexec/ld.so/powerpc/ldasm.S index 8b1ae5042cc..4e6817e794a 100644 --- a/libexec/ld.so/powerpc/ldasm.S +++ b/libexec/ld.so/powerpc/ldasm.S @@ -1,4 +1,4 @@ -/* $OpenBSD: ldasm.S,v 1.18 2014/07/05 20:41:25 miod Exp $ */ +/* $OpenBSD: ldasm.S,v 1.19 2014/07/06 07:28:36 otto Exp $ */ /* * Copyright (c) 1999 Dale Rahn @@ -209,6 +209,7 @@ DL_SYSCALL(fcntl) DL_SYSCALL(fstat) DL_SYSCALL2(getcwd,__getcwd) DL_SYSCALL(getdents) +DL_SYSCALL(getentropy) DL_SYSCALL(gettimeofday) DL_SYSCALL_NOERR(issetugid) DL_SYSCALL(lstat) diff --git a/libexec/ld.so/powerpc/syscall.h b/libexec/ld.so/powerpc/syscall.h index 10036e4d452..90355fe65b8 100644 --- a/libexec/ld.so/powerpc/syscall.h +++ b/libexec/ld.so/powerpc/syscall.h @@ -1,4 +1,4 @@ -/* $OpenBSD: syscall.h,v 1.32 2014/07/05 21:54:51 miod Exp $ */ +/* $OpenBSD: syscall.h,v 1.33 2014/07/06 07:28:36 otto Exp $ */ /* * Copyright (c) 1998 Per Fogelstrom, Opsycon AB @@ -47,6 +47,7 @@ int _dl_fcntl(int, int, int); int _dl_fstat(int, struct stat *); int _dl_getcwd(char *, size_t); ssize_t _dl_getdents(int, char *, size_t); +int _dl_getentropy(char *, size_t); int _dl_gettimeofday(struct timeval *, struct timezone *); int _dl_issetugid(void); int _dl_lstat(const char *, struct stat *); diff --git a/libexec/ld.so/sh/ldasm.S b/libexec/ld.so/sh/ldasm.S index 02cf08b3272..86b7086462b 100644 --- a/libexec/ld.so/sh/ldasm.S +++ b/libexec/ld.so/sh/ldasm.S @@ -1,4 +1,4 @@ -/* $OpenBSD: ldasm.S,v 1.14 2014/07/05 16:59:36 miod Exp $ */ +/* $OpenBSD: ldasm.S,v 1.15 2014/07/06 07:28:36 otto Exp $ */ /* * Copyright (c) 2006 Dale Rahn @@ -208,6 +208,7 @@ DL_SYSCALL(gettimeofday) DL_SYSCALL(readlink) DL_SYSCALL(lstat) DL_SYSCALL(utrace) +DL_SYSCALL(getentropy) DL_SYSCALL2(getcwd,__getcwd) DL_SYSCALL2(sysctl,__sysctl) diff --git a/libexec/ld.so/sh/syscall.h b/libexec/ld.so/sh/syscall.h index 2240dbf4561..2b4fd503986 100644 --- a/libexec/ld.so/sh/syscall.h +++ b/libexec/ld.so/sh/syscall.h @@ -1,4 +1,4 @@ -/* $OpenBSD: syscall.h,v 1.10 2014/07/05 21:54:51 miod Exp $ */ +/* $OpenBSD: syscall.h,v 1.11 2014/07/06 07:28:36 otto Exp $ */ /* * Copyright (c) 2001 Niklas Hallqvist @@ -58,6 +58,7 @@ int _dl_readlink(const char *, char *, size_t); int _dl_lstat(const char *, struct stat *); int _dl_getcwd(char *, size_t); int _dl_utrace(const char *, const void *, size_t); +int _dl_getentropy(char *, size_t); static inline off_t _dl_lseek(int fildes, off_t offset, int whence) diff --git a/libexec/ld.so/sparc/ldasm.S b/libexec/ld.so/sparc/ldasm.S index 17112f54374..cae76daf1ab 100644 --- a/libexec/ld.so/sparc/ldasm.S +++ b/libexec/ld.so/sparc/ldasm.S @@ -1,4 +1,4 @@ -/* $OpenBSD: ldasm.S,v 1.22 2013/12/25 11:10:02 kettenis Exp $ */ +/* $OpenBSD: ldasm.S,v 1.23 2014/07/06 07:28:36 otto Exp $ */ /* * Copyright (c) 2001 Jason L. Wright (jason@thought.net) @@ -371,6 +371,18 @@ _dl_utrace: retl sub %g0, %o0, %o0 ! error: result = -errno + + .section ".text" + .align 4 + .global _dl_getentropy + .type _dl_getentropy,@function +_dl_getentropy: + mov SYS_getentropy | SYSCALL_G2RFLAG, %g1 ! calling sys_getentropy + add %o7, 8, %g2 ! just return on success + t ST_SYSCALL ! off to wonderland + retl + sub %g0, %o0, %o0 ! error: result = -errno + /* * V8 sparc .{,u}{mul,div,rem} replacements. * We try to mimic them 100%. Full 64 bit sources or outputs, and diff --git a/libexec/ld.so/sparc/syscall.h b/libexec/ld.so/sparc/syscall.h index 56c2fee8de8..a3164ffe067 100644 --- a/libexec/ld.so/sparc/syscall.h +++ b/libexec/ld.so/sparc/syscall.h @@ -1,4 +1,4 @@ -/* $OpenBSD: syscall.h,v 1.17 2014/07/05 21:54:51 miod Exp $ */ +/* $OpenBSD: syscall.h,v 1.18 2014/07/06 07:28:36 otto Exp $ */ /* * Copyright (c) 2001 Niklas Hallqvist @@ -58,6 +58,7 @@ int _dl_readlink(const char *, char *, size_t); int _dl_lstat(const char *, struct stat *); int _dl_getcwd(char *, size_t); int _dl_utrace(const char *, const void *, size_t); +int _dl_getentropy(char *, size_t); static inline off_t _dl_lseek(int fildes, off_t offset, int whence) diff --git a/libexec/ld.so/sparc64/ldasm.S b/libexec/ld.so/sparc64/ldasm.S index a9638fb5b02..a0735d86c63 100644 --- a/libexec/ld.so/sparc64/ldasm.S +++ b/libexec/ld.so/sparc64/ldasm.S @@ -1,4 +1,4 @@ -/* $OpenBSD: ldasm.S,v 1.34 2013/12/23 22:24:37 kettenis Exp $ */ +/* $OpenBSD: ldasm.S,v 1.35 2014/07/06 07:28:36 otto Exp $ */ /* $NetBSD: rtld_start.S,v 1.5 2001/08/14 22:17:48 eeh Exp $ */ /* @@ -347,3 +347,10 @@ _ENTRY(_dl_utrace) t ST_SYSCALL ! off to wonderland retl sub %g0, %o0, %o0 ! error: result = -errno + +_ENTRY(_dl_getentropy) + mov SYS_getentropy | SYSCALL_G2RFLAG, %g1 ! calling sys_getentropy + add %o7, 8, %g2 ! just return on success + t ST_SYSCALL ! off to wonderland + retl + sub %g0, %o0, %o0 ! error: result = -errno diff --git a/libexec/ld.so/sparc64/syscall.h b/libexec/ld.so/sparc64/syscall.h index f1e29c79c30..124b9e24bbf 100644 --- a/libexec/ld.so/sparc64/syscall.h +++ b/libexec/ld.so/sparc64/syscall.h @@ -1,4 +1,4 @@ -/* $OpenBSD: syscall.h,v 1.24 2014/07/05 21:54:51 miod Exp $ */ +/* $OpenBSD: syscall.h,v 1.25 2014/07/06 07:28:36 otto Exp $ */ /* * Copyright (c) 2001 Niklas Hallqvist @@ -58,6 +58,7 @@ int _dl_readlink(const char *, char *, size_t); int _dl_lstat(const char *, struct stat *); int _dl_getcwd(char *, size_t); int _dl_utrace(const char *, const void *, size_t); +int _dl_getentropy(char *, size_t); static inline off_t _dl_lseek(int fildes, off_t offset, int whence) diff --git a/libexec/ld.so/util.c b/libexec/ld.so/util.c index 0b2b159cb52..4d71690ddcc 100644 --- a/libexec/ld.so/util.c +++ b/libexec/ld.so/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.32 2014/06/21 08:00:23 otto Exp $ */ +/* $OpenBSD: util.c,v 1.33 2014/07/06 07:28:36 otto Exp $ */ /* * Copyright (c) 1998 Per Fogelstrom, Opsycon AB @@ -63,7 +63,6 @@ _dl_strdup(const char *orig) void _dl_randombuf(void *buf, size_t buflen) { - const int mib[2] = { CTL_KERN, KERN_ARND }; size_t chunk; while (buflen != 0) { @@ -71,7 +70,8 @@ _dl_randombuf(void *buf, size_t buflen) chunk = 256; else chunk = buflen; - _dl_sysctl(mib, 2, buf, &chunk, NULL, 0); + if (_dl_getentropy(buf, chunk) != 0) + _dl_exit(8); buflen -= chunk; buf += chunk; } |