summaryrefslogtreecommitdiff
path: root/usr.bin/kdump
AgeCommit message (Collapse)Author
2015-10-10normalize a few more tame request orderings, to help reviewTheo de Raadt
2015-10-10since kdump may getprotobynumber() late, do not drop "rpath". We couldTheo de Raadt
potentially modify pledge() to permit /etc/protocols (/etc/rpc? /etc/services? etc) without requiring a rpath attribute.. but where would we draw the line for what /etc files libc functions need? At present, we draw that line closer to the minimum. issue found by theo@math.ethz.ch
2015-10-09Change all tame callers to namechange to pledge(2).Theo de Raadt
2015-10-06tame "stdio getpw"Theo de Raadt
discussed with guenther
2015-10-03Add ktracing of tame()'s arguments' valuesPhilip Guenther
"every tool helps" deraadt@
2015-10-03option LFS is dead, but we missed option ACCOUNTING herePhilip Guenther
2015-10-03Fix wrong cast.Vadim Zhukov
This one should be an unsigned long in theory, but the formatter function argument we're printing from is already an int (being casted from register_t at the formatter call time). So lets fix one bug at a time. authoritative okay from guenther@
2015-10-03tame "stdio getpw rpath" can be done quite early after the getopt.Theo de Raadt
it might seem we can hoist the open above tame and then drop "rpath", but guenther found getprotobynumber can be called much later. ok guenther
2015-10-02update the -t args list; ok guentherJason McIntyre
2015-10-02Add ktracing of argv and envp to execve(2), with envp not traced by defaultPhilip Guenther
ok tedu@ deraadt@
2015-09-13Rename __sysctl syscall to just sysctl, as the userland wrapper is no longerPhilip Guenther
necessary ok deraadt@ jsing@
2015-09-11add some missing .Cm macros and drop some redundant .Bk while hereIngo Schwarze
2015-09-07Delete ktracing of context switches: it's unused, and not particularly useful,Philip Guenther
and doing VOP_WRITE() from inside tsleep/msleep makes the locking too complicated, making it harder to move forward on MP changes. ok deraadt@ kettenis@
2015-07-28Add ktracing of structs iovec, msghdr, and cmsghdr for {,p}{read,write}v(),Philip Guenther
sendmsg(), and recvmsg(). For cmsghdr, the len, level, and type are always shown, and for SOL_SOCKET,SCM_RIGHTS the fd numbers being passed are shown. ok millert@ deraadt@
2015-07-19Make KTR_SYSRET records variables variables sized, leaving out thePhilip Guenther
retval on error, including a long long retval on successful lseek(), and including a register_t retval for other successes. This fixes lseek reporting on ILP32 archs. While here, reworking internal kern_ktrace.c bits to be able to pass two buffers to ktrwriteraw(), so we can avoid mallocing a buffer in some cases and so that KTR_GENIO logs are split at PAGE_SIZE, not PAGE_SIZE-sizeof(struct ktrgenio) ok miod@
2015-07-19Figure out the tty width using TIOCGWINSZ early on. Will make tame(2)Theo de Raadt
integration easier in the future.
2015-05-17isatty() is used by stdio to determine the buffering mode. Add a F_ISATTYTheo de Raadt
option to fcntl(), so that isatty() can use this rather than than the bloated ioctl() interface. Reducing uses of ioctl() by libc makes it easier to constrain programs with various kinds of systrace sandboxes. ok guenther, previously discussed as a concept with nicm
2015-04-18Convert many atoi() calls to strtonum(), adding range checks and failureTheo de Raadt
handling along the way. Reviews by Brendan MacDonell, Jeremy Devenport, florian, doug, millert
2015-04-17oops, started expecting sockoptlevelname() to handle two argumentsPhilip Guenther
but never actually did so. Fix that so that we stop losing the second argument to {get,set}sockopt(). Handling of levels other than SOL_SOCKET could be improved.
2015-04-17The first argument to socket/socketpair is an address family, not a protocolPhilip Guenther
family. (sysctl(3) is practically the only place where PF_* is correct)
2015-01-26Oops: symlinkat()'s 'atfd' argument is its second, not its firstPhilip Guenther
2015-01-18Eliminate a gcc warnings by not #defining _KERNEL when pulling inPhilip Guenther
<sys/socket.h>: it doesn't expose anything kdump cares about. Also, COMPAT_43 is dead warning noted by deraadt@
2015-01-16Replace <sys/param.h> with <limits.h> and other less dirty headers whereTheo de Raadt
possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
2014-12-28With revision 1.93 a space character got lost when printing theAlexander Bluhm
signal action. Print the space again. OK jsg@
2014-12-16Don't display formatted time if localtime() fails.Jonathan Gray
Avoids a crash in strftime() found with the afl fuzzer. ok guenther@
2014-12-15remove -r from usage();Jason McIntyre
2014-12-15Eliminate the -r option and always do sysctl OID, username, groupname,Philip Guenther
and ctime presentation, but combined with the numeric form ala 0<"root">. Do username and groupname presentation on syscall arguments and retvals. ok millert@ otto@
2014-12-11Make quotactlcmd formatting consistent with othersPhilip Guenther
Fix some indentation in the generated .c file
2014-12-09Add some additional sanity checks to kdump.Jonathan Gray
Fixes a variety of crashes found with the afl fuzzer. ok miod@ on an earlier version.
2014-12-08Convert syscall argument handling from a giant switch to a giant table.Philip Guenther
While at it, use formatters for fds, counts, ids of all types, and "small buffer sizes" that always show them in decimal, while paths, pointers, and "big buffer sizes" get formatters that always show them in hex. The -d option only affects args when the -n option is used or for unknown syscalls, as well as syscall return values, and unrecognized ioctls. ok otto@ millert@
2014-11-20Be more POSIXy by using blksize_t (a.k.a. int32) for st_blksize, rather than ↵Kenneth R Westerback
the current uint32_t. ok guenther@ deraadt@
2014-10-13Add dumping of struct dqblk done by quotactl(2)Philip Guenther
ok millert@
2014-10-08userland reallocarray audit.Doug Hogan
Replace malloc() and realloc() calls that may have integer overflow in the multiplication of the arguments with reallocarray(). ok deraadt@
2014-09-17Add display of the flags to pipe2, dup3, and accept4, display ofPhilip Guenther
MSG_CMSG_CLOEXEC in recvmsg, and display of SOCK_{CLOEXEC,NONBLOCK} in socket and socketpair. Do _not_ display the O_ACCMODE bits in the arg to fcntl(F_SETFD) ok miod@
2014-08-20Remove userland bits related to the crypto(4) interface; ok deraadtMike Belopuhov
2014-08-18Add fancy printing of ktrace()'s ops argumentPhilip Guenther
mquery() has the exact same argument layout as mmap(), so share the case Fix a couple brace placement glitches
2014-08-17Use %#o instead of %#x for mode_tPhilip Guenther
2014-08-17Display symbolicly the mode argument of mkdir, mkfifo, mknod, and umaskPhilip Guenther
2014-07-11remove (commented) bluetooth referenceTed Unangst
2014-07-11Grok the new /dev/klog LIOCSFD ioctl associated with sendsyslog(2)Theo de Raadt
ok matthew guenther miod tedu
2014-07-02properly process minherit(2) flags; ok guenther@ matthew@Otto Moerbeek
2014-06-27Cleanup support for legacy mmap flagsMatthew Dempsky
Move all legacy MAP_FOO values behind #ifndef _KERNEL and redefine them to either be aliases for existing flags (e.g., MAP_COPY -> MAP_PRIVATE) or 0. Also, add MAP_OLDFOO defines (behind #ifndef _KERNEL) so the kernel and kdump can remain compatible with current OpenBSD binaries. ok deraadt
2014-06-22Negative time{spec,val}s with non-zero subsecond parts require extraPhilip Guenther
handling. E.g., a timeval of { -1, 1 } is -0.999999, as the subsecond part is always positive. Also, update the list of sockaddr_* types that we might add support for
2014-03-18<sys/agpio.h> is gone; pointed out by Benoit Lecocq.Mark Kettenis
2014-01-24exit1() needs to do a final aggregation of the thread's [us]ticksPhilip Guenther
and runtime to the process totals. Also, add ktracing of struct rusage in wait4() and getrusage(). problem pointed out by tedu@ ok deraadt@
2013-12-21Recognize itimer and ktrace facility names to {get,set}itimer() and ktrace()Philip Guenther
ok otto@
2013-12-21Refer to the kernel headers consistently via ../../sys, even for mkioctlPhilip Guenther
and mksubr ok otto@
2013-12-134.3BSD tty compatibility and the associated ioctls are goneChristian Weisgerber
2013-11-22Teach kdump(1) about USB, VIDIOC and generic DRM ioctls.Martin Pieuchot
ok deraadt@, guenther@
2013-09-09Recognize the UTIME_OMIT and UTIME_NOW values when printing timespecsPhilip Guenther
ok otto@