-/* $OpenBSD: ldasm.S,v 1.26 2014/07/09 12:51:20 guenther Exp $ */
+/* $OpenBSD: ldasm.S,v 1.27 2014/07/14 03:54:50 deraadt Exp $ */
/*
* Copyright (c) 2001 Niklas Hallqvist
DL_SYSCALL2(getcwd,__getcwd)
DL_SYSCALL(getdents)
DL_SYSCALL(getentropy)
+DL_SYSCALL(sendsyslog)
DL_SYSCALL(gettimeofday)
DL_SYSCALL_NOERR(issetugid)
DL_SYSCALL(lstat)
-/* $OpenBSD: syscall.h,v 1.26 2014/07/09 12:51:20 guenther Exp $ */
+/* $OpenBSD: syscall.h,v 1.27 2014/07/14 03:54:50 deraadt Exp $ */
/*
* Copyright (c) 2001 Niklas Hallqvist
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);
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);
+int _dl_sendsyslog(const char *, size_t);
static inline off_t
_dl_lseek(int fildes, off_t offset, int whence)
-/* $OpenBSD: ldasm.S,v 1.17 2014/07/09 12:51:20 guenther Exp $ */
+/* $OpenBSD: ldasm.S,v 1.18 2014/07/14 03:54:50 deraadt Exp $ */
/*
* Copyright (c) 2002,2004 Dale Rahn
DL_SYSCALL(lstat)
DL_SYSCALL(utrace)
DL_SYSCALL(getentropy)
+DL_SYSCALL(sendsyslog)
DL_SYSCALL2(getcwd,__getcwd)
DL_SYSCALL2(set_tcb,__set_tcb)
DL_SYSCALL2(_syscall,__syscall)
-/* $OpenBSD: syscall.h,v 1.14 2014/07/09 12:51:20 guenther Exp $ */
+/* $OpenBSD: syscall.h,v 1.15 2014/07/14 03:54:50 deraadt Exp $ */
/*
* Copyright (c) 2001 Niklas Hallqvist
int _dl_getcwd(char *, size_t);
int _dl_utrace(const char *, const void *, size_t);
int _dl_getentropy(char *, size_t);
+int _dl_sendsyslog(const char *, size_t);
static inline off_t
_dl_lseek(int fildes, off_t offset, int whence)
-/* $OpenBSD: ldasm.S,v 1.15 2014/07/09 12:51:20 guenther Exp $ */
+/* $OpenBSD: ldasm.S,v 1.16 2014/07/14 03:54:51 deraadt Exp $ */
/*
* Copyright (c) 2004 Dale Rahn
DL_SYSCALL(lstat)
DL_SYSCALL(utrace)
DL_SYSCALL(getentropy)
+DL_SYSCALL(sendsyslog)
DL_SYSCALL2(getcwd,__getcwd)
DL_SYSCALL2(sysctl,__sysctl)
-/* $OpenBSD: syscall.h,v 1.14 2014/07/09 12:51:20 guenther Exp $ */
+/* $OpenBSD: syscall.h,v 1.15 2014/07/14 03:54:51 deraadt Exp $ */
/*
* Copyright (c) 2001 Niklas Hallqvist
int _dl_getcwd(char *, size_t);
int _dl_utrace(const char *, const void *, size_t);
int _dl_getentropy(char *, size_t);
+int _dl_sendsyslog(const char *, size_t);
static inline off_t
_dl_lseek(int fildes, off_t offset, int whence)
-/* $OpenBSD: ldasm.S,v 1.14 2014/07/09 12:51:20 guenther Exp $ */
+/* $OpenBSD: ldasm.S,v 1.15 2014/07/14 03:54:51 deraadt Exp $ */
/*
* Copyright (c) 2004 Michael Shalayeff
nop
EXIT(_dl_getentropy)
+ENTRY(_dl_sendsyslog,0)
+ SYSCALL(sendsyslog)
+ bv r0(rp)
+ nop
+EXIT(_dl_sendsyslog)
+
ENTRY(_dl_sigprocmask,0)
stw arg2, HPPA_FRAME_ARG(2)(sp)
-/* $OpenBSD: syscall.h,v 1.14 2014/07/09 12:51:20 guenther Exp $ */
+/* $OpenBSD: syscall.h,v 1.15 2014/07/14 03:54:51 deraadt Exp $ */
/*
* Copyright (c) 2001 Niklas Hallqvist
int _dl_getcwd(char *, size_t);
int _dl_utrace(const char *, const void *, size_t);
int _dl_getentropy(char *, size_t);
+int _dl_sendsyslog(const char *, size_t);
static inline off_t
_dl_lseek(int fildes, off_t offset, int whence)
-/* $OpenBSD: ldasm.S,v 1.18 2014/07/09 12:51:20 guenther Exp $ */
+/* $OpenBSD: ldasm.S,v 1.19 2014/07/14 03:54:51 deraadt Exp $ */
/*
* Copyright (c) 2002 Dale Rahn
DL_SYSCALL(lstat)
DL_SYSCALL(utrace)
DL_SYSCALL(getentropy)
+DL_SYSCALL(sendsyslog)
DL_SYSCALL2(getcwd,__getcwd)
DL_SYSCALL2(sysctl,__sysctl)
DL_SYSCALL(getdents)
-/* $OpenBSD: syscall.h,v 1.18 2014/07/09 12:51:20 guenther Exp $ */
+/* $OpenBSD: syscall.h,v 1.19 2014/07/14 03:54:51 deraadt Exp $ */
/*
* Copyright (c) 2001 Niklas Hallqvist
int _dl_getcwd(char *, size_t);
int _dl_utrace(const char *, const void *, size_t);
int _dl_getentropy(char *, size_t);
+int _dl_sendsyslog(const char *, size_t);
static inline off_t
_dl_lseek(int fildes, off_t offset, int whence)
-/* $OpenBSD: ldasm.S,v 1.12 2014/07/10 07:41:26 miod Exp $ */
+/* $OpenBSD: ldasm.S,v 1.13 2014/07/14 03:54:51 deraadt Exp $ */
/*
* Copyright (c) 2013 Miodrag Vallat.
DL_SYSCALL(getentropy)
jmp %r1
+DL_SYSCALL(sendsyslog)
+ jmp %r1
+
DL_SYSCALL2(getcwd,__getcwd)
jmp %r1
-/* $OpenBSD: syscall.h,v 1.10 2014/07/09 12:51:20 guenther Exp $ */
+/* $OpenBSD: syscall.h,v 1.11 2014/07/14 03:54:51 deraadt Exp $ */
/*
* Copyright (c) 2001 Niklas Hallqvist
int _dl_getcwd(char *, size_t);
int _dl_utrace(const char *, const void *, size_t);
int _dl_getentropy(char *, size_t);
+int _dl_sendsyslog(const char *, size_t);
static inline off_t
_dl_lseek(int fildes, off_t offset, int whence)
-/* $OpenBSD: ldasm.S,v 1.12 2014/07/09 12:51:21 guenther Exp $ */
+/* $OpenBSD: ldasm.S,v 1.13 2014/07/14 03:54:51 deraadt Exp $ */
/*
* Copyright (c) 1998-2002 Opsycon AB, Sweden.
DL_SYSCALL2(getcwd,__getcwd)
DL_SYSCALL(getdents)
DL_SYSCALL(getentropy)
+DL_SYSCALL(sendsyslog)
DL_SYSCALL(gettimeofday)
DL_SYSCALL_NOERR(issetugid)
DL_SYSCALL(lstat)
-/* $OpenBSD: syscall.h,v 1.16 2014/07/09 12:51:21 guenther Exp $ */
+/* $OpenBSD: syscall.h,v 1.17 2014/07/14 03:54:51 deraadt Exp $ */
/*
* Copyright (c) 1998-2002 Opsycon AB, Sweden.
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 *);
long _dl__syscall(quad_t, ...);
int _dl_sysctl(const int *, u_int, void *, size_t *, void *, size_t);
int _dl_utrace(const char *, const void *, size_t);
+int _dl_getentropy(char *, size_t);
+int _dl_sendsyslog(const char *, size_t);
static inline off_t
_dl_lseek(int fd, off_t offset, int whence)
-/* $OpenBSD: ldasm.S,v 1.20 2014/07/09 12:51:21 guenther Exp $ */
+/* $OpenBSD: ldasm.S,v 1.21 2014/07/14 03:54:51 deraadt Exp $ */
/*
* Copyright (c) 1999 Dale Rahn
DL_SYSCALL2(getcwd,__getcwd)
DL_SYSCALL(getdents)
DL_SYSCALL(getentropy)
+DL_SYSCALL(sendsyslog)
DL_SYSCALL(gettimeofday)
DL_SYSCALL_NOERR(issetugid)
DL_SYSCALL(lstat)
-/* $OpenBSD: syscall.h,v 1.34 2014/07/09 12:51:21 guenther Exp $ */
+/* $OpenBSD: syscall.h,v 1.35 2014/07/14 03:54:51 deraadt Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
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 *);
int _dl_sysctl(const int *, u_int, void *, size_t *, void *, size_t);
int _dl_utrace(const char *, const void *, size_t);
ssize_t _dl_write(int, const char *, size_t);
+int _dl_getentropy(char *, size_t);
+int _dl_sendsyslog(const char *, size_t);
static inline off_t
_dl_lseek(int fildes, off_t offset, int whence)
-/* $OpenBSD: ldasm.S,v 1.16 2014/07/09 12:51:21 guenther Exp $ */
+/* $OpenBSD: ldasm.S,v 1.17 2014/07/14 03:54:51 deraadt Exp $ */
/*
* Copyright (c) 2006 Dale Rahn
DL_SYSCALL(lstat)
DL_SYSCALL(utrace)
DL_SYSCALL(getentropy)
+DL_SYSCALL(sendsyslog)
DL_SYSCALL2(getcwd,__getcwd)
DL_SYSCALL2(sysctl,__sysctl)
-/* $OpenBSD: syscall.h,v 1.12 2014/07/09 12:51:21 guenther Exp $ */
+/* $OpenBSD: syscall.h,v 1.13 2014/07/14 03:54:51 deraadt Exp $ */
/*
* Copyright (c) 2001 Niklas Hallqvist
int _dl_getcwd(char *, size_t);
int _dl_utrace(const char *, const void *, size_t);
int _dl_getentropy(char *, size_t);
+int _dl_sendsyslog(const char *, size_t);
static inline off_t
_dl_lseek(int fildes, off_t offset, int whence)
-/* $OpenBSD: ldasm.S,v 1.24 2014/07/09 12:51:21 guenther Exp $ */
+/* $OpenBSD: ldasm.S,v 1.25 2014/07/14 03:54:51 deraadt Exp $ */
/*
* Copyright (c) 2001 Jason L. Wright (jason@thought.net)
retl
sub %g0, %o0, %o0 ! error: result = -errno
+ .section ".text"
+ .align 4
+ .global _dl_sendsyslog
+ .type _dl_sendsyslog,@function
+_dl_sendsyslog:
+ mov SYS_sendsyslog | SYSCALL_G2RFLAG, %g1 ! calling sys_sendsyslog
+ 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
-/* $OpenBSD: syscall.h,v 1.19 2014/07/09 12:51:21 guenther Exp $ */
+/* $OpenBSD: syscall.h,v 1.20 2014/07/14 03:54:51 deraadt Exp $ */
/*
* Copyright (c) 2001 Niklas Hallqvist
int _dl_getcwd(char *, size_t);
int _dl_utrace(const char *, const void *, size_t);
int _dl_getentropy(char *, size_t);
+int _dl_sendsyslog(const char *, size_t);
static inline off_t
_dl_lseek(int fildes, off_t offset, int whence)
-/* $OpenBSD: ldasm.S,v 1.36 2014/07/09 12:51:21 guenther Exp $ */
+/* $OpenBSD: ldasm.S,v 1.37 2014/07/14 03:54:51 deraadt Exp $ */
/* $NetBSD: rtld_start.S,v 1.5 2001/08/14 22:17:48 eeh Exp $ */
/*
t ST_SYSCALL ! off to wonderland
retl
sub %g0, %o0, %o0 ! error: result = -errno
+
+_ENTRY(_dl_sendsyslog)
+ mov SYS_sendsyslog | SYSCALL_G2RFLAG, %g1 ! calling sys_sendsyslog
+ add %o7, 8, %g2 ! just return on success
+ t ST_SYSCALL ! off to wonderland
+ retl
+ sub %g0, %o0, %o0 ! error: result = -errno
-/* $OpenBSD: syscall.h,v 1.26 2014/07/09 12:51:21 guenther Exp $ */
+/* $OpenBSD: syscall.h,v 1.27 2014/07/14 03:54:51 deraadt Exp $ */
/*
* Copyright (c) 2001 Niklas Hallqvist
int _dl_getcwd(char *, size_t);
int _dl_utrace(const char *, const void *, size_t);
int _dl_getentropy(char *, size_t);
+int _dl_sendsyslog(const char *, size_t);
static inline off_t
_dl_lseek(int fildes, off_t offset, int whence)
-/* $OpenBSD: util.c,v 1.34 2014/07/06 07:39:07 otto Exp $ */
+/* $OpenBSD: util.c,v 1.35 2014/07/14 03:54:50 deraadt Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
void
__stack_smash_handler(char func[], int damaged)
{
+ extern const char *_dl_progname;
+ char message[100];
+
+ /* <10> indicates LOG_CRIT */
+ _dl_strlcpy(message, "<10>ld.so:", sizeof message);
+ _dl_strlcat(message, _dl_progname, sizeof message);
+ _dl_strlcat(message, "stack overflow in function ", sizeof message);
+ _dl_strlcat(message, func, sizeof message);
+
+ _dl_sendsyslog(message, _dl_strlen(message));
_dl_exit(127);
}