proccontrol(1): Add wxmap control(cherry picked from commit ac8af1938085dae0df32db3229c9d5cb659b90a4)
Style(cherry picked from commit 1349891a0eed79625faafa5ad354d65ff9ea6012)
proccontrol(1): implement 'nonewprivs'(cherry picked from commit acb1f1269c6f4ff89a0d28ba742f6687e9ef779d)
Do a sweep and remove most WARNS=6 settingsRepeating the default WARNS here makes it slightly more difficult toexperiment with default WARNS changes, e.g. if we did something absolutelybananas an
Do a sweep and remove most WARNS=6 settingsRepeating the default WARNS here makes it slightly more difficult toexperiment with default WARNS changes, e.g. if we did something absolutelybananas and introduced a WARNS=7 and wanted to try lifting the default tothat.Drop most of them; there is one in the blake2 kernel module, but I suspectit should be dropped -- the default WARNS in the rest of the build doesn'tcurrently apply to kernel modules, and I haven't put too much thought intowhether it makes sense to make it so.
show more ...
procctl(8): usermode bits to force LA58/LA57 on exec.Sponsored by: The FreeBSD FoundationDifferential revision: https://reviews.freebsd.org/D25273
Add stackgap control mode to proccontrol(1).PR: 239894Reviewed by: alcSponsored by: The FreeBSD FoundationMFC after: 1 weekDifferential revision: https://reviews.freebsd.org/D21352
Add implicit PROT_MAX() knob to proccontrol(1).Reviewed by: emaste, markj (previous version)Discussed with: brooksSponsored by: The FreeBSD FoundationDifferential revision: https://reviews.freeb
Add implicit PROT_MAX() knob to proccontrol(1).Reviewed by: emaste, markj (previous version)Discussed with: brooksSponsored by: The FreeBSD FoundationDifferential revision: https://reviews.freebsd.org/D20795
Mention proccontrol(1) -m kpti.Sponsored by: The FreeBSD FoundationMFC after: 3 days
proccontrol(1): Add kpti control mode.Requested by: jhbReviewed by: jhb, markj (previous version)Tested by: phoSponsored by: The FreeBSD FoundationMFC after: 1 weekDifferential revision: https
proccontrol(1): Add kpti control mode.Requested by: jhbReviewed by: jhb, markj (previous version)Tested by: phoSponsored by: The FreeBSD FoundationMFC after: 1 weekDifferential revision: https://reviews.freebsd.org/D19514
Some fixes for proccontrol(1) man page.- Fix markup.- Mention that process can only allow tracing for itself. This is already stated in procctl(2), but requiring knowledge of the syscall descri
Some fixes for proccontrol(1) man page.- Fix markup.- Mention that process can only allow tracing for itself. This is already stated in procctl(2), but requiring knowledge of the syscall description is too much for the tool user.- Clearly state that query mode only works for existing process.Noted and reviewed by: phoSponsored by: The FreeBSD FoundationMFC after: 3 days
proccontrol(1) man page.Reviewed by: 0mpSponsored by: The FreeBSD FoundationDifferential revision: https://reviews.freebsd.org/D19308
Implement Address Space Layout Randomization (ASLR)With this change, randomization can be enabled for all non-fixedmappings. It means that the base address for the mapping is selectedwith a guar
Implement Address Space Layout Randomization (ASLR)With this change, randomization can be enabled for all non-fixedmappings. It means that the base address for the mapping is selectedwith a guaranteed amount of entropy (bits). If the mapping wasrequested to be superpage aligned, the randomization honours thesuperpage attributes.Although the value of ASLR is diminshing over time as exploit authorswork out simple ASLR bypass techniques, it elimintates the trivialexploitation of certain vulnerabilities, at least in theory. Thisimplementation is relatively small and happens at the correctarchitectural level. Also, it is not expected to introduceregressions in existing cases when turned off (default for now), orcause any significant maintaince burden.The randomization is done on a best-effort basis - that is, theallocator falls back to a first fit strategy if fragmentation preventsentropy injection. It is trivial to implement a strong mode wherefailure to guarantee the requested amount of entropy results inmapping request failure, but I do not consider that to be usable.I have not fine-tuned the amount of entropy injected right now. It isonly a quantitive change that will not change the implementation. Thecurrent amount is controlled by aslr_pages_rnd.To not spoil coalescing optimizations, to reduce the page tablefragmentation inherent to ASLR, and to keep the transient superpagepromotion for the malloced memory, locality clustering is implementedfor anonymous private mappings, which are automatically grouped untilfragmentation kicks in. The initial location for the anon group rangeis, of course, randomized. This is controlled by vm.cluster_anon,enabled by default.The default mode keeps the sbrk area unpopulated by other mappings,but this can be turned off, which gives much more breathing bits onarchitectures with small address space, such as i386. This is tiedwith the question of following an application's hint about the mmap(2)base address. Testing shows that ignoring the hint does not affect thefunction of common applications, but I would expect more demandingcode could break. By default sbrk is preserved and mmap hints aresatisfied, which can be changed by using thekern.elf{32,64}.aslr.honor_sbrk sysctl.ASLR is enabled on per-ABI basis, and currently it is only allowed onFreeBSD native i386 and amd64 (including compat 32bit) ABIs. Supportfor additional architectures will be added after further testing.Both per-process and per-image controls are implemented:- procctl(2) adds PROC_ASLR_CTL/PROC_ASLR_STATUS;- NT_FREEBSD_FCTL_ASLR_DISABLE feature control note bit makes it possible to force ASLR off for the given binary. (A tool to edit the feature control note is in development.)Global controls are:- kern.elf{32,64}.aslr.enable - for non-fixed mappings done by mmap(2);- kern.elf{32,64}.aslr.pie_enable - for PIE image activation mappings;- kern.elf{32,64}.aslr.honor_sbrk - allow to use sbrk area for mmap(2);- vm.cluster_anon - enables anon mapping clustering.PR: 208580 (exp runs)Exp-runs done by: antoineReviewed by: markj (previous version)Discussed with: emasteTested by: phoMFC after: 1 monthSponsored by: The FreeBSD FoundationDifferential revision: https://reviews.freebsd.org/D5603
DIRDEPS_BUILD: Update dependencies.Sponsored by: Dell EMC Isilon
Use MAN=<empty> rather than MK_MAN=no to not install a manpage.MFC after: 1 week
DIRDEPS_BUILD: Connect new directories.Sponsored by: Dell EMC Isilon
Provide proccontrol(1), an utility to control processes behaviour, relatedto procctl(2).Sponsored by: The FreeBSD FoundationMFC after: 1 week