Commit Graph

117 Commits

Author SHA1 Message Date
Dmitry Chagin
bd35e83bcf libsysdecode: Decode linux_clone syscall flags
Reviewed by:		emaste
Differential Revision:	https://reviews.freebsd.org/D40150
MFC after:		1 week
2023-05-26 19:32:20 +03:00
Warner Losh
4d846d260e spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with:		pfg
MFC After:		3 days
Sponsored by:		Netflix
2023-05-12 10:44:03 -06:00
Simon J. Gerraty
d9a4274795 Update/fix Makefile.depend for userland 2023-04-18 17:14:23 -07:00
Warner Losh
7968a06a69 sysdecode: Add aarch64
FREEBSD32 API is also supported on aarch64. Refer to aarch64 instead of
arm64 because it's about the architecture (powerpc64), not the kernel
interface...

Sponsored by:		Netflix
2023-04-11 22:14:17 -06:00
Dmitry Chagin
c8a79231a5 linux(4): Rename linux_timer.h to linux_time.h
To avoid confusing people, rename linux_timer.h to linux_time.h,
as linux_timer.c is the implementation of timer syscalls only,
while linux_time.c contains implementation of all stuff declared
in linux_time.h.

MFC after:		2 weeks
2023-02-14 17:46:33 +03:00
Mark Johnston
34c8598eb1 libsysdecode: Match socket option names containing underscores
MFC after:	1 week
Sponsored by:	Modirum MDPay
Sponsored by:	Klara, Inc.
2022-11-02 13:46:24 -04:00
Dag-Erling Smørgrav
0aa2700123 Put OPIE to rest.
Differential Revision: https://reviews.freebsd.org/D36592
2022-10-02 03:37:29 +02:00
Mark Johnston
ec014502ee libsysdecode: Grab some more ioctl definitions from CAM
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-06-30 10:31:26 -04:00
Dmitry Chagin
ed366c37d8 libsysdecode: Fix a typo in my email
Reported by:		Mikaël Urankar
MFC after:		2 weeks
2022-06-23 12:29:29 +03:00
Dmitry Chagin
fde775bc53 libsysdecode: Decode Linux open() flags
MFC after:		2 weeks
2022-06-22 14:26:10 +03:00
Dmitry Chagin
d2b3237eeb libsysdecode: Decode Linux *at() flags
MFC after:		2 weeks
2022-06-22 14:25:36 +03:00
Dmitry Chagin
39de84b619 kdump: Decode Linux clock_nanosleep syscall
MFC after:		2 weeks
2022-06-22 14:21:42 +03:00
Dmitry Chagin
f587a2a765 kdump: Decode Linux sigprocmask how argument
MFC after:		2 weeks
2022-06-22 14:20:39 +03:00
Dmitry Chagin
2fc3a51db1 libsysdecode: Decode setitimer, getitimer which argument
Reviewed by:		jhb
Differential revision:	https://reviews.freebsd.org/D35230
MFC after:		2 weeks
2022-06-22 14:17:10 +03:00
Dmitry Chagin
f85848fc61 libsysdecode: Add method for decoding Linux signal names
Reviewed by:		jhb
Differential revision:	https://reviews.freebsd.org/D35215
MFC after:		2 weeks
2022-06-22 14:00:05 +03:00
Dmitry Chagin
b69ae1a34c libsysdecode: Add preliminary support for decoding Linux syscalls
Differential revision:	https://reviews.freebsd.org/D35354
MFC after:		2 weeks
2022-06-22 13:58:53 +03:00
Dmitry Chagin
9dac609629 libsysdecode: For future use extract common code to a separate files
Reviewed by:		jhb, emaste
Differential revision:	https://reviews.freebsd.org/D35353
MFC after:		2 weeks
2022-06-22 13:12:21 +03:00
Dmitry Chagin
41068268ec libsysdecode: Fix decoding of SCHED_ flags
Use sys/sched.h where SCHED_ flags are defined.

