Commit Graph

431 Commits

Author SHA1 Message Date
rin 916b154777 libkvm: whitespace 2023-08-23 14:00:11 +00:00
mrg aec4d439cd avoid various use-after-free issues.
create a ptrdiff_t offset between the start of an allocation region and
some interesting pointer, so it can be adjusted with this offset after
realloc() returns.

found by GCC 12.
2023-08-10 20:38:00 +00:00
rin 03675fcefd Revert CC_WNO_USE_AFTER_FREE from Makefile's (thanks uwe@) 2023-08-03 14:56:36 +00:00
rin 91f8ac6d30 Sprinkle CC_WNO_USE_AFTER_FREE for GCC 12
All of them are blamed for idiom equivalent to:
	newbuf = realloc(buf, size);
	p = newbuf + (p - buf);
2023-08-03 13:36:08 +00:00
rillig 5f84f05b9b libkvm: suppress lint warnings about extern declarations for now
This should be properly fixed by someone who is familiar with libkvm, as
it affects <sys/cpu_data.h> as well.
2023-04-01 09:08:11 +00:00
rillig 388550b026 lib: remove CONSTCOND comment
Since 2021-01-31, lint doesn't need it anymore for the common pattern of
'do ... while (0)'.
2022-04-19 20:32:14 +00:00
christos 68f6d39511 read the ps arguments from the correct place. 2022-01-10 20:04:01 +00:00
christos 104ea67795 Get rid of usrstack/USRSTACK. Document that the old version of getargv is
broken because of ASLR.
2022-01-10 19:51:30 +00:00
mrg d914a3c1b9 remove clause 3 from all my licenses that aren't conflicting with
another copyright claim line.  again.  (i did this in 2008 and then
did not update all of my personal templates.)
2021-12-11 19:24:18 +00:00
christos 9aa2b02710 Match the declaration in <sys/kauth.h> 2021-07-19 10:30:36 +00:00
skrll 87529819eb Catch up with aa64 is not mips change 2020-11-10 19:14:11 +00:00
christos db3eb68fb5 Cast off_t to size_t to appease lint:
warning: conversion from 'long long' to 'int' may lose accuracy
2020-05-02 14:31:13 +00:00
christos d37b621bc8 Don't treat failure to map the file as fatal. 2020-04-28 14:27:41 +00:00
christos 6b123e2600 make kvm_pread use the mapped buffer if it is available. 2020-04-28 00:19:23 +00:00
christos 39cda3989e Implement kvm_write() for dump files. We map the file privately so that
changes don't get propagated back, and then write to the private buffer.
This is not useful yes, but it is simple enough to make pread use the buffer
if it is available.
2020-04-28 00:12:01 +00:00
maxv 26cfc3f122 Switch to the new PTE naming. The old naming is now unused, remove it. 2020-04-25 05:17:16 +00:00
chs 86de7c20e3 use a binary search in _kvm_pa2off(). this helps a lot for sparse dumps,
which can have millions of memory segments.
2020-03-08 00:14:18 +00:00
chs 29a37a72ce only do bounce buffering for character devices. 2020-03-08 00:06:42 +00:00
ad 5f087b6f0f Redo previous more conventionally. Requested by kre@. 2019-12-11 20:19:27 +00:00
ad c470496698 Mask out always zero bits off pg->phys_addr. 2019-12-10 18:13:07 +00:00
mlelstv d87f421944 Need register defines that were moved to armreg.h 2019-09-12 10:18:50 +00:00
mrg cffa8474c3 be consistent about uint64_t and bit masks. 2018-12-19 11:02:21 +00:00
mrg 35db1fca91 use uint64_t for idx_mask. fixes lookups for some PAs. from skrll.
bump copyright.  we updated this a lot of this in 2018.
2018-12-19 11:00:09 +00:00
skrll 9181a215b8 Fix _kvm_kvatop so that it now works. 2018-12-18 16:25:47 +00:00
sevan 0f1014292f Reword post mortem description. It tries to get the tree averages if it can. 2018-12-11 23:02:19 +00:00
sevan e67a3558e2 Clarify the difference to getloadavg(3). 2018-12-11 02:29:11 +00:00
mrg 33cbd42a21 tg1 is a 64 bit value, store it in a 64 bit variable. 2018-11-09 04:06:40 +00:00
mrg 19db227738 initialise the kvm errbuf so that if an error occurs, but the
internal _kvm_*err() functions aren't called, stack garbage is
not reported as an error string.

