mpi [Tue, 6 May 2014 11:50:13 +0000 (11:50 +0000)]
Include <sys/vmmeter.h> directly instead of relying on it being
pulled by <uvm/uvm_extern.h> and turn uvm_total() into a private
function.
The preferred way to get memory stats is through the VM_UVMEXP
sysctl(3) since VM_METER is just a wrapper on top of it. In the
kernel, use `uvmexp' directly instead of uvm_total().
This change does not remove <sys/vmmeter.h> from <uvm/uvm_extern.h>
to give some more time to port maintainers to fix their ports.
ok guenther@ as part of a larger diff.
reyk [Tue, 6 May 2014 11:11:14 +0000 (11:11 +0000)]
Explicitly zero out the ibufs before releasing the memory to make sure
that included crypto parameters are cleaned.
ok mikeb@ markus@
reyk [Tue, 6 May 2014 11:03:02 +0000 (11:03 +0000)]
Fix two memory leaks: EVP_PKEY_get1_RSA() returns a referenced key
that requires to call RSA_free() to dereference it after use. Also
free a temporary key that was read by PEM_read_PrivateKey() and
immediately written into a bio.
ok markus@
markus [Tue, 6 May 2014 10:24:22 +0000 (10:24 +0000)]
initiate ike sa rekeying (ikesalifetime keyword), re-queue pfkey
events while we are busy initiating child-SAs; ok mikeb@
gerhard [Tue, 6 May 2014 09:49:58 +0000 (09:49 +0000)]
Fix a memleak when lookup of SA fails during forwarding of encrypted IPv6
pakets.
ok mpi@ markus@ mikeb@
markus [Tue, 6 May 2014 09:48:40 +0000 (09:48 +0000)]
cleanup IKE-SA tree handling (fixes repeated-insert & double-remove)
sa_new() always re-inserts an SA into the SA tree. in case of a key
collision it would try to free the new SA. While doing that it would
accidentially free the existing SA, since config_free_sa() does
RB_REMOVE() uncoditionally. This change fixes this by:
a) moving the responsibility for RB_REMOVE() to CALLER of config_free_sa() and
b) by calling config_free_sa() instead of sa_free() from sa_new()
It also changes to code to NEVER re-add an SA to the tree. So
RB_INSERT() is ONLY called once per SA. The code also makes sure
that there is always a KEY defined for this tree (ispi).
ok mikeb@
mpi [Tue, 6 May 2014 09:44:31 +0000 (09:44 +0000)]
Plug two xfer leaks and a buffer one.
markus [Tue, 6 May 2014 09:21:50 +0000 (09:21 +0000)]
don't sa_free() in the receive path (prevents use-after-free); ok mikeb@
markus [Tue, 6 May 2014 08:17:58 +0000 (08:17 +0000)]
send the delete with the locally allocated SPI in ikev2_init_create_child_sa()
markus [Tue, 6 May 2014 07:45:17 +0000 (07:45 +0000)]
make sure some notify payloads are encrypted; ok mikeb@
markus [Tue, 6 May 2014 07:24:37 +0000 (07:24 +0000)]
initial support for PFS; ok reyk@
markus [Tue, 6 May 2014 07:08:10 +0000 (07:08 +0000)]
retire IKED_REQ_DELETE and fix delete parsing; ok reyk@
jsg [Tue, 6 May 2014 06:40:03 +0000 (06:40 +0000)]
no need to include rand.h now the RAND_seed() calls are gone.
ok reyk@
tedu [Tue, 6 May 2014 03:56:27 +0000 (03:56 +0000)]
knf approximation
tedu [Tue, 6 May 2014 02:31:45 +0000 (02:31 +0000)]
move chacha context and buffer out of bss and allow mmap to place them
wherever it decides it would like them. first step. ok deraadt dlg djm
tedu [Tue, 6 May 2014 02:05:38 +0000 (02:05 +0000)]
"stay backwards-compatible with 0.9.5; this should go away soon"
it's your lucky day!
tedu [Tue, 6 May 2014 01:54:42 +0000 (01:54 +0000)]
remove Kerberos
tedu [Tue, 6 May 2014 01:53:53 +0000 (01:53 +0000)]
move a comment to make unifdef happier
tedu [Tue, 6 May 2014 01:52:07 +0000 (01:52 +0000)]
bye bye SRP
mpi [Mon, 5 May 2014 21:25:00 +0000 (21:25 +0000)]
Plug a memory leak, free the keymap's memory on detach.
ok miod@
markus [Mon, 5 May 2014 18:56:42 +0000 (18:56 +0000)]
ca_x509_serialize: don't leak the bio buffer; ok reyk@
markus [Mon, 5 May 2014 18:54:17 +0000 (18:54 +0000)]
make the ca_pubkey_serialize() code similar to the private key code, and
fixes a leak of the rsa object in the error case. from hshoexer@; ok reyk@
markus [Mon, 5 May 2014 18:50:36 +0000 (18:50 +0000)]
pfkey is unreliable, so add a select-timeout before MSG_PEEK;
similar code is in isakmpd; ok reyk@
tedu [Mon, 5 May 2014 18:38:42 +0000 (18:38 +0000)]
inspired by a cloudflare diff, cleanse old memory when expanding a bignum.
however, instead of trying to audit all the places where a secret bignum
is used, apply the big hammer and clear all bignums when freed.
ok deraadt miod
pelikan [Mon, 5 May 2014 18:30:44 +0000 (18:30 +0000)]
Don't call the BOOTP handler indirectly.
ok krw
pelikan [Mon, 5 May 2014 18:27:57 +0000 (18:27 +0000)]
Don't call the ICMP handler indirectly + clean up a bit.
ok krw
krw [Mon, 5 May 2014 18:02:49 +0000 (18:02 +0000)]
Zap trailing whitespace. Started by pointed comments from andre@.
miod [Mon, 5 May 2014 17:18:08 +0000 (17:18 +0000)]
Ugly workaround for an overoptimistic alignment expectation of dos_partition
fields, found the hard way on landisk, to allow the tree to build until a
proper fix is devised.
ok deraadt@
krw [Mon, 5 May 2014 16:33:34 +0000 (16:33 +0000)]
Enhance reading of saved ascii labels (-R) to process mountpoint
information if present. Can be used with -F/-f options to create
an fstab from the saved label.
ok otto@
espie [Mon, 5 May 2014 16:29:32 +0000 (16:29 +0000)]
work-around the same location being reinstalled thru a different path
later... no need to do anything on sets consisting purely of "kept" handles
This is not fully satisfying, I expect I need to tie some "done already" to
locations as we do with sets, so that we can wipe update_info properly and
be done once and for all...
Issue found by stsp@ while trying to use FETCH_PACKAGES, which is still not
100% in good shape with this.
jsing [Mon, 5 May 2014 16:19:23 +0000 (16:19 +0000)]
Sort and group includes.
jsing [Mon, 5 May 2014 16:16:37 +0000 (16:16 +0000)]
Repair BIO_socket_nbio operation.
ok miod@
jsing [Mon, 5 May 2014 16:14:45 +0000 (16:14 +0000)]
During the great e_os.h nukathon we stopped pulling in <sys/filio.h> via
the ifdef maze, meaning that FIONBIO was no longer defined. This removes
non-blocking I/O support from s_{client,server,time}.
Remove all FIONBIO ifdefs and import <sys/ioctl.h>, renabling -nbio.
ok miod@
markus [Mon, 5 May 2014 16:14:37 +0000 (16:14 +0000)]
the caller of ikev2_msg_retransmit_response already frees the sa; ok mikeb
markus [Mon, 5 May 2014 16:13:12 +0000 (16:13 +0000)]
don't leak on pid mismatch; ok mikeb
jsing [Mon, 5 May 2014 16:08:15 +0000 (16:08 +0000)]
Kill memory debug calls that are now noops. While here, nuke an #if 0 and
a unnecessary NULL check before free.
ok miod@
jsing [Mon, 5 May 2014 16:06:55 +0000 (16:06 +0000)]
OpenBSD has_SC_CLK_TCK.
ok miod@
markus [Mon, 5 May 2014 15:21:20 +0000 (15:21 +0000)]
validate the attribute length, too; from hshoexer; ok mikeb
tedu [Mon, 5 May 2014 15:08:37 +0000 (15:08 +0000)]
convert select to poll. from peter malone
krw [Mon, 5 May 2014 15:04:05 +0000 (15:04 +0000)]
"new file systemsize is" -> "new filesystem size is".
From David Vasek.
tedu [Mon, 5 May 2014 15:03:22 +0000 (15:03 +0000)]
Remove SRP and Kerberos support from libssl. These are complex protocols
all on their own and we can't effectively maintain them without using them,
which we don't. If the need arises, the code can be resurrected.
krw [Mon, 5 May 2014 14:44:18 +0000 (14:44 +0000)]
A couple of malloc()+memset(0) -> calloc.
mpi [Mon, 5 May 2014 13:48:11 +0000 (13:48 +0000)]
Plug a memory leak related to HID descriptor parsing.
ok jsg@
krw [Mon, 5 May 2014 13:32:15 +0000 (13:32 +0000)]
Tweak comment on struct _partitionv0. It's no longer the partition
table.
Suggested by David Vasek.
andre [Mon, 5 May 2014 12:31:56 +0000 (12:31 +0000)]
Replacing test files from previous commit to the right directory. There is no
trigger to run tests from relayd directory, so previous had no practical
effect.
mpi [Mon, 5 May 2014 11:44:33 +0000 (11:44 +0000)]
Use a custom ifa_rtrequest function for point-to-point interfaces
instead of relying on hacks in nd6_rtrequest() to add a route to
loopback for each address configured on such interfaces.
While here document that abusing lo0 for local traffic is not safe
for interfaces in a non-default rdomain.
Tested by claudio@, jca@ and sthen@, ok sthen@
andre [Mon, 5 May 2014 11:02:29 +0000 (11:02 +0000)]
Add two more regression tests to relayd, these cover "digest" and "file"
keywords.
ok reyk
henning [Mon, 5 May 2014 10:00:45 +0000 (10:00 +0000)]
remove dead code: calling ether_attach which sets if_type to IFT_ETHER,
just to set it to IFT_L2VLAN right afterwards, just to set if_type
to the parent's if_type which can be anything as long as it is IFT_ETHER
at config time doesn't make any sense and has zero effect. stop fiddling
with if_type alltogether.
also remove a question in a comment that has been answered by the last 14
years.
from Marrakesh airport, ok reyk
blambert [Mon, 5 May 2014 08:23:57 +0000 (08:23 +0000)]
change surprisingly consistent mispelling of length ("lenght")
no change in md5 of resulting object file
ok markus@, reyk@
logan [Mon, 5 May 2014 07:02:30 +0000 (07:02 +0000)]
Zap extra whitespace.
OK from djm@ and dtucker@
yasuoka [Mon, 5 May 2014 04:58:23 +0000 (04:58 +0000)]
Delete duplicated "mppe" entry in keywords[].
miod [Mon, 5 May 2014 04:44:54 +0000 (04:44 +0000)]
Enable assembler code for DES. Assembler code for BN is commented out as it
uses the `umul' and `udiv' instructions directly, which are not supported
on v7 processors.
bluhm [Mon, 5 May 2014 00:09:16 +0000 (00:09 +0000)]
Redirecting stderr to /dev/null suppresses all errors. Instead use
the new status=none feature to make dd quiet.
OK krw@ deraadt@
jim [Sun, 4 May 2014 22:26:32 +0000 (22:26 +0000)]
Improve line wrapping for lines exceeding 80 chars.
ok jmc@
jim [Sun, 4 May 2014 22:23:15 +0000 (22:23 +0000)]
Add missing SEE ALSO section header.
yup jmc@
jim [Sun, 4 May 2014 21:46:35 +0000 (21:46 +0000)]
Remove trailing whitespace.
fine jmc@
jim [Sun, 4 May 2014 21:20:10 +0000 (21:20 +0000)]
Remove a leading whitespace.
ok jmc@
jim [Sun, 4 May 2014 21:15:12 +0000 (21:15 +0000)]
Add missing SEE ALSO section header.
ok jmc@
jim [Sun, 4 May 2014 21:13:41 +0000 (21:13 +0000)]
Improve line wrapping for lines exceeding 80 chars.
ok jmc@
jim [Sun, 4 May 2014 21:08:16 +0000 (21:08 +0000)]
Remove trailing whitespace.
ok jmc@
krw [Sun, 4 May 2014 21:07:50 +0000 (21:07 +0000)]
Factor out the code to set the expiry, renewal and rebinding times for
a lease. Will be reused in upcoming diff. No intentional behaviour
change.
deraadt [Sun, 4 May 2014 20:40:08 +0000 (20:40 +0000)]
delete useless test code
jim [Sun, 4 May 2014 20:31:33 +0000 (20:31 +0000)]
Remove trailing whitespace.
no objection jmc@
sf [Sun, 4 May 2014 20:09:15 +0000 (20:09 +0000)]
format string fixes for bus_addr_t and bus_size_t
bus_addr_t and bus_size_t are u_long everywhere
ok kettenis@
sf [Sun, 4 May 2014 19:27:08 +0000 (19:27 +0000)]
remove some hh and h format specifiers
gcc does not like hh in kprintf and it does not make any difference due
to integer promotion rules. While there, remove some h's, too.
suggested by kettenis@
tedu [Sun, 4 May 2014 19:06:40 +0000 (19:06 +0000)]
i give up. reuse problem is unfixable. dlg says puppet crashes.
sf [Sun, 4 May 2014 18:18:36 +0000 (18:18 +0000)]
format string fix for bus_space_tag_t
bus_space_tag_t is a pointer everywhere, except on i386, where it's an int.
Cast to long.
ok kettenis@
'Right idiom' deraadt@
sf [Sun, 4 May 2014 17:34:17 +0000 (17:34 +0000)]
change type of handle var to u_int16_t
This fixes a format string warning. No change to the format string is
necessary.
suggested by kettenis@
miod [Sun, 4 May 2014 17:13:05 +0000 (17:13 +0000)]
Enable the assembler code for BN, which was lost quite some time ago.
miod [Sun, 4 May 2014 17:12:19 +0000 (17:12 +0000)]
Remove the !SSLASM conditional. Either there is an arch-specific Makefile.inc,
or the !SSLASM list of files applies. This allows for an arch-specific
Makefile.inc to not specify SSLASM.
reyk [Sun, 4 May 2014 16:38:19 +0000 (16:38 +0000)]
Create a new default RSA engine instead of patching the existing one
if none is available. Fixes SSL/TLS and a possible fatalx() on
machines without a default RSA engine.
Thanks to Bjorn Ketelaars for reporting and testing.
ok gilles@ (for the relayd part)
mpi [Sun, 4 May 2014 14:42:36 +0000 (14:42 +0000)]
Make use of usbd_xfer_isread() instead of rerolling it everywhere.
This has the side effect of simplifying and reducing the differences
between the various *hci_alloc_*_chain() functions since they are the
principal place where we want to known if the transfer is a read or a
write.
mpi [Sun, 4 May 2014 14:31:50 +0000 (14:31 +0000)]
Get rid of EHCI_NULL. No functional change.
krw [Sun, 4 May 2014 13:08:39 +0000 (13:08 +0000)]
Revert previous. Insufficient discussion. Introduces
inconsistancy between configured and unconfigured interfaces.
Requested by deraadt@
kettenis [Sun, 4 May 2014 12:24:26 +0000 (12:24 +0000)]
Fix bogus error check; spotted by clang.
Submitted upstream by brad@ (and subsequently committed there).
ok jca@, mikeb@, brad@
krw [Sun, 4 May 2014 10:47:25 +0000 (10:47 +0000)]
Make answering 'none' to the installer question "IPv6 address?" result
in no IPv6 address, by appending '-inet6' to the generated hostname.<if>
file.
Less surprising to many people.
ok henning@ reyk@ beck@ rpe@
logan [Sun, 4 May 2014 10:40:59 +0000 (10:40 +0000)]
Remove the Z flag from the list of malloc options as it
was removed from malloc.c 10 days ago.
OK from miod@
reyk [Sun, 4 May 2014 10:32:32 +0000 (10:32 +0000)]
With the recent change by deraadt@ to introduce kern.nosuidcoredump=3,
we don't need the horrible debug hack anymore that disabled privdrop
and chroot to get core dumps of privsep processes. No functional
change for the normal binary, only if it is compiled with the
non-default -DDEBUG option.
jmc [Sun, 4 May 2014 07:01:10 +0000 (07:01 +0000)]
tweak previous;
guenther [Sun, 4 May 2014 05:03:26 +0000 (05:03 +0000)]
Add PS_SYSTEM, the process-level mirror of the thread-level P_SYSTEM,
and FORK_SYSTEM as a flag to set them. This eliminates needing to
peek into other processes threads in various places. Inspired by NetBSD
ok miod@ matthew@
deraadt [Sun, 4 May 2014 03:53:37 +0000 (03:53 +0000)]
When kern.nosuidcoredump=3, act like =2 but try to dump cores into
the /var/crash/programname/ directory, as root. For instance,
# mkdir /var/crash/bgpd/
# chmod 700 /var/crash/bgpd/ # If you skip this step, you are a moron
# sysctl kern.nosuidcoredump=3
# bgpd
# pkill -ABRT bgpd
# ls /var/crash/bgpd/
14764.core 23207.core 6423.core
Of course, in real life the idea is that you don't kill the daemon but it
crashes and you collect parallel cores. Careful you don't fill your /var.
Further tuneables are being considered.
Sorry to be picking on bgpd for this example. I've watched the "too
difficult to debug privsep code" angst for far too long.
ok guenther
guenther [Sat, 3 May 2014 23:30:04 +0000 (23:30 +0000)]
If P_ZOMBIE(pr->ps_mainproc) is true, then (pr->ps_flags & PS_EXITING)
is, so eliminate the check of the former and instead use the EINVAL
error for the latter. Also, consistently check for PS_EXITING
before check creds.
suggestion to split this from another diff miod@
guenther [Sat, 3 May 2014 22:49:43 +0000 (22:49 +0000)]
Fix whitespace fail in previous commit
guenther [Sat, 3 May 2014 22:44:36 +0000 (22:44 +0000)]
Move the u-area allocation and pmap-magic logic to its own function
uvm_uarea_alloc()
function name from NetBSD; arm testing by miod@
miod [Sat, 3 May 2014 20:06:13 +0000 (20:06 +0000)]
Enable assembler code for AES, DES, GCM, SHA1, SHA256 and SHA512.
The sparcv9 BN code is not enabled, as it expects to run on a 32-bit
userland and will need to be fixed for 64-bit userland first.
miod [Sat, 3 May 2014 19:38:25 +0000 (19:38 +0000)]
Enable assembler code for AES, BN (Montgomery), GCM128, SHA1, SHA256 and SHA512.
Note that GCM128 Neon code is currently not built (and thus not tested), as
the current toolchain does not support Neon instructions.
miod [Sat, 3 May 2014 19:36:47 +0000 (19:36 +0000)]
Do not compile the neon probe code until __ARM_ARCH__ >= 7. Neon-specific code
will not get referenced if this condition is not met.
miod [Sat, 3 May 2014 19:10:58 +0000 (19:10 +0000)]
typos
dtucker [Sat, 3 May 2014 18:46:14 +0000 (18:46 +0000)]
Add tests for with and without compression, with and without privsep.
miod [Sat, 3 May 2014 17:23:55 +0000 (17:23 +0000)]
Correctly enable Montgomery code.
markus [Sat, 3 May 2014 17:20:34 +0000 (17:20 +0000)]
unbreak compression, by re-init-ing the compression code in the
post-auth child. the new buffer code is more strict, and requires
buffer_init() while the old code was happy after a bzero();
originally from djm@
tedu [Sat, 3 May 2014 17:12:53 +0000 (17:12 +0000)]
now that 5.5 has been released with compatibility for 2b hashes,
switch to generating them by default. prodded by deraadt and sthen
jsing [Sat, 3 May 2014 17:00:45 +0000 (17:00 +0000)]
Update the base64 regress test and enable a test that would previously
have resulted in a segfault. Also update the resulting output bytes now
that the invalid/corrupt input is detected and rejected; unless you're
using BIO_FLAGS_BASE64_NO_NL, in which case you still get a stream of
zero value bytes and no way of knowing that the data is invalid/corrupt.
jsing [Sat, 3 May 2014 16:54:48 +0000 (16:54 +0000)]
Add checks for invalid base64 encoded data, specifically relating to the
handling of padding. This fixes a crash that can be triggered by feeding
base64 data followed by 64 or more padding characters, which results in a
negative output length.
This issue was reported by David Ramos, although the same bug has been
sitting in the OpenSSL RT since 2011:
https://rt.openssl.org/Ticket/Display.html?id=2608
Worse still, BIO_read seems to be completely unable to detect that the
base64 input was invalid/corrupt - in particular, enabling
BIO_FLAGS_BASE64_NO_NL results in a stream of zero value bytes rather than
no input (possibly a good replacement for /dev/null...), which could
result in nasty consequences. Prior to this fix some zero value bytes were
also injected without this flag being enabled.
The recently added base64 regress triggers and documents these issues
(and also ensures that this change retains functional behaviour).
tedu [Sat, 3 May 2014 16:33:35 +0000 (16:33 +0000)]
1. Drop support for no minor. This variant doesn't exist anymore.
2. Pull up the actual minor processing code into the switch that
parses it.
3. atoi is actually simpler than strtonum in this case, but check the
input beforehand so we don't get unexpected results.
4. Slightly more consistent style between various parse and check and
increment operations on salt.
ok deraadt
jsing [Sat, 3 May 2014 16:30:53 +0000 (16:30 +0000)]
It is definitly not the correct spelling.
jsing [Sat, 3 May 2014 16:22:28 +0000 (16:22 +0000)]
KNF.
martynas [Sat, 3 May 2014 16:19:53 +0000 (16:19 +0000)]
Annotate wide character routines so they get protected by Wbounded.
OK millert@
martynas [Sat, 3 May 2014 16:13:03 +0000 (16:13 +0000)]
- Provide extended-precision math constants req'd by POSIX
- Explicitly cast double-precision constants as needed for
FLT_EVAL_METHOD = 2 archs
OK guenther@, ratchov@
jsing [Sat, 3 May 2014 16:03:54 +0000 (16:03 +0000)]
Nuke more defines - we have setvbuf() and _IONBF.
ok deraadt@