Reviewed by:		emaste
Differential revision:	https://reviews.freebsd.org/D35208
MFC after:		2 weeks
2022-05-16 21:57:48 +03:00
Mark Johnston
d0f245d21f libsysdecode: Add regression tests for sysdecode_cap_rights(3)
Reviewed by:	jhb, emaste
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34900
2022-04-15 10:23:32 -04:00
Mark Johnston
354efc4c94 libsysdecode: Include required headers in sysdecode.h
Make sysdecode.h self-contained rather than forcing all consumers to
include dependencies.  No functional change intended.

Reviewed by:	pauamma_gundo.com, jhb, emaste
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34899
2022-04-15 10:22:29 -04:00
Mark Johnston
869199d992 libsysdecode: Fix decoding of Capsicum rights
Capsicum rights are a bit tricky since some of them are subsets of
others, and one can have rights R1 and R2 such that R1 is a subset of
R2, but there is no collection of named rights whose union is R2.  So,
they don't behave like most other flag sets.  sysdecode_cap_rights(3)
does not handle this properly and so can emit misleading decodings.

Try to fix all of these problems:
- Include composite rights in the caprights table.
- Use a constructor to sort the caprights table such that "larger"
  rights appear first and thus are matched first.
- Don't print rights that are a subset of rights already printed, so as
  to minimize the length of the output.
- Print a trailing message if some of the specific rights are not
  matched by the table.

PR:		263165
Reviewed by:	pauamma_gundo.com (doc), jhb, emaste
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34874
2022-04-13 10:51:30 -04:00
Mateusz Guzik
f3f3e3c44d fd: add close_range(..., CLOSE_RANGE_CLOEXEC)
For compatibility with Linux.

MFC after:	3 days
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D34424
2022-03-03 17:21:58 +00:00
Mark Johnston
e2576591b9 libsysdecode: Decode sendmsg/recvmsg flags containing an underscore
Otherwise MSG_CMSG_CLOEXEC is not decoded.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-01-04 09:46:23 -05:00
John Baldwin
680d70b59e sysdecode_enum.3: Fix a typo: SIGBTRAP -> SIGTRAP.
MFC after:	3 days
Sponsored by:	DARPA
2021-10-05 14:55:18 -07:00
Nathaniel Wesley Filardo
701a99939f libsysdecode: Permit _ in VM_PROT_(.*) names.
CheriBSD defines additional protection flags which use underscores
such as VM_PROT_READ_CAP and VM_PROT_WRITE_CAP.

Obtained from:	CheriBSD
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D30017
2021-09-23 17:31:39 -07:00
John Baldwin
b5f90655ea sysdecode.3: Remove documentation of CloudABI ABIs.
Fixes:		cf0ee8738e Drop cloudabi
2021-09-22 17:02:17 -07:00
Olivier Houchard
9bab18b861 libsysdecode: Decode FreeBSD32 syscalls on arm64.
Add aarch64 to the list of architectures that can run 32bits FreeBSD binaries,
so that truss works correctly with an arm32 binary.
The same should probably be done with mips.

MFC After:	1 week
2021-09-23 00:24:50 +02:00
Konstantin Belousov
cf0ee8738e Drop cloudabi
According to https://github.com/NuxiNL/cloudlibc:
CloudABI is no longer being maintained. It was an awesome experiment,
but it never got enough traction to be sustainable.

There is no reason to keep it in FreeBSD.

Approved by:	ed (private mail)
Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D31923
2021-09-22 00:18:44 +03:00
Konstantin Belousov
f575573ca5 Remove PT_GET_SC_ARGS_ALL
Reimplement bdf0f24bb1 by checking for the caller' ABI in
the implementation of PT_GET_SC_ARGS, and copying out everything if
it is Linuxolator.

Also fix a minor information leak: if PT_GET_SC_ARGS_ALL is done on the
thread reused after other process, it allows to read some number of that
thread last syscall arguments. Clear td_sa.args in thread_alloc().

Reviewed by:	jhb
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D31968
2021-09-16 20:11:27 +03:00
Edward Tomasz Napierala
bdf0f24bb1 linux: implement PTRACE_GET_SYSCALL_INFO
This is one of the pieces required to make modern (ie Focal)
strace(1) work.