call _kvm_err() if _kvm_kvatop() fails.  now the above is not
triggered anymore :-)
2018-11-05 00:43:30 +00:00
mrg d89d4475a3 compare matching TG1 bits.
aarch64 crash dump kvtop now less broken, but still not stable.
2018-11-01 05:37:11 +00:00
ryo fe33aa2786 Add initial support for ARMv8 (AARCH64) (by nisimura@ and ryo@)
- sys/arch/evbarm64 is gone and integrated into sys/arch/evbarm. (by skrll@)
- add support fdt. evbarm/conf/GENERIC64 fdt (bcm2837,sunxi,tegra) based generic 64bit kernel config. (by skrll@, jmcneill@)
2018-04-01 04:35:01 +00:00
maxv 26bc6e1cea Keep /dev/ksyms open in _kvm_open(). This way /dev/ksyms can be put into
$g_kmem without breaking the tools that need kmem+ksyms.

Discussed on tech-kern@ three weeks ago. The original issue was reported
by maya@, the patch was written by Tom Ivar Helbekkmo, ok christos@.
2018-02-07 14:03:18 +00:00
kamil dab4556f43 Correct the signature of kvm_getproc2(3) in the man-page.
The elemsize argument is of type "size_t", not "int".

Sponsored by <The NetBSD Foundation>
2018-01-09 21:17:45 +00:00
kamil c5ed1004cc Correct the signature of kvm_getlwps(3) in the man-page.
The elemsize argument is of type "size_t", not "int *".

Sponsored by <The NetBSD Foundation>
2018-01-09 21:13:59 +00:00
abhinav fb3eb352ca Add rest of the functions from the SYNOPSIS to the NAME section 2017-10-22 14:25:33 +00:00
kamil 2d1839db7f Stop including <sys/user.h> in userland libraries
This header in this context is freebsdism.
2017-06-14 12:24:51 +00:00
mrg 5f3362148f various ia64 updates:
- add a compat vfork because of stupid
- add a weak sbrk
- add a shmat syscall
- add an empty kvm implementation that links
- add missing fp stuff
2016-06-30 09:14:30 +00:00
christos d6b67564a6 some ports need <sys/wait.h> 2016-04-04 22:14:38 +00:00
christos cacc57bfc6 catch up with p_xstat split. 2016-04-04 21:08:44 +00:00
mrg 19cbd6805c distinguish between partial and failed read, so that "read 0xffffffff bytes failed"
is not output..
2016-03-29 06:51:40 +00:00
christos c4abdb423f mips needs _KMEMUSER for label_t in pcb.h 2016-01-24 16:07:48 +00:00
dholland 65f8003146 Update synopses to match u_int/u_long/etc. changes. Do not bump date as
it's not a substantive change.
2016-01-23 00:43:42 +00:00
nakayama 13217c03e5 Use PRIxPADDR instead of type casting. 2015-10-31 02:40:44 +00:00
martin 59db503a23 Fix the -m32 compat build for sparc64 after recent sparc/include/types.h
changes. XXX I suspect this variant has not been tested in real life.
2015-10-07 11:56:41 +00:00
martin 4c8eef7861 Dummy support for ia64 2015-04-17 13:16:01 +00:00
matt 6cf6fe02a9 New files for Userland support of UCB RISC-V (both 32-bit and 64-bit) 2014-09-19 17:36:24 +00:00
matt 27620987b8 New files for OR1K support 2014-09-03 19:34:25 +00:00
matt cc87ea3a00 #if 0 some code not in use yet 2014-08-23 02:25:23 +00:00
matt 810b61bb1a MKCOMPAT fixes for when compat MACHINE_CPU != normal MACHINE_CPU 2014-08-10 23:39:08 +00:00
matt beb9c6d1b5 Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
2014-08-10 05:47:35 +00:00
matt c1987519cf #include <m68k/m68k.h> 2014-03-04 06:38:08 +00:00