Revision tags: release/14.2.0, release/13.4.0 |
|
#
86077f4f |
| 24-Aug-2024 |
Ahmad Khalifa <ahmadkhalifa570@gmail.com> |
stand: use globals for the kernel and module types
Reviewed by: imp, kib Pull Request: https://github.com/freebsd/freebsd-src/pull/1394
|
Revision tags: release/14.1.0, release/13.3.0 |
|
#
4a3cf5f3 |
| 13-Dec-2023 |
John Baldwin <jhb@FreeBSD.org> |
Stop #defining FREEBSD_ELF
This was originally used (along with FREEBSD_AOUT) to prefer the use of ELF in various tools instead of a.out as part of the a.out to ELF transition in the 3.x days. The
Stop #defining FREEBSD_ELF
This was originally used (along with FREEBSD_AOUT) to prefer the use of ELF in various tools instead of a.out as part of the a.out to ELF transition in the 3.x days. The last use of it was removed from <link.h> in commit 66422f5b7a1a6055f0b2358268eb902aab6e2e3e back in 2002, but various files still #define it.
Reviewed by: kevans, imp, emaste Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D42964
show more ...
|
#
7c43148a |
| 24-Nov-2023 |
Warner Losh <imp@FreeBSD.org> |
stand: Automated cleanup of cdefs and other formatting
Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row.
Rem
stand: Automated cleanup of cdefs and other formatting
Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row.
Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/
Sponsored by: Netflix
show more ...
|
Revision tags: release/14.0.0 |
|
#
1d386b48 |
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
Revision tags: release/13.2.0, release/12.4.0, release/13.1.0 |
|
#
ec042f46 |
| 13-Feb-2022 |
Simon J. Gerraty <sjg@FreeBSD.org> |
Add support for module_verbose
Set module_verbose to control the printing of information about loaded modules and kernel:
0 MODULE_VERBOSE_SILENT None 1 MODULE_VERBOSE_SIZE Pathname and size 2 MODU
Add support for module_verbose
Set module_verbose to control the printing of information about loaded modules and kernel:
0 MODULE_VERBOSE_SILENT None 1 MODULE_VERBOSE_SIZE Pathname and size 2 MODULE_VERBOSE_TWIDDLE as for 1 but also twiddle for progress 3 MODULE_VERBOSE_FULL extra detail
When the loader is verifying modules we already have a running indication of progress and module_verbose=0 makes sense.
Reviewed by: rpokala Differential Revision: https://reviews.freebsd.org/D34245
show more ...
|
Revision tags: release/12.3.0 |
|
#
297e9f36 |
| 12-Jul-2021 |
Warner Losh <imp@FreeBSD.org> |
loader: Don't reserve space for symbols twice.
The current code bumps lastaddr twice for the symbol table location. However, the first bump is bogus and results in wasted space. Remove it.
PR: 11
loader: Don't reserve space for symbols twice.
The current code bumps lastaddr twice for the symbol table location. However, the first bump is bogus and results in wasted space. Remove it.
PR: 110995 Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31017
show more ...
|
Revision tags: release/13.0.0 |
|
#
7b1b5aad |
| 16-Mar-2021 |
Mark Johnston <markjdb@gmail.com> |
stand: Load INIT_ARRAY and FINI_ARRAY sections
This is required for preloading modules into a KASAN-configured kernel.
MFC after: 1 week Sponsored by: The FreeBSD Foundation
|
Revision tags: release/12.2.0, release/11.4.0 |
|
#
16b90565 |
| 10-Mar-2020 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r358731 through r358831.
|
#
afc571b1 |
| 08-Mar-2020 |
Simon J. Gerraty <sjg@FreeBSD.org> |
veloader use vectx API for kernel and modules
The vectx API, computes the hash for verifying a file as it is read. This avoids the overhead of reading files twice - once to verify, then again to loa
veloader use vectx API for kernel and modules
The vectx API, computes the hash for verifying a file as it is read. This avoids the overhead of reading files twice - once to verify, then again to load.
For doing an install via loader, avoiding the need to rewind large files is critical.
This API is only used for modules, kernel and mdimage as these are the biggest files read by the loader. The reduction in boot time depends on how expensive the I/O is on any given platform. On a fast VM we see 6% improvement.
For install via loader the first file to be verified is likely to be the kernel, so some of the prep work (finding manifest etc) done by verify_file() needs to be factored so it can be reused for vectx_open().
For missing or unrecognized fingerprint entries, we fail in vectx_open() unless verifying is disabled.
Otherwise fingerprint check happens in vectx_close() and since this API is only used for files which must be verified (VE_MUST) we panic if we get an incorrect hash.
Reviewed by: imp,tsoome MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org//D23827
show more ...
|
Revision tags: release/12.1.0, release/11.3.0 |
|
#
2aaf9152 |
| 18-Mar-2019 |
Alan Somers <asomers@FreeBSD.org> |
MFHead@r345275
|
#
b18a4cca |
| 05-Mar-2019 |
Enji Cooper <ngie@FreeBSD.org> |
MFhead@r344786
|
#
844fc3e9 |
| 04-Mar-2019 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r344549 through r344775.
|
#
8df8b2d3 |
| 26-Feb-2019 |
Simon J. Gerraty <sjg@FreeBSD.org> |
Enable veriexec for loader
This relies on libbearssl and libsecureboot to verify files read by loader in a maner equivalent to how mac_veriexec
Note: disabled by default. Use is initially expected
Enable veriexec for loader
This relies on libbearssl and libsecureboot to verify files read by loader in a maner equivalent to how mac_veriexec
Note: disabled by default. Use is initially expected to be by embeded vendors
Reviewed by: emaste, imp Sponsored by: Juniper Networks Differential Revision: D16336
show more ...
|
Revision tags: release/12.0.0, release/11.2.0 |
|
#
56e53cb8 |
| 13-Mar-2018 |
Warner Losh <imp@FreeBSD.org> |
Prefer uintXX_t to u_intXX_t
A foolish consistency is the hobgoblin of little minds, adored by little statesmen and philosophers and divines. With consistency a great soul has simply nothing to do.
Prefer uintXX_t to u_intXX_t
A foolish consistency is the hobgoblin of little minds, adored by little statesmen and philosophers and divines. With consistency a great soul has simply nothing to do. -- Ralph Waldo Emerson
show more ...
|
#
15746ef4 |
| 06-Feb-2018 |
John Baldwin <jhb@FreeBSD.org> |
Ignore relocation tables for non-memory-resident sections.
As a followup to r328101, ignore relocation tables for ELF object sections that are not memory resident. For modules loaded by the loader,
Ignore relocation tables for non-memory-resident sections.
As a followup to r328101, ignore relocation tables for ELF object sections that are not memory resident. For modules loaded by the loader, ignore relocation tables whose associated section was not loaded by the loader (sh_addr is zero). For modules loaded at runtime via kldload(2), ignore relocation tables whose associated section is not marked with SHF_ALLOC.
Reported by: Mori Hiroki <yamori813@yahoo.co.jp>, adrian Tested on: mips, mips64 MFC after: 1 month Sponsored by: DARPA / AFRL
show more ...
|
#
58c4aee0 |
| 17-Jan-2018 |
John Baldwin <jhb@FreeBSD.org> |
Require the SHF_ALLOC flag for program sections from kernel object modules.
ELF object files can contain program sections which are not supposed to be loaded into memory (e.g. .comment). Normally t
Require the SHF_ALLOC flag for program sections from kernel object modules.
ELF object files can contain program sections which are not supposed to be loaded into memory (e.g. .comment). Normally the static linker uses these flags to decide which sections are allocated to loadable program segments in ELF binaries and shared objects (including kernels on all architectures and kernel modules on architectures other than amd64).
Mapping ELF object files (such as amd64 kernel modules) into memory directly is a bit of a grey area. ELF object files are intended to be used as inputs to the static linker. As a result, there is not a standardized definition for what the memory layout of an ELF object should be (none of the section headers have valid virtual memory addresses for example).
The kernel and loader were not checking the SHF_ALLOC flag but loading any program sections with certain types such as SHT_PROGBITS. As a result, the kernel and loader would load into RAM some sections that weren't marked with SHF_ALLOC such as .comment that are not loaded into RAM for kernel modules on other architectures (which are implemented as ELF shared objects). Aside from possibly requiring slightly more RAM to hold a kernel module this does not affect runtime correctness as the kernel relocates symbols based on the layout it uses.
Debuggers such as gdb and lldb do not extract symbol tables from a running process or kernel. Instead, they replicate the memory layout of ELF executables and shared objects and use that to construct their own symbol tables. For executables and shared objects this works fine. For ELF objects the current logic in kgdb (and probably lldb based on a simple reading) assumes that only sections with SHF_ALLOC are memory resident when constructing a memory layout. If the debugger constructs a different memory layout than the kernel, then it will compute different addresses for symbols causing symbols in the debugger to appear to have the wrong values (though the kernel itself is working fine). The current port of mdb does not check SHF_ALLOC as it replicates the kernel's logic in its existing kernel support.
The bfd linker sorts the sections in ELF object files such that all of the allocated sections (sections with SHF_ALLOCATED) are placed first followed by unallocated sections. As a result, when kgdb composed a memory layout using only the allocated sections, this layout happened to match the layout used by the kernel and loader. The lld linker does not sort the sections in ELF object files and mixed allocated and unallocated sections. This resulted in kgdb composing a different memory layout than the kernel and loader.
We could either patch kgdb (and possibly in the future lldb) to use custom handling when generating memory layouts for kernel modules that are ELF objects, or we could change the kernel and loader to check SHF_ALLOCATED. I chose the latter as I feel we shouldn't be loading things into RAM that the module won't use. This should mostly be a NOP when linking with bfd but will allow the existing kgdb to work with amd64 kernel modules linked with lld.
Note that we only require SHF_ALLOC for "program" sections for types like SHT_PROGBITS and SHT_NOBITS. Other section types such as symbol tables, string tables, and relocations must also be loaded and are not marked with SHF_ALLOC.
Reported by: np Reviewed by: kib, emaste MFC after: 1 month Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D13926
show more ...
|
#
f38658e1 |
| 05-Dec-2017 |
Warner Losh <imp@FreeBSD.org> |
Prefer stdint.h to inttypes.h since the added prototypes form the latter aren't used. Prefer sys/link_elf.h to link.h so we're only dependent on the kernel tree. The default installation of link.h ju
Prefer stdint.h to inttypes.h since the added prototypes form the latter aren't used. Prefer sys/link_elf.h to link.h so we're only dependent on the kernel tree. The default installation of link.h just includes this file, and any benefit from that is outweighed by the hassle it causes. This reduces the footprint of files needed from the system includes (or sysroot in buildworld).
Sponsored by: Netflix
show more ...
|
#
55b1c6e7 |
| 15-Nov-2017 |
Hans Petter Selasky <hselasky@FreeBSD.org> |
Merge ^/head r325663 through r325841.
|
#
ca987d46 |
| 15-Nov-2017 |
Warner Losh <imp@FreeBSD.org> |
Move sys/boot to stand. Fix all references to new location
Sponsored by: Netflix
|