History log of /netbsd/sys/kern/sys_ptrace_common.c (Results 1 – 25 of 92)
Revision Date Author Comments
# a0b1e536 09-Aug-2021 andvar <andvar@NetBSD.org>

fix various typos in compatibility, mainly in comments.


# e2c14a20 04-Nov-2020 pgoyette <pgoyette@NetBSD.org>

Merge the two separate sets of init/fini routines and unbreak the build.

XXX Still does not fix the problems noted with 32-bit arm - that will
need a lot more thought.


# 0d4c4621 04-Nov-2020 pgoyette <pgoyette@NetBSD.org>

Finish the proper naming of the module init/fini routines. Should
fix the "ptrace cannot be used by unpriv user" issue reported by
Rin Okuyama (thanks for the detailed report and analysis).


# 0bf72676 01-Nov-2020 pgoyette <pgoyette@NetBSD.org>

Separate the compat_netbsd32_coredump from the compat_netbsd32 and
coredump modules, into its own module.

Welcome to 7.99.75 !!!


# 86e19ed3 25-Oct-2020 pgoyette <pgoyette@NetBSD.org>

ptrace_Common is a module unto itself. Don't use the ptrace module's
init/fini routines.


# 6e200c14 20-Oct-2020 christos <christos@NetBSD.org>

Basic register read/write functionality and lwp setting are always provided
by the kernel because they are needed by multiple things
(ptrace/procfs/coredump), so move them to sys_process_lwpstatus (t

Basic register read/write functionality and lwp setting are always provided
by the kernel because they are needed by multiple things
(ptrace/procfs/coredump), so move them to sys_process_lwpstatus (this file
should be renamed to sys_process_common.c?)

show more ...


# ee78b14a 19-Oct-2020 kamil <kamil@NetBSD.org>

Rollback unintended changes in the previous commit


# 37ef3f17 19-Oct-2020 kamil <kamil@NetBSD.org>

Remove obsolete references to 4.4BSD papers


# 4bec93cd 15-Oct-2020 mgorny <mgorny@NetBSD.org>

Fix the machine-dependent ptrace requests to respect LWP number

Fix the machine-dependent ptrace register-related requests (e.g.
PT_GETXMMREGS, PT_GETXSTATE on x86) to correctly respect the LWP numb

Fix the machine-dependent ptrace requests to respect LWP number

Fix the machine-dependent ptrace register-related requests (e.g.
PT_GETXMMREGS, PT_GETXSTATE on x86) to correctly respect the LWP number
passed as the data argument. Before this change, these requests
did not operate on the requested LWP of a multithreaded program.

This change required moving ptrace_update_lwp() out of unit scope,
and changing ptrace_machdep_dorequest() function to take a pointer
to pointer as the second argument, consistently with ptrace_regs().

I am planning to extend the ATF ptrace() register tests in the future
to check for regressions in multithreaded programs, as time permits.

Reviewed by kamil.

show more ...


# 8472f807 30-May-2020 maxv <maxv@NetBSD.org>

Introduce PTRACE_REGS_ALIGN, and on x86, enforce a 16-byte alignment, due
to fpregs having fxsave which requires 16-byte alignment.

Reported-by: syzbot+f44d47e617ebf7fda081@syzkaller.appspotmail.com


# 3d98cb73 26-May-2020 kamil <kamil@NetBSD.org>

Avoid taking lwp_lock when calling process_sstep() for sibling LWPs

This makes the code consistend between single-threaded and multi-threaded
code.


# 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.


# e8191730 14-May-2020 kamil <kamil@NetBSD.org>

Introduce new ptrace(2) operations: PT_SET_SIGPASS and PT_GET_SIGPASS

They deliver the logic of bypassing selected signals directly to the
debuggee, without informing the debugger.

This can be used

Introduce new ptrace(2) operations: PT_SET_SIGPASS and PT_GET_SIGPASS

They deliver the logic of bypassing selected signals directly to the
debuggee, without informing the debugger.

This can be used to implement the QPassSignals GDB/LLDB protocol.

This call can be useful to avoid signal races in ATF ptrace tests.

show more ...


# 56614f15 08-May-2020 kamil <kamil@NetBSD.org>

Clear PSL_TRACEDCHILD on ptrace(PT_DETACH)

This avoids potential race of detaching and attaching to a prestarted
process and receiving SIGTRAP instead of SIGSTOP.


# 22b72e1e 22-Feb-2020 maxv <maxv@NetBSD.org>

pass the address of the field, instead of relying on it being the first
field of the structure, no functional change, ok kamil


# a0cb70da 03-Jan-2020 kamil <kamil@NetBSD.org>

Correct the rule to iterate over LWPs with PT_LWPNEXT and PT_LWPINFO

Correctly exclude dead/dying/zombie and system threads.

Fixes kern/54802 (gdb -p kills the kernel) by <martin>


# 8a054145 26-Dec-2019 kamil <kamil@NetBSD.org>

Put ptrace_read_lwpstatus() and process_read_lwpstatus() to a new file

Fixes "no PTRACE" kernel build, in particular zaurus kernel=INSTALL_C700.


# df839d52 25-Dec-2019 kamil <kamil@NetBSD.org>

Cast PTRACE_LWP_GETPRIVATE to (void *) through (intptr_t)

Fixes sparc build.


# 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 ...


# 163e7c70 22-Nov-2019 rin <rin@NetBSD.org>

Fix regression introduced to ptrace_regs() in rev 1.27:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/kern/sys_ptrace_common.c#rev1.27

Size of registers should be determined from tracer, NOT tracee.

Fix regression introduced to ptrace_regs() in rev 1.27:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/kern/sys_ptrace_common.c#rev1.27

Size of registers should be determined from tracer, NOT tracee.

Now, 64-bit tracer can manipulate registers of 32-bit tracee again.
gdb for amd64 works for i386 binaries to some extent.

XXX
pullup to netbsd-9 and -8.

show more ...


# 427f6fa6 17-Nov-2019 rin <rin@NetBSD.org>

Fix pointer arithmetic for 32-bit process on LP64 kernel in
process_auxv_offset().

Now, PIOD_READ_AUXV works fine with COMPAT_NETBSD32.

XXX
pullup to netbsd-9 and netbsd-8


# 4da93bc8 13-Nov-2019 pgoyette <pgoyette@NetBSD.org>

Return success if no coredump module is loaded/hooked.


# 7ff0c96a 10-Nov-2019 pgoyette <pgoyette@NetBSD.org>

Convert the coredump_vec modular function pointer to use the new
compat_hook mechanism.

XXX Should be pulled up to -9 despite the kernel <--> module ABI
XXX change.


# 9ce7f4bb 16-Oct-2019 christos <christos@NetBSD.org>

Add and use __FPTRCAST, requested by uwe@


# 30c4e574 16-Oct-2019 christos <christos@NetBSD.org>

Add void * function pointer casts. There are different ways to "fix" those
warnings:
1. this one: add a void * cast (which I think is the least intrusive)
2. add pragmas to elide the warning

Add void * function pointer casts. There are different ways to "fix" those
warnings:
1. this one: add a void * cast (which I think is the least intrusive)
2. add pragmas to elide the warning
3. add intermediate inline conversion functions
4. change the called function prototypes, adding unused arguments and
converting some of the pointer arguments to void *.
5. make the functions varyadic (which defeats the purpose of checking)
6. pass command line flags to elide the warning
I did try 3 and 4 and I was not pleased with the result (sys_ptrace_common.c)
(3) added too much code and defines, and (4) made the regular use clumsy.

show more ...


1234