Split per-connection sshd-session binary
authordjm <djm@openbsd.org>
Mon, 14 Oct 2024 01:57:50 +0000 (01:57 +0000)
committerdjm <djm@openbsd.org>
Mon, 14 Oct 2024 01:57:50 +0000 (01:57 +0000)
commit856b6ee8138aeb0dd7b43225127970b1429d05d7
tree74a46e45868d561d125867c703f473edf0a3e73a
parentf007d8ce71cdc685ff510ba6c693f85edd2c2818
Split per-connection sshd-session binary

This splits the user authentication code from the sshd-session
binary into a separate sshd-auth binary. This will be executed by
sshd-session to complete the user authentication phase of the
protocol only.

Splitting this code into a separate binary ensures that the crucial
pre-authentication attack surface has an entirely disjoint address
space from the code used for the rest of the connection. It also
yields a small runtime memory saving as the authentication code will
be unloaded after thhe authentication phase completes.

Joint work with markus@ feedback deraadt@

Tested in snaps since last week
19 files changed:
usr.bin/ssh/Makefile
usr.bin/ssh/Makefile.inc
usr.bin/ssh/log.c
usr.bin/ssh/monitor.c
usr.bin/ssh/monitor.h
usr.bin/ssh/monitor_wrap.c
usr.bin/ssh/monitor_wrap.h
usr.bin/ssh/pathnames.h
usr.bin/ssh/sandbox-pledge.c
usr.bin/ssh/sandbox-rlimit.c
usr.bin/ssh/servconf.c
usr.bin/ssh/servconf.h
usr.bin/ssh/session.c
usr.bin/ssh/ssh-sandbox.h
usr.bin/ssh/sshd-auth.c [new file with mode: 0644]
usr.bin/ssh/sshd-auth/Makefile [new file with mode: 0644]
usr.bin/ssh/sshd-session.c
usr.bin/ssh/sshd-session/Makefile
usr.bin/ssh/sshd.c