Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Bug 218679 #110

Closed
wants to merge 2 commits into from
Closed

Implement Bug 218679 #110

wants to merge 2 commits into from

Conversation

fhriley
Copy link

@fhriley fhriley commented Apr 15, 2017

Add a 'verify' command to geli. This allows a user to verify a
key and/or passphrase without having to call commands that will
modify the system (such as attach or setkey).

Update geli man page to add new command.

Add a 'verify' command to geli. This allows a user to verify a
key and/or passphrase without having to call commands that will
modify the system (such as attach or setkey).

Update geli man page to add new command.
@cemeyer
Copy link
Member

cemeyer commented Apr 28, 2017

+cc @allanjude

@bsdimp
Copy link
Member

bsdimp commented Apr 28, 2017

This looks good to my eye, but I'd feel better about merging it if it were reviewed by someone on the security team.

if (eli_metadata_read(req, prov, &md) == -1)
return;

if (md.md_keys == 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is mostly a copy of eli_setkey_detached. Could you please extract the common portion out instead?

opntr added a commit to opntr/opBSD that referenced this pull request Jun 22, 2017
This commit fixes the (theoretically) last outstanding memory
protection related weakness in HBSD's user-space detectable
with paxtest.

The paxtest before this patch:

 PaXtest
 Copyright(c) 2003-2014 by Peter Busser <peter@adamantix.org> and Brad Spengler <spender@grsecurity.net>
 Copyright(c) 2015 by Oliver Pinter <op@hardenedbsd.org>
 Released under the GNU Public Licence version 2 or later

 Mode: kiddie
 Uname: FreeBSD pandora-d 10.3-STABLE-HBSD FreeBSD 10.3-STABLE-HBSD freebsd#70 174459c(opbsd/10-stable/master): Sat Sep  3 15:15:03 CEST 2016     root@pandora-d:/usr/obj/usr/src/sys/OP-HBSD  amd64
 Compiler: FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512

 Executable anonymous mapping             : Killed
 Executable bss                           : Killed
 Executable data                          : Killed
 Executable heap                          : Killed
 Executable stack                         : Killed
 Executable shared library bss            : Killed
 Executable shared library data           : Killed
 Executable anonymous mapping (mprotect)  : Killed
 Executable bss (mprotect)                : Killed
 Executable data (mprotect)               : Killed
 Executable heap (mprotect)               : Killed
 Executable stack (mprotect)              : Killed
 Executable shared library bss (mprotect) : Killed
 Executable shared library data (mprotect): Killed
 Writable text segments                   : Vulnerable
 Anonymous mapping randomization test     : 30 quality bits (guessed)
 Heap randomization test (ET_EXEC)        : 26 quality bits (guessed)
 Heap randomization test (PIE)            : 27 quality bits (guessed)
 Main executable randomization (ET_EXEC)  : No randomization
 Main executable randomization (PIE)      : 30 quality bits (guessed)
 Shared library randomization test        : 30 quality bits (guessed)
 VDSO randomization test                  : 28 quality bits (guessed)
 Stack randomization test (SEGMEXEC)      : 41 quality bits (guessed)
 Stack randomization test (PAGEEXEC)      : 41 quality bits (guessed)
 Arg/env randomization test (SEGMEXEC)    : 42 quality bits (guessed)
 Arg/env randomization test (PAGEEXEC)    : 42 quality bits (guessed)
 Randomization under memory exhaustion @~0: 30 bits (guessed)
 Randomization under memory exhaustion @0 : 30 bits (guessed)
 Return to function (strcpy)              : paxtest: return address contains a NULL byte.
 Return to function (memcpy)              : Vulnerable
 Return to function (strcpy, PIE)         : paxtest: return address contains a NULL byte.
 Return to function (memcpy, PIE)         : Vulnerable

After this patch:

 PaXtest
 Copyright(c) 2003-2014 by Peter Busser <peter@adamantix.org> and Brad Spengler <spender@grsecurity.net>
 Copyright(c) 2015 by Oliver Pinter <op@hardenedbsd.org>
 Released under the GNU Public Licence version 2 or later

 Mode: kiddie
 Uname: FreeBSD pandora-d 10.3-STABLE-HBSD FreeBSD 10.3-STABLE-HBSD freebsd#110 f50bef31246(opbsd/10-stable/master): Sat Feb 18 22:35:11 CET 2017     root@pandora-d:/usr/obj/usr/src/sys/OP-HBSD  amd64
 Compiler: FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512

 Executable anonymous mapping             : Killed
 Executable bss                           : Killed
 Executable data                          : Killed
 Executable heap                          : Killed
 Executable stack                         : Killed
 Executable shared library bss            : Killed
 Executable shared library data           : Killed
 Executable anonymous mapping (mprotect)  : Killed
 Executable bss (mprotect)                : Killed
 Executable data (mprotect)               : Killed
 Executable heap (mprotect)               : Killed
 Executable stack (mprotect)              : Killed
 Executable shared library bss (mprotect) : Killed
 Executable shared library data (mprotect): Killed
 Writable text segments                   : Killed
 Anonymous mapping randomization test     : 30 quality bits (guessed)
 Heap randomization test (ET_EXEC)        : 26 quality bits (guessed)
 Heap randomization test (PIE)            : 27 quality bits (guessed)
 Main executable randomization (ET_EXEC)  : No randomization
 Main executable randomization (PIE)      : 30 quality bits (guessed)
 Shared library randomization test        : 30 quality bits (guessed)
 VDSO randomization test                  : 28 quality bits (guessed)
 Stack randomization test (SEGMEXEC)      : 41 quality bits (guessed)
 Stack randomization test (PAGEEXEC)      : 41 quality bits (guessed)
 Arg/env randomization test (SEGMEXEC)    : 42 quality bits (guessed)
 Arg/env randomization test (PAGEEXEC)    : 42 quality bits (guessed)
 Randomization under memory exhaustion @~0: 30 bits (guessed)
 Randomization under memory exhaustion @0 : 30 bits (guessed)
 Return to function (strcpy)              : paxtest: return address contains a NULL byte.
 Return to function (memcpy)              : Vulnerable
 Return to function (strcpy, PIE)         : paxtest: return address contains a NULL byte.
 Return to function (memcpy, PIE)         : Vulnerable

github-issue: freebsd#37
Obtained-from: opBSD 10-STABLE
Sponsored-by: not sponsored
Signed-off-by: Oliver Pinter <oliver.pinter@hardenedbsd.org>
@oshogbo
Copy link
Contributor

oshogbo commented Jul 2, 2018

We have right now a 'dry-run' option in the attach method.

@fhriley fhriley closed this Jul 20, 2019
@fhriley fhriley deleted the user/friley/geli_verify branch July 20, 2019 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants