Find a file
Domagoj Stolfa 8527bb2aee dtrace: Fix a kernel panic in printm()
When using printm(), one should always pass a scratch pointer to it.
This is achieved by calling printm with memref

  BEGIN { printm(fixed_len, memref(ptr, var_len)); }

which will return a pointer to the DTrace scratch space of size
sizeof(uintptr_t) * 2. However, one can easily call printm() as follows

  BEGIN { printm(10, (void *)NULL); }

and panic the kernel as a result. This commit does two things:

  (1) adds a new macro DTRACE_INSCRATCHPTR(mstate, ptr, howmany) which
      checks if a certain pointer is in the DTrace scratch space;
  (2) uses DTRACE_INSCRATCHPTR() to implement a check on printm()'s DIFO
      return value in order to avoid the panic and sets CPU_DTRACE_BADADDR
      if the address is not in the scratch space.

Reviewed by:	markj
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D41722
2023-09-06 10:00:59 -04:00
.cirrus-ci Cirrus-CI: add some timing info on pkg install failure 2021-08-04 15:02:00 -04:00
.github MAINTAINERS: Add myself to stand 2023-05-07 22:30:10 -06:00
bin ps: add a new option -D to reimplement tree traversal 2023-08-24 18:35:56 +02:00
cddl zfs: merge openzfs/zfs@804414aad 2023-08-26 23:51:42 +02:00
contrib Merge commit 4bb2416d42eb from llvm-project (by Jessica Clarke): 2023-09-04 09:33:27 +01:00
crypto OpenSSL: Fix handling of the "0:" label in arm-xlate.pl 2023-08-29 14:38:11 -07:00
etc Add mac_grantbylabel 2023-08-24 17:42:11 -07:00
gnu Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
include time.h: Fix visibility check for C11 and C23 features. 2023-09-06 03:38:01 +02:00
kerberos5 Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
lib libcasper: reference system.fileargs service 2023-09-06 09:53:01 -04:00
libexec rtld: switch from malloc_aligned() to __crt_aligned_alloc() 2023-08-21 17:16:42 +03:00
release release: remove arm/armv6 RPI-B configuration file 2023-08-31 19:24:38 -04:00
rescue zfs: merge openzfs/zfs@804414aad 2023-08-26 23:51:42 +02:00
sbin libipf: fix parser error message. 2023-08-31 22:15:54 +02:00
secure libcrypto: Switch back to the generated assembly in sys/crypto/openssl 2023-08-29 14:46:44 -07:00
share vfs: copy_file_range() between multiple mountpoints of the same fs type 2023-09-06 14:28:23 +02:00
stand stand: lua: module names should permit more 2023-09-04 21:28:11 -05:00
sys dtrace: Fix a kernel panic in printm() 2023-09-06 10:00:59 -04:00
targets Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
tests tests: Skip all tests that require mdconfig when /dev/mdctl missing 2023-09-02 13:16:22 -06:00
tools sendmail: remove all m4 files with WITHOUT_SENDMAIL 2023-09-06 14:23:27 +02:00
usr.bin split: Fix linecount parsing. 2023-09-06 03:29:31 +00:00
usr.sbin jail.conf(5): Fix and expand description of ".include". 2023-09-05 13:35:54 -07:00
.arcconfig arcanist: use FreeBSD/git project repository instead of FreeBSD/svn 2022-08-23 14:16:41 +00:00
.arclint
.cirrus.yml Cirrus-CI: restore amd64-gcc12 build/test on main 2023-08-18 22:35:39 -04:00
.clang-format Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
.git-blame-ignore-revs Add git-blame ignore file 2023-01-23 15:27:25 -05:00
.gitattributes Add a basic clang-format configuration file 2019-06-07 15:23:52 +00:00
.gitignore .gitignore: Ignore LSP generated .cache 2023-03-07 10:04:18 -05:00
CONTRIBUTING.md CONTRIBUTING.md: reinsert double spaces 2023-07-10 12:24:24 -06:00
COPYRIGHT Happy New Year 2023! 2023-01-01 13:44:43 +08:00
LOCKS Remove $FreeBSD$: one-line bare tag 2023-08-16 11:55:20 -06:00
MAINTAINERS Remove $FreeBSD$: one-line bare tag 2023-08-16 11:55:20 -06:00
Makefile Makefile: Support universe-toolchain on non-FreeBSD 2023-08-23 18:00:16 +01:00
Makefile.inc1 Teach make showconfig about group options 2023-09-01 17:54:23 +01:00
Makefile.libcompat build{libcompat}: Pass UNIVERSE_TOOLCHAIN_PATH to the _lc_build-tools submake 2023-08-21 21:00:45 -07:00
Makefile.sys.inc Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
ObsoleteFiles.inc rtw88/rtw89: remove local firmware. 2023-09-05 21:13:18 +00:00
README.md README.md: link to the list of supported platforms 2022-11-01 12:20:55 -03:00
RELNOTES RELNOTES: Clarify package building on older branches for 32-bit. 2023-08-17 14:25:44 -07:00
UPDATING UPDATING: typo fox 2023-09-01 18:23:23 +01:00

FreeBSD Source:

This is the top level of the FreeBSD source directory.

FreeBSD is an operating system used to power modern servers, desktops, and embedded platforms. A large community has continually developed it for more than thirty years. Its advanced networking, security, and storage features have made FreeBSD the platform of choice for many of the busiest web sites and most pervasive embedded networking and storage devices.

For copyright information, please see the file COPYRIGHT in this directory. Additional copyright information also exists for some sources in this tree - please see the specific source directories for more information.

The Makefile in this directory supports a number of targets for building components (or all) of the FreeBSD source tree. See build(7), config(8), FreeBSD handbook on building userland, and Handbook for kernels for more information, including setting make(1) variables.

For information on the CPU architectures and platforms supported by FreeBSD, see the FreeBSD website's Platforms page.

Source Roadmap:

Directory Description
bin System/user commands.
cddl Various commands and libraries under the Common Development and Distribution License.
contrib Packages contributed by 3rd parties.
crypto Cryptography stuff (see crypto/README).
etc Template files for /etc.
gnu Commands and libraries under the GNU General Public License (GPL) or Lesser General Public License (LGPL). Please see gnu/COPYING and gnu/COPYING.LIB for more information.
include System include files.
kerberos5 Kerberos5 (Heimdal) package.
lib System libraries.
libexec System daemons.
release Release building Makefile & associated tools.
rescue Build system for statically linked /rescue utilities.
sbin System commands.
secure Cryptographic libraries and commands.
share Shared resources.
stand Boot loader sources.
sys Kernel sources (see sys/README.md).
targets Support for experimental DIRDEPS_BUILD
tests Regression tests which can be run by Kyua. See tests/README for additional information.
tools Utilities for regression testing and miscellaneous tasks.
usr.bin User commands.
usr.sbin System administration commands.

For information on synchronizing your source tree with one or more of the FreeBSD Project's development branches, please see FreeBSD Handbook.