summaryrefslogtreecommitdiff
path: root/etc/rc
AgeCommit message (Collapse)Author
2017-11-09kill trailing whitespace introduced in previous commitTheo Buehler
2017-11-06Use a variable for /usr/share/relinkRobert Peichaer
OK tb@
2017-11-05Consolidate lib.so.*.a, ld.so.a and the kernel relink kit intoRobert Peichaer
one location under /usr/share/relink. Be more specific in src/etc/rc reorder_libs() what filesystems need r/w remount and ensure that their mount state is restored. Idea and positive feedback from deraadt@ OK aja@ tb@
2017-10-25Partially revert rev 1.457 of /etc/rc. The pipe introduced inAlexander Bluhm
sysctl_conf() spawns a subshell. This prevents that the new process limits affect the daemons started during boot. OK rpe@ halex@
2017-10-12The testprogram for ld.so reordering is executed in tmpdir.Robert Peichaer
Move tmpdir for reordering library from /tmp to /usr/lib. This allows to have /tmp mounted noexec. prompted by reports on misc@ OK deraadt@ tj@ tb@
2017-10-10Move comment line and spacing.Robert Peichaer
2017-08-29Based on previous work from deraadt, add relinking of ld.so toRobert Peichaer
reorder_libs() resulting in a unique ld.so on every system start. Idea from and OK deraadt@ OK tb@
2017-08-28Display that we are running the upgrade scripts when they exist. On slowishAntoine Jacoutot
machines, running sysmerge(8) can take a little while so don't let people wonder about why the output seems stuck. ok sthen@ tb@ rpe@
2017-08-21Move the kernel relinking code from /etc/rc into a seperate scriptRobert Peichaer
/usr/libexec/reorder_kernel. Requested by ajacoutot@ to be able to relink the kernel from within syspatch(8). OK deraadt@ tb@
2017-08-20Simplify the code for stopping daemons listed in pkg_scripts inRobert Peichaer
reverse order on shutdown. OK aja@ tb@
2017-07-18Use a bit better idiom to get most recent version of the libraryVadim Zhukov
being reordered. okay tb@ deraadt@
2017-07-18Use numerical sysctl output to check for nfs mounts.Robert Peichaer
OK tb@
2017-07-17Tweak previous.Robert Peichaer
2017-07-17Use a more compact way to compose the initial pf ruleset.Robert Peichaer
Diff from Klemens Nanni OK tb@ zhuk@
2017-07-17Now that choosing the library versions is much faster, we can doTheo Buehler
it after remounting the filesystem containing /usr/lib as rw: the former is pointless if the latter should happen to fail. From Klemens Nanni ok rpe
2017-07-17Optimize and simplify the selection of the latest library version inTheo Buehler
reorder_libs(). From Klemens Nanni with input from rpe. ok rpe, zhuk
2017-07-04Switch reorder_kernel() from sending emails to logging via syslogRobert Peichaer
and to write the logfile inside the kernel compile dir. - turn the whole reorder_kernel function into a subshell {} -> () - create kernel compile dir early on - redirect all stdout/stderr to a logfile inside this dir - setup ERR trap handler that - disables the EXIT trap handler - syslogs the error and hints to the logfile - additionally sends this message to the console - setup EXIT trap handler that syslogs success - wipe only the content instead of the whole kernel compile dir - reestablish stdout redirection to the log after the wipe - remove -q option of sha256 to log check result - run reorder_kernel() in the background OK deraadt@ tb@
2017-06-30Improve reorder_kernel()Robert Peichaer
- check for and exit if /usr/share is on a nfs mounted filesystem - add trap handlers that mail the logfile to the admin user - use $_compile instead of $_compile_dir like in the installer - use $_compile/$_kernel instead of $_kernel_dir - remove the now redundant sha256 -h ... after make newinstall - write stdout/stderr of the background subshell to a logfile OK tb@ deraadt@
2017-06-27remove some old cruft.Ted Unangst
2017-06-22Adjust relink procedure to use new targets. Better use semantics forTheo de Raadt
users and developers. diff from rpe, ok tb
2017-06-19As early as possible, create a link /bsd.booted to the /bsd kernel weTheo de Raadt
presume we booted from. If you boot from another kernel, we cannot help you later with hibernate, sorry -- The kernel does not get a useable filename from the bootblocks. In the bootblocks, detect a live hibernate signature and boot from /bsd.booted instead. with yasuoka, lots of discussion with mlarkin, ok tom
2017-06-14Add a new function reorder_kernel() that relinks and installs theRobert Peichaer
new kernel in the background on system startup. It stores the hash of the new kernel and sends a notification email to the admin or root user. If it finds /usr/share/compile.tgz, it removes the existing compile dir and replaces it with the content of (new) archive. If the hash of /bsd does not match the stored one, no relinking happens. Idea from, joint work with and OK deraadt@ OK tb@ halex@ unnoticed by many
2017-06-06start slaacd as early as possible, right after pf and sysctl.conf areFlorian Obser
setup. Input & OK deraadt@
2017-06-03We have been running a small awk program before installing the relinked libc.Theo de Raadt
Perform the same kind of test for relinked libcrypto, using an openssl sequence (proposed by sthen)
2017-06-03Immediately after mounting / read-write, chmod og-rwx the kernel. RemoteTheo de Raadt
prying eyes were already been hindered at determining kernel addresses, now local prying eyes are also hindered. ok tb rpe
2017-05-30Introduce a scary rc.conf(8) knob library_aslr=(YES|NO) to turn off theTheo Buehler
reordering of libraries by rc(8). This way machines with very slow disk I/O have a chance of booting within reasonable time now that libcrypto is also randomized. Discussed with various; input & ok from deraadt ajacoutot
2017-05-29rc.d(8) for slaacdFlorian Obser
OK phessler, deraadt
2017-05-29Randomize link-order of libcrypto as we do with libc. This libraryTheo de Raadt
has many small functions without significant local storage, therefore less tail protection from -fstack-protector-strong to prevent their use as ROP gadgets. It is used in security contexts. Also many functions dribble pointers onto the stack, allowing discovery of gadgets via the fixed relative addresses, so let's randomly bias those. ok tedu jsing The rc script will soon need a strategy for skipping this step on machines with poor IO performance. Or maybe do it less often? However, I don't see many more libraries we'll do this with, these are the two most important ones.
2017-05-01Comments and spacing.Robert Peichaer
2017-04-18Simplify patching of motd(5), also making it agree better with theIngo Schwarze
documentation if the first line of the file is blank. Quirk reported by Anthony Coulter <bsd at anthonycoulter dot name>. OK rpe@
2017-02-26Switch to xenodm(1).Matthieu Herrb
Do it now deraadt@
2016-12-27Remove user uucp and group news from base.Jeremie Courreges-Anglas
2016-11-04spacingRobert Peichaer
2016-10-07first set -max limit, then -cur, otherwise if -cur si higher than the currentOtto Moerbeek
max, it won't be set. noted by Evgeny Grin; ok millert@
2016-10-06Add switchdReyk Floeter
OK deraadt@
2016-10-06Move vmd down as VMs might need the host's dhcpd, httpd etc. on startup.Reyk Floeter
OK mlarkin@ deraadt@
2016-09-27Run acpidump(8) at system startup and store ACPI tables in theRobert Peichaer
/var/db/acpi directory. Later sendbug(1) will use this data in bug reports. That directory is created by mtree. idea from and OK deraadt OK kettenis
2016-07-10Fix detection of /usr/lib on NFS.Robert Peichaer
Found by Frank Scheiner, thanks for reporting this. OK krw, halex 'cool' deraadt
2016-05-29Improve error handling in reorder_libs()Robert Peichaer
- run commands in subshell only if mktemp is successful - on error just leave the for-loop but set _error=true - cleanup tmpdirs afterwards - set _error=true if the ro remount fails - print appropriate final message depending on $_error positive feedback from deraadt OK krw
2016-05-27No need to show the messages if we skip in case of /usr/lib on nfs.Robert Peichaer
OK deraadt
2016-05-27Add function comments.Robert Peichaer
OK sthen, deraadt
2016-05-26whitespace found during reviewTheo de Raadt
2016-05-26- rename rebuildlibs() to reorder_libs()Robert Peichaer
- move the info message inside the function - skip reordering if /usr/lib is on a nfs mounted filesystem - temporarily remount rw if /usr/lib is on a ro ffs file-system OK deraadt
2016-05-22Use the -F flag of install(1) to ensure the file's content is flushed to disk.Robert Peichaer
OK deraadt
2016-05-14unhphenate the world: re-order -> reorderJason McIntyre
sthen does not object
2016-05-05show what we're doing when reordering libraries, otherwise the textStuart Henderson
above it is "starting network", which can make you think something is broken when your machine is as slow as some of mine. "Yeah, that's a pretty crappy machine" deraadt@
2016-04-27We want to run sysmerge(8) a bit earlier in the boot process so that it has aAntoine Jacoutot
chance to update the *default* configuration of the important daemons. Factorize rc.firsttime into a run_upgrade_script() function which takes the script suffix name as an argument. i.e. run_upgrade_script sysmerge / run_upgrade_script firsttime discussed with deraadt@ ok deraadt@ rpe@
2016-04-27Use 'sort -V' which is actually meant to sort version numbers.Robert Peichaer
Noted by zhuk@ OK deraadt@
2016-04-26Re-link (only the newest) libc.so, placing the objects in a randomTheo de Raadt
order. with shell script assistance from rpe
2015-12-29Replace single pattern case-blocks with simpler code.Robert Peichaer
OK halex@