Reviewed By:	jhb (earlier version)
Sponsored by:	EPSRC
Differential Revision:	https://reviews.freebsd.org/D28212
2021-09-14 20:19:55 +00:00
Michael Tuexen
f25266bee7 libsysdecode: fix decoding of TCP_NOPUSH and TCP_MD5SIG
TCP_FASTOPEN_MIN_COOKIE_LEN was incorrectly registered as a name of
a IPPROTO_TCP level socket option, which overwrote TCP_NOPUSH.
TCP_FASTOPEN_PSK_LEN was incorrectly registered as a name of an
IPPROTO_TCP level socket option, which overwrote TCP_MD5SIG.

MFC after:	3 days
Sponsored by:	Netflix, Inc.
2021-02-09 23:42:27 +01:00
Kyle Evans
3b27074b25 libsysdecode: decode _UMTX_OP flags
Assume that UMTX_OP with a double underbar following is a flag, while any
underbar+alphanumeric combination immeiately following is an op.

This was a part of D27325.

Reviewed by:	kib
2020-12-09 03:22:44 +00:00
Pawel Biernacki
569da02b0c libsysdecode: account for invalid protection flags
Reported by:	jhb
MFC with:	r368022
2020-11-26 09:07:45 +00:00
Pawel Biernacki
4cbec44397 libsysdecode: correctly decode mmap flags
r352913 added decoding of mmap PROT_MAX()'d flags but didn’t account for the
case where different values were specified for PROT_MAX and regular flags.
Fix it.

Submitted by:	sigsys_gmail.com
Reported by:	sigsys_gmail.com
MFC after:	7 days
Differential Revision:	https://reviews.freebsd.org/D27312
2020-11-25 16:30:57 +00:00
Edward Tomasz Napierala
7abf30d339 Make linux_errtbl[] static.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D27004
2020-11-03 19:12:33 +00:00
Edward Tomasz Napierala
1a8577fa68 Add defines for Linux errno values and use them to make linux_errtbl[]
more readable.  While here, add linux_check_errtbl() function to make
sure we don't leave holes.

No objections:	emaste (earlier version)
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D26972
2020-10-29 14:23:52 +00:00
Gordon Bergling
3d265fce43 Fix a few mandoc issues
- skipping paragraph macro: Pp after Sh
- sections out of conventional order: Sh EXAMPLES
- whitespace at end of input line
- normalizing date format
2020-10-09 19:12:44 +00:00
Konstantin Belousov
1352798db3 Fix compilation of libsysdecode after r365522, should have been part of it.
Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D24652
2020-09-09 22:18:44 +00:00
Rick Macklem
a8537fe404 Add MSG_TLSAPPDATA to lib/libsysdecode/mktables.
I have no idea what this does (and until now that it even existed), but
apparently it needs this entry changed for the MSG_TLSAPPDATA, since
it is kernel only.
2020-08-20 03:53:18 +00:00
John Baldwin
59838c1a19 Retire procfs-based process debugging.
Modern debuggers and process tracers use ptrace() rather than procfs
for debugging.  ptrace() has a supserset of functionality available
via procfs and new debugging features are only added to ptrace().
While the two debugging services share some fields in struct proc,
they each use dedicated fields and separate code.  This results in
extra complexity to support a feature that hasn't been enabled in the
default install for several years.

PR:		244939 (exp-run)
Reviewed by:	kib, mjg (earlier version)
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D23837
2020-04-01 19:22:09 +00:00
John Baldwin
7a9cfa086a Fix the workaround to ignore the #warning for GCC.
clang and gcc use different warning flags for #warning preprocessor
directives.

Reported by:	Jenkins
MFC after:	1 week
2020-03-17 23:22:07 +00:00
John Baldwin
8d8a74e69e Mark procfs-based process debugging as deprecated for FreeBSD 13.
Attempting to use ioctls on /proc/<pid>/mem to control a process will
trigger warnings on the console.  The <sys/pioctl.h> include file will
also now emit a compile-time warning when used from userland.

