#
5b880e99 |
| 02-Jan-2021 |
rin <rin@NetBSD.org> |
Use <compat/netbsd32/netbsd32.h> instead of <machine/netbsd32_machdep.h>, which is not intended for standalone use.
Compile tested for all ports with their own COMPAT_NETBSD32 codes: aarch64, amd64,
Use <compat/netbsd32/netbsd32.h> instead of <machine/netbsd32_machdep.h>, which is not intended for standalone use.
Compile tested for all ports with their own COMPAT_NETBSD32 codes: aarch64, amd64, arm, mips64, sparc64, and algor64.
Should fix build failure for mips64 in netbsd-9, where netbsd32.h is not included by other header files.
show more ...
|
#
3d0d0adb |
| 19-Oct-2020 |
christos <christos@NetBSD.org> |
Arrange so that no options COREDUMP and no options PTRACE work together. Thanks to Paul Goyette for testing.
|
#
ccbfb8c2 |
| 10-Oct-2020 |
rin <rin@NetBSD.org> |
Use correct note types for register storage in 32-bit core files for architecture on which 64- and 32-bit ABIs use different values for PT_GET{,FP}REGS, i.e., aarch64{,eb}.
Now, 32-bit GDB works fin
Use correct note types for register storage in 32-bit core files for architecture on which 64- and 32-bit ABIs use different values for PT_GET{,FP}REGS, i.e., aarch64{,eb}.
Now, 32-bit GDB works fine for core files generated by aarch64{,eb} kernel.
Should be no functional changes for ports other than aarch64{,eb}.
show more ...
|
#
853d8728 |
| 30-May-2020 |
thorpej <thorpej@NetBSD.org> |
coredump_note_elf{32,64}(): avoid allcating register state buffers on the stack; they could be large.
|
#
14b4bbb2 |
| 23-May-2020 |
ad <ad@NetBSD.org> |
Move proc_lock into the data segment. It was dynamically allocated because at the time we had mutex_obj_alloc() but not __cacheline_aligned.
|
#
d63d1917 |
| 08-Jan-2020 |
mgorny <mgorny@NetBSD.org> |
Include XSTATE note in x86 core dumps
Introduce a simple COREDUMP_MACHDEP_LWP_NOTES logic to provide machdep API for injecting per-LWP notes into coredumps, and use it to append PT_GETXSTATE note.
Include XSTATE note in x86 core dumps
Introduce a simple COREDUMP_MACHDEP_LWP_NOTES logic to provide machdep API for injecting per-LWP notes into coredumps, and use it to append PT_GETXSTATE note.
Since the XSTATE block uses the same format on i386 and amd64, the code does not have to conditionalize between 32-bit and 64-bit ELF format on that. However, it does need to distinguish between 32-bit and 64-bit PT_* values. In order to do that, it reuses PT32_* constant already present for ptrace(), and adds a matching PT64_GETXSTATE to satisfy the cpp logic.
show more ...
|
#
ff456035 |
| 24-Dec-2019 |
kamil <kamil@NetBSD.org> |
Introduce PT_LWPSTATUS + PT_LWPNEXT, obsolete PT_LWPINFO
PT_LWPINFO is a legacy ptrace(2) operation that was originally intended to retrieve the thread (LWP) information inside a traced process.
It
Introduce PT_LWPSTATUS + PT_LWPNEXT, obsolete PT_LWPINFO
PT_LWPINFO is a legacy ptrace(2) operation that was originally intended to retrieve the thread (LWP) information inside a traced process.
It has a number of flaws and is confused with PT_LWPINFO from FreeBSD.
PT_LWPSTATUS and PT_LWPNEXT address the problems (shortly by: rename, removal of pl_event) and introduces new features: signal context (pl_sigpend, pl_sigmask), LWP name (pl_name), LWP TLS base address (pl_private). The private pointer was so far missing information for a debugger.
PT_LWPSTATUS@nnn is now shipped with core(5) files and contain LWP specific information, so far missed in the core(5) files.
PT_LWPSTATUS retrieves LWP information for the prompted thread. PT_LWPNEXT retrieves LWP information for the next thread, borrowing the semantics from NetBSD specific PT_LWPINFO.
PT_LWPINFO is namespaced with __LEGACY_PT_LWPINFO and still available for the foreseeable future, without plans of removing it.
Add ATF tests for PT_LWPSTATUS + PT_LWPNEXT.
Keep ATF tests for PT_LWPINFO.
Switch GDB to new API.
Proposed on tech-kern@.
show more ...
|
#
b77cf5eb |
| 22-Nov-2019 |
pgoyette <pgoyette@NetBSD.org> |
Use __diagused
|
#
16e12c90 |
| 20-Nov-2019 |
pgoyette <pgoyette@NetBSD.org> |
Move all non-emulation-specific coredump code into the coredump module, and remove all #ifdef COREDUMP conditional compilation. Now, the coredump module is completely separated from the emulation mo
Move all non-emulation-specific coredump code into the coredump module, and remove all #ifdef COREDUMP conditional compilation. Now, the coredump module is completely separated from the emulation modules, and they can all be independently loaded and unloaded.
Welcome to 9.99.18 !
show more ...
|
#
1454a1ab |
| 22-Jan-2019 |
kamil <kamil@NetBSD.org> |
Fix code generation for programs with a faulty process map
In case of any errors of scanning the segments reset their content to a default value with zeros. This is achieved with shortening the p_fi
Fix code generation for programs with a faulty process map
In case of any errors of scanning the segments reset their content to a default value with zeros. This is achieved with shortening the p_filesz parameter.
This allows to emit core(5) files for a process regardless of its state of mappings, such as mapping pages after EOF in a file.
Fixes PR lib/53343
show more ...
|
#
a8a5c538 |
| 03-Sep-2018 |
riastradh <riastradh@NetBSD.org> |
Rename min/max -> uimin/uimax for better honesty.
These functions are defined on unsigned int. The generic name min/max should not silently truncate to 32 bits on 64-bit systems. This is purely a n
Rename min/max -> uimin/uimax for better honesty.
These functions are defined on unsigned int. The generic name min/max should not silently truncate to 32 bits on 64-bit systems. This is purely a name change -- no functional change intended.
HOWEVER! Some subsystems have
#define min(a, b) ((a) < (b) ? (a) : (b)) #define max(a, b) ((a) > (b) ? (a) : (b))
even though our standard name for that is MIN/MAX. Although these may invite multiple evaluation bugs, these do _not_ cause integer truncation.
To avoid `fixing' these cases, I first changed the name in libkern, and then compile-tested every file where min/max occurred in order to confirm that it failed -- and thus confirm that nothing shadowed min/max -- before changing it.
I have left a handful of bootloaders that are too annoying to compile-test, and some dead code:
cobalt ews4800mips hp300 hppa ia64 luna68k vax acorn32/if_ie.c (not included in any kernels) macppc/if_gm.c (superseded by gem(4))
It should be easy to fix the fallout once identified -- this way of doing things fails safe, and the goal here, after all, is to _avoid_ silent integer truncations, not introduce them.
Maybe one day we can reintroduce min/max as type-generic things that never silently truncate. But we should avoid doing that for a while, so that existing code has a chance to be detected by the compiler for conversion to uimin/uimax without changing the semantics until we can properly audit it all. (Who knows, maybe in some cases integer truncation is actually intended!)
show more ...
|
#
2fbdc140 |
| 21-Jan-2018 |
christos <christos@NetBSD.org> |
CID-1427760: While overrun can't happen, make it obvious that it can't
|
#
6526b4ab |
| 04-May-2017 |
kamil <kamil@NetBSD.org> |
Set clear comment about EI_OSABI and EI_ABIVERSION
/* * NetBSD sets generic SYSV OSABI and ABI version 0 * Native ELF files are distinguishable with NetBSD specific notes */
No functional change.
|
#
72197416 |
| 30-Mar-2017 |
christos <christos@NetBSD.org> |
factor out getauxv code.
|
#
0efbc0ee |
| 29-Mar-2017 |
kamil <kamil@NetBSD.org> |
Revert previous.
Pointed out by Christous Zoulas that ELF_AUX_ENTRIES * sizeof(AuxInfo) assumption is incomplete. There is emulation code that can use different values (smaller and larger).
|
#
b8f2b6a2 |
| 29-Mar-2017 |
kamil <kamil@NetBSD.org> |
Generate ELF AUXV for core(5) and ptrace(2) limited to the vector TYPE x V
Previously PT_DUMPCORE and PIOD_READ_AUXV and regular core dumping retrieved the vector of AuxInfo {a_type, a_v} + MAXPATHL
Generate ELF AUXV for core(5) and ptrace(2) limited to the vector TYPE x V
Previously PT_DUMPCORE and PIOD_READ_AUXV and regular core dumping retrieved the vector of AuxInfo {a_type, a_v} + MAXPATHLEN + ALIGN(1).
The extra data is not actually needed in the returned chunk. It can be retrieved with PT_READ_I operations and it's the preferred way to access them as the AuxInfo fields contain pointers (void* format) to them.
This changes the behavior of the kernel, no stable releases are affected with this move. Current software is not affected as other systems already stop generating data on AT_NULL. This streamlines the NetBSD behavior with other ELF format OSes. This move also simplifies determination if we got all the needed data inside the debugger and we no longer need to eliminate the unneeded chunk at the end.
Sponsored by <The NetBSD Foundation>
show more ...
|
#
e3613fb3 |
| 25-Jan-2017 |
christos <christos@NetBSD.org> |
PR/51916: Kamil Rytarowski: Don't multiply es_arglen with ptrsz since it is already in bytes and contains the maximum possible size: ELF_AUX_ENTRIES * sizeof(auxv) + MAXPATHLEN + ALIGN
|
#
a0eca9c7 |
| 06-Jan-2017 |
kamil <kamil@NetBSD.org> |
Introduce new ptrace(2) interface: PT_SET_SIGINFO and PT_GET_SIGINFO
This interface is designed to read signal information emited to tracee and fake this signal with new value.
This functionality i
Introduce new ptrace(2) interface: PT_SET_SIGINFO and PT_GET_SIGINFO
This interface is designed to read signal information emited to tracee and fake this signal with new value.
This functionality is required to distinguish types of events that occured in the tracee and intercepted by a debugger.
These accessors introduce a new structure type ptrace_siginfo: /* * Signal Information structure */ typedef struct ptrace_siginfo { siginfo_t psi_siginfo; /* signal information structure */ lwpid_t psi_lwpid; /* destination LWP of the signal * value 0 means the whole process * (route signal to all LWPs) */ } ptrace_siginfo_t;
Include <sys/siginfo.h> in <sys/ptrace.h> in order to not break existing software due to unknown symbol siginfo_t.
This interface has been proposed to the tech-kern@ mailing list.
Sponsored by <The NetBSD Foundation>
show more ...
|
#
90d55703 |
| 29-Sep-2016 |
christos <christos@NetBSD.org> |
Introduce and use PROC_PTRSZ() to handle differing pointer size 64->32 emulation.
|
#
7dddac27 |
| 05-Sep-2016 |
dholland <dholland@NetBSD.org> |
Build fix for when COREDUMP is turned off, from Ray Phillips in PR 51460.
|
#
58045560 |
| 27-Jun-2016 |
christos <christos@NetBSD.org> |
PR/51277: Fix compat32 coredumping that broke with the aux vector note addition.
|
#
8d3dedcf |
| 24-May-2016 |
christos <christos@NetBSD.org> |
Add a note for the auxv array so we can find our load location from a core file of a PIE binary.
|
#
09aa023c |
| 02-Apr-2014 |
matt <matt@NetBSD.org> |
If we are writing PN_XNUM or more phdrs, include one section header and encode the real # of sections in its sh_info.
|
#
4e897b50 |
| 05-Jan-2014 |
dsl <dsl@NetBSD.org> |
Fix previous slightly differently. No need to have an extra variable and to write to the list head.
|
#
5418fb9c |
| 05-Jan-2014 |
mrg <mrg@NetBSD.org> |
avoid use-after-free in *coredump(). fixes kernel crashes during coredump on sparc64.
|