Reviewed by:	emaste
MFC after:	1 week
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D23822
2020-03-17 18:44:03 +00:00
Kyle Evans
c70019dd0a libsysdecode: grab shmflags from sys/mman.h, add decode method
Any SHM_* flag here is (and likely will continue to be) a shmflag that may
be passed to shm_open2(), with exception to SHM_ANON. This is a prereq to
adding appropriate support to truss/kdump.

Reviewed by:	kaktus (slightly earlier version)
Differential Revision:	https://reviews.freebsd.org/D23733
2020-02-19 14:52:32 +00:00
Kyle Evans
a33774adb3 Update libssp paths in various Makefile.depend* files
I've been advised that the model that uses these are fairly resilient, but
we do know the proper path to use (or remove, in the case of ^/targets/...),
so go ahead and update them to reflect that.
2020-01-06 18:15:55 +00:00
Simon J. Gerraty
2c9a9dfc18 Update Makefile.depend files
Update a bunch of Makefile.depend files as
a result of adding Makefile.depend.options files

Reviewed by:	 bdrewery
MFC after:	1 week
Sponsored by:   Juniper Networks
Differential Revision:  https://reviews.freebsd.org/D22494
2019-12-11 17:37:53 +00:00
Pawel Biernacki
c1dd36cfca libsysdecode: decode PROT_MAX flags
Extend libsysdecode to pretty-print PROT_MAX flags and fix decoding of regular protection flags broken since r349240.

before:
truss:
mmap(0x0,40960,0x30000,MAP_PRIVATE|MAP_ANON|MAP_NOCORE,-1,0x0) = 34366234624 (0x800632000)
kdump:
11439 protmax  CALL  mmap(0,0xa000,0x30000<><invalid>196608,0x21002<MAP_PRIVATE|MAP_ANON|MAP_NOCORE>,0xffffffff,0)

after:
truss:
mmap(0x0,40960,PROT_MAX(PROT_READ|PROT_WRITE)|PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON|MAP_NOCORE,-1,0x0) = 34366234624 (0x800632000)
kdump:
11439 protmax  CALL  mmap(0,0xa000,0x30000<PROT_MAX(PROT_READ|PROT_WRITE)|PROT_READ|PROT_WRITE>,0x21002<MAP_PRIVATE|MAP_ANON|MAP_NOCORE>,0xffffffff,0)

Reviewed by:	kib (mentor)
Approved by:	kib (mentor)
Differential Revision:	https://reviews.freebsd.org/D21706
2019-09-30 19:03:43 +00:00
Emmanuel Vadot
4c1a82cea5 pkgbase: Create a FreeBSD-utilities package and make it the default one
The default package use to be FreeBSD-runtime but it should only contain
binaries and libs enough to boot to single user and repair the system, it
is also very handy to have a package that can be tranform to a small mfsroot.
So create a new package named FreeBSD-utilities and make it the default one.
Also move a few binaries and lib into this package when it make sense.
Reviewed by:	bapt, gjb
Differential Revision:	https://reviews.freebsd.org/D21506
2019-09-05 14:15:47 +00:00
Bryan Drewery
dc89d06976 Rework r339635 to fix .depend.tables.h handling.
Avoid touching the tables.h file unless it has changed to avoid unneeded
rebuilds.

Also revert r350301's explicit dependencies.

Reviewed by:	emaste
MFC after:	2 weeks
X-MFC-With:	r339635 (kevans request)
PR:		238828
Sponsored by:	DellEMC
Differential Revision:	https://reviews.freebsd.org/D21295
2019-08-16 22:34:10 +00:00
Ed Maste
78aee653e9 libsysdecode: use the proper include directory
Reported by:	cy
Reviewed by:	lwhsu
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D21068
2019-07-25 17:10:17 +00:00
Ed Maste
9e92b0f015 libsysdecode: add explicit dependencies on recently changed headers
r349369 removed IP_MIN_MEMBERSHIPS and IPV6_MIN_MEMBERSHIPS, and r349893
removed TCP_RACK_SESS_CWV. libsysdecode lacked dependencies to trigger a
rebuild of tables.h.

Add explicit dependencies as a workaround to address these specific
cases; a holistic solution is still needed.

Sponsored by:	The FreeBSD Foundation
2019-07-24 21:06:19 +00:00