openbsd
9 years agoAnd the variable too.
brad [Tue, 20 Jan 2015 03:58:04 +0000 (03:58 +0000)]
And the variable too.

9 years agoSELECT_FD_TYPE is obsolete
guenther [Tue, 20 Jan 2015 03:55:18 +0000 (03:55 +0000)]
SELECT_FD_TYPE is obsolete

9 years agoBack out a chunk of rev 1.34 that wasn't supposed to go in with the
brad [Tue, 20 Jan 2015 03:54:26 +0000 (03:54 +0000)]
Back out a chunk of rev 1.34 that wasn't supposed to go in with the
capitalization corrections.

9 years agoprintf wasn't supposed to go in.
brad [Tue, 20 Jan 2015 03:26:24 +0000 (03:26 +0000)]
printf wasn't supposed to go in.

9 years agoMove #include <syslog.h> to the one file that needs it
guenther [Tue, 20 Jan 2015 03:14:52 +0000 (03:14 +0000)]
Move #include <syslog.h> to the one file that needs it

9 years agoAdd support for tracing libraries in static PIE binaries. rcrt does not
deraadt [Tue, 20 Jan 2015 02:16:19 +0000 (02:16 +0000)]
Add support for tracing libraries in static PIE binaries.  rcrt does not
contain "LD_TRACE_LOADED_OBJECTS" support, so this gets done by calling
RTLD_TRACE directly.
ok guenther

9 years ago#include <sys/syslimits.h> to allow operation without requiring the noise
deraadt [Tue, 20 Jan 2015 01:48:13 +0000 (01:48 +0000)]
#include <sys/syslimits.h> to allow operation without requiring the noise
of <sys/param.h>

9 years agoDEFAULT_PRIORITY and DEFAULT_QLIMIT no longer used
deraadt [Mon, 19 Jan 2015 23:52:02 +0000 (23:52 +0000)]
DEFAULT_PRIORITY and DEFAULT_QLIMIT no longer used

9 years agoRouting sockets are here to stay, so delete the wrapper that would use the
guenther [Mon, 19 Jan 2015 23:51:54 +0000 (23:51 +0000)]
Routing sockets are here to stay, so delete the wrapper that would use the
defunct ioctl(SIOCSARP)

ok millert@

9 years agoExplicitly mention that PATH_MAX includes the NUL in the ENAMETOOLONG
millert [Mon, 19 Jan 2015 23:41:32 +0000 (23:41 +0000)]
Explicitly mention that PATH_MAX includes the NUL in the ENAMETOOLONG
description.

9 years agoPrefer linux_sockaddr over osockaddr, so the latter can go away.
guenther [Mon, 19 Jan 2015 23:30:20 +0000 (23:30 +0000)]
Prefer linux_sockaddr over osockaddr, so the latter can go away.
sys_socket() supports SOCK_{CLOEXEC,NONBLOCK} now, so build on that.
doaccept() supports the non-inheriting-of-O_NONBLOCK, so build on that.
Merge compat_sys_{accept,send,recv}() into their only callers.
Lie a little and use struct sockaddr in the linux socket syscall args when
 it's a return argument to avoid a bunch a casts.
Delete many other unnecessary sockaddr casts

verified with a curl Linux binary

9 years agoback it out properly
deraadt [Mon, 19 Jan 2015 23:01:07 +0000 (23:01 +0000)]
back it out properly

9 years agonever tested with a make release
deraadt [Mon, 19 Jan 2015 22:58:53 +0000 (22:58 +0000)]
never tested with a make release

9 years agoTalk about thread-local errno and do not mention "extern int errno".
millert [Mon, 19 Jan 2015 21:29:38 +0000 (21:29 +0000)]
Talk about thread-local errno and do not mention "extern int errno".
Also correct the string version of error 0.  OK guenther@

9 years agoThe kernel doesn't actually care what a sockaddr's sa_len is on input,
guenther [Mon, 19 Jan 2015 21:18:47 +0000 (21:18 +0000)]
The kernel doesn't actually care what a sockaddr's sa_len is on input,
so don't waste code setting it

improvment and ok florian@

9 years agoNo need to include pfvar.h, another leftover from relayd. It was also
reyk [Mon, 19 Jan 2015 21:07:33 +0000 (21:07 +0000)]
No need to include pfvar.h, another leftover from relayd.  It was also
used for portrange operators which weren't used in httpd.

OK florian@

9 years agoUse initial assignment of action to check for errors.
bcook [Mon, 19 Jan 2015 20:47:03 +0000 (20:47 +0000)]
Use initial assignment of action to check for errors.

This simplifies things and make action = -1 no longer a dead store.

Also, spell FALLTHROUGH consistently.

reported by fritjof@alokat.org

9 years agofinally enable the KEX tests I wrote some years ago...
markus [Mon, 19 Jan 2015 20:45:25 +0000 (20:45 +0000)]
finally enable the KEX tests I wrote some years ago...

9 years agoadapt to new error message (SSH_ERR_MAC_INVALID)
markus [Mon, 19 Jan 2015 20:42:31 +0000 (20:42 +0000)]
adapt to new error message (SSH_ERR_MAC_INVALID)

9 years agoswitch ssh-keyscan from setjmp to multiple ssh transport layer instances
markus [Mon, 19 Jan 2015 20:32:39 +0000 (20:32 +0000)]
switch ssh-keyscan from setjmp to multiple ssh transport layer instances
ok djm@

9 years agoadd experimental api for packet layer; ok djm@
markus [Mon, 19 Jan 2015 20:30:23 +0000 (20:30 +0000)]
add experimental api for packet layer; ok djm@

9 years agoMissing initialization; tjenahej@speedmail.se
miod [Mon, 19 Jan 2015 20:25:36 +0000 (20:25 +0000)]
Missing initialization; tjenahej@speedmail.se

9 years agoAdd arc4random/getentropy shims for NetBSD.
bcook [Mon, 19 Jan 2015 20:21:40 +0000 (20:21 +0000)]
Add arc4random/getentropy shims for NetBSD.

The latest NetBSD (6.1.5) arc4random does not appear to reseed the CRNG state
after a fork, so provide an override until the fork-safe version in CVS appears
in a release.

These are the same as the FreeBSD shims.

ok deraadt@

9 years agostore compat flags in struct ssh; ok djm@
markus [Mon, 19 Jan 2015 20:20:20 +0000 (20:20 +0000)]
store compat flags in struct ssh; ok djm@

9 years agoOops, missed the new #include when manually applying the diff from
guenther [Mon, 19 Jan 2015 20:16:27 +0000 (20:16 +0000)]
Oops, missed the new #include when manually applying the diff from
Helg (xx404 (at) msn.com)

9 years agoadapt kex to sshbuf and struct ssh; ok djm@
markus [Mon, 19 Jan 2015 20:16:15 +0000 (20:16 +0000)]
adapt kex to sshbuf and struct ssh; ok djm@

9 years ago`wellspring' Apple keyboards found on Macbook Air need slightly different
miod [Mon, 19 Jan 2015 20:16:10 +0000 (20:16 +0000)]
`wellspring' Apple keyboards found on Macbook Air need slightly different
processing for Fn-key chords. From William Orr <will@worrbase.com>

9 years agoFix bracing in ASSERT_VP_ISLOCKED(vp) macro to not always panic()
guenther [Mon, 19 Jan 2015 20:13:03 +0000 (20:13 +0000)]
Fix bracing in ASSERT_VP_ISLOCKED(vp) macro to not always panic()

From Helg (xx404 (at) msn.com)

9 years agomove dispatch to struct ssh; ok djm@
markus [Mon, 19 Jan 2015 20:07:45 +0000 (20:07 +0000)]
move dispatch to struct ssh; ok djm@

9 years agoLog the remote user in the access.log.
florian [Mon, 19 Jan 2015 20:01:02 +0000 (20:01 +0000)]
Log the remote user in the access.log.
Pointed out by, tweak & OK reyk@

9 years agos/clt_fcgi_remote_user/clt_remote_user/
florian [Mon, 19 Jan 2015 20:00:07 +0000 (20:00 +0000)]
s/clt_fcgi_remote_user/clt_remote_user/
OK reyk@

9 years agoMove doaccept() declaration from its .c file to sys/socketvar.h for use
guenther [Mon, 19 Jan 2015 19:57:59 +0000 (19:57 +0000)]
Move doaccept() declaration from its .c file to sys/socketvar.h for use
by compat/linux

9 years agoupdate packet.c & isolate, introduce struct ssh
markus [Mon, 19 Jan 2015 19:52:16 +0000 (19:52 +0000)]
update packet.c & isolate, introduce struct ssh
a) switch packet.c to buffer api and isolate per-connection info into struct ssh
b) (de)serialization of the state is moved from monitor to packet.c
c) the old packet.c API is implemented in opacket.[ch]
d) compress.c/h is removed and integrated into packet.c
with and ok djm@

9 years agoDelete ABI compat for osockaddr: 20 years and many ABI bumps since sa_len added
guenther [Mon, 19 Jan 2015 19:47:29 +0000 (19:47 +0000)]
Delete ABI compat for osockaddr: 20 years and many ABI bumps since sa_len added

ok krw@ bluhm@ deraadt@

9 years agoPrefer strdup() to malloc() + strcpy() and ftello() to ftell()
miod [Mon, 19 Jan 2015 19:46:55 +0000 (19:46 +0000)]
Prefer strdup() to malloc() + strcpy() and ftello() to ftell()
ok deraadt@ guenther@ millert@

9 years agoDecouple auth parameters from struct server_config into struct auth.
reyk [Mon, 19 Jan 2015 19:37:50 +0000 (19:37 +0000)]
Decouple auth parameters from struct server_config into struct auth.

OK florian@

9 years agoDoes not need netinet/ip_ipsp.h
deraadt [Mon, 19 Jan 2015 19:25:47 +0000 (19:25 +0000)]
Does not need netinet/ip_ipsp.h

9 years agoAlso print the fspace member of map entries when PRINT_VM_MAP_ENTRY is
kettenis [Mon, 19 Jan 2015 19:25:28 +0000 (19:25 +0000)]
Also print the fspace member of map entries when PRINT_VM_MAP_ENTRY is
requested.

ok deraadt@

9 years agoRemove dead store causing clang to warn; dhill
miod [Mon, 19 Jan 2015 18:38:41 +0000 (18:38 +0000)]
Remove dead store causing clang to warn; dhill

9 years agouse SYMLOOP_MAX rather than MAXSYMLINKS
deraadt [Mon, 19 Jan 2015 18:37:19 +0000 (18:37 +0000)]
use SYMLOOP_MAX rather than MAXSYMLINKS

9 years agomikeb points out that 'struct ipsec_policy' can also be hidden by _KERNEL
deraadt [Mon, 19 Jan 2015 18:36:51 +0000 (18:36 +0000)]
mikeb points out that 'struct ipsec_policy' can also be hidden by _KERNEL

9 years agoremove #ifndef #define blocks trying to handle lack of BUFSIZ
deraadt [Mon, 19 Jan 2015 18:20:47 +0000 (18:20 +0000)]
remove #ifndef #define blocks trying to handle lack of BUFSIZ
ok millert

9 years agomlk jr day is the third monday, and not just for new york.
tedu [Mon, 19 Jan 2015 18:07:47 +0000 (18:07 +0000)]
mlk jr day is the third monday, and not just for new york.
from richard

9 years agoSYMLOOP_MAX == MAXSYMLINKS, so use SYMLOOP_MAX
deraadt [Mon, 19 Jan 2015 18:05:41 +0000 (18:05 +0000)]
SYMLOOP_MAX == MAXSYMLINKS, so use SYMLOOP_MAX

9 years agoKill loadavg.h and just use the fscale value directly.
millert [Mon, 19 Jan 2015 18:01:13 +0000 (18:01 +0000)]
Kill loadavg.h and just use the fscale value directly.
There's no need for crazy casts of p_pctcpu in ORDERKEY_PCTCPU
since kinfo_proc exports it as uint32_t.  OK deraadt@

9 years agosparc also needs <machine/param.h> for CPU_SUN*.
miod [Mon, 19 Jan 2015 18:01:11 +0000 (18:01 +0000)]
sparc also needs <machine/param.h> for CPU_SUN*.

9 years agofix format strings in (disabled) debugging
djm [Mon, 19 Jan 2015 17:35:48 +0000 (17:35 +0000)]
fix format strings in (disabled) debugging

9 years agothis test was broken in at least two ways, such that it
djm [Mon, 19 Jan 2015 17:31:13 +0000 (17:31 +0000)]
this test was broken in at least two ways, such that it
wasn't checking that a KRL was not excluding valid keys

9 years agoFirst step of hiding many kernel-only parts of <netinet/ip_ipsp.h>
deraadt [Mon, 19 Jan 2015 16:49:04 +0000 (16:49 +0000)]
First step of hiding many kernel-only parts of <netinet/ip_ipsp.h>
under _KERNEL, and adjust the one consumer (netstat) so that it requests
the exposure.  Will take a few more rounds to get this right.
ok mikeb

9 years agocleanup of the SMALL hiding from Mathias Svensson
deraadt [Mon, 19 Jan 2015 16:43:28 +0000 (16:43 +0000)]
cleanup of the SMALL hiding from Mathias Svensson

9 years agoReplace HOST_NAME_MAX+1 with NI_MAXHOST when the hostname is used
bluhm [Mon, 19 Jan 2015 16:40:49 +0000 (16:40 +0000)]
Replace HOST_NAME_MAX+1 with NI_MAXHOST when the hostname is used
with getaddrinfo() or getnameinfo(), but keep HOST_NAME_MAX+1 when
the hostname comes from gethostname().
No binary change;  OK deraadt@

9 years agoMake use of an msr available on recent Intel processors to obtain the
jsg [Mon, 19 Jan 2015 16:01:43 +0000 (16:01 +0000)]
Make use of an msr available on recent Intel processors to obtain the
maximum supported temperature, Tj(Max).  As the temperature values are
relative to this value this should make the sensor values more accurate.

From Simon Mages.

9 years agoExplicitly mention that PATH_MAX includes the NUL in the ENAMETOOLONG
millert [Mon, 19 Jan 2015 15:54:11 +0000 (15:54 +0000)]
Explicitly mention that PATH_MAX includes the NUL in the ENAMETOOLONG
description.

9 years agoMake some $OpenBSD$ lines prettier/standardier by eliminating
krw [Mon, 19 Jan 2015 15:30:52 +0000 (15:30 +0000)]
Make some $OpenBSD$ lines prettier/standardier by eliminating
superflous '*' after '/*' and adding blank after terminating '$'.
Also eases parsing of the lines by simple awk scripts.

Aesthetic approval from tedu@.

9 years agoRemove unnecessary <netinet/ip_ipsp.h> includes
mikeb [Mon, 19 Jan 2015 14:42:42 +0000 (14:42 +0000)]
Remove unnecessary <netinet/ip_ipsp.h> includes

9 years agoBack out changes unrelated to the ENAMETOOLONG diff.
millert [Mon, 19 Jan 2015 13:59:16 +0000 (13:59 +0000)]
Back out changes unrelated to the ENAMETOOLONG diff.

9 years ago<netinet6/in6_ifattach.h> is not needed here.
mpi [Mon, 19 Jan 2015 13:53:55 +0000 (13:53 +0000)]
<netinet6/in6_ifattach.h> is not needed here.

9 years agoremove a couple of unused headers.
bcook [Mon, 19 Jan 2015 11:44:08 +0000 (11:44 +0000)]
remove a couple of unused headers.

reported by Jonas 'Sortie' Termansen

9 years agoMake a tmux-%u directory under TMUX_TMPDIR, like TMPDIR.
nicm [Mon, 19 Jan 2015 09:58:34 +0000 (09:58 +0000)]
Make a tmux-%u directory under TMUX_TMPDIR, like TMPDIR.

9 years agoOnly care about other permissions, allow group to be set.
nicm [Mon, 19 Jan 2015 09:57:33 +0000 (09:57 +0000)]
Only care about other permissions, allow group to be set.

9 years agoRemove unnecessary duplicate S_ISDIR check, from Dmitri Paduchikh.
nicm [Mon, 19 Jan 2015 09:53:15 +0000 (09:53 +0000)]
Remove unnecessary duplicate S_ISDIR check, from Dmitri Paduchikh.

9 years agoadd a specialized version of version compares that should not update
espie [Mon, 19 Jan 2015 09:42:06 +0000 (09:42 +0000)]
add a specialized version of version compares that should not update
everything all the time, at the bequest of aja.

(basically, we updated everything when runtime dependencies  changed, even
though we actually only care for wantlib, and hard dependencies, but those
trigger bumps all over the tree)

Experimental for now, turn on with -DSHORTENED. Likely to become the new
default if nothing bad comes out of it.

9 years agoIf SIGUSR1 and SIGUSR2 are unavailable, don't invent something crazy
deraadt [Mon, 19 Jan 2015 07:41:01 +0000 (07:41 +0000)]
If SIGUSR1 and SIGUSR2 are unavailable, don't invent something crazy
honouring systems before 4.3BSD.

9 years agoreplace local MIN() with MINIMUM()
deraadt [Mon, 19 Jan 2015 07:39:24 +0000 (07:39 +0000)]
replace local MIN() with MINIMUM()

9 years agopass the size of the softc to free.
dlg [Mon, 19 Jan 2015 06:27:57 +0000 (06:27 +0000)]
pass the size of the softc to free.

ok deraadt@

9 years agobe a bit more careful in these tests to ensure that
djm [Mon, 19 Jan 2015 06:01:32 +0000 (06:01 +0000)]
be a bit more careful in these tests to ensure that
known_hosts is clean

9 years agowhite space fixes. no binary change.
dlg [Mon, 19 Jan 2015 03:57:22 +0000 (03:57 +0000)]
white space fixes. no binary change.

9 years agogcc does not understand that the loop conditionally sets bsod before
deraadt [Mon, 19 Jan 2015 02:44:53 +0000 (02:44 +0000)]
gcc does not understand that the loop conditionally sets bsod before
using it, so it warns...  Copy the warning silencing code from the
same function in ../ld.so

9 years agolike in ps(1), fetch the FSCALE value using sysctl rather than using
deraadt [Mon, 19 Jan 2015 01:53:18 +0000 (01:53 +0000)]
like in ps(1), fetch the FSCALE value using sysctl rather than using
the header version
ok guenther

9 years agomove to <limits.h> universe
deraadt [Mon, 19 Jan 2015 01:48:57 +0000 (01:48 +0000)]
move to <limits.h> universe
ok yasuoka

9 years agoCMASK went out of scope with the recent <sys/param.h> removal. But oh
deraadt [Mon, 19 Jan 2015 01:24:39 +0000 (01:24 +0000)]
CMASK went out of scope with the recent <sys/param.h> removal.  But oh
golly gee, ftpd can handle that itself due to the glorious old practice
of #ifndef #define.  Remove that junk.
ok guenther

9 years agounneccessary cmask variable; ok guenther
deraadt [Mon, 19 Jan 2015 01:19:17 +0000 (01:19 +0000)]
unneccessary cmask variable; ok guenther

9 years agoIf UID_MAX is not defined, this should fail to compile.
deraadt [Mon, 19 Jan 2015 01:05:32 +0000 (01:05 +0000)]
If UID_MAX is not defined, this should fail to compile.
ok guenther

9 years agonormalize formatting
deraadt [Mon, 19 Jan 2015 00:47:01 +0000 (00:47 +0000)]
normalize formatting

9 years agocleanup sys/param.h comment
deraadt [Mon, 19 Jan 2015 00:41:44 +0000 (00:41 +0000)]
cleanup sys/param.h comment

9 years agodjm, your /usr/include tree is old
deraadt [Mon, 19 Jan 2015 00:32:54 +0000 (00:32 +0000)]
djm, your /usr/include tree is old

9 years agoThe kernel doesn't actually care what a sockaddr's sa_len is on input,
guenther [Mon, 19 Jan 2015 00:22:30 +0000 (00:22 +0000)]
The kernel doesn't actually care what a sockaddr's sa_len is on input,
so don't waste code setting it

9 years agoregression test for known_host file editing using
djm [Sun, 18 Jan 2015 22:00:18 +0000 (22:00 +0000)]
regression test for known_host file editing using
ssh-keygen (-H / -R / -F) after hostkeys_foreach() change;
feedback and ok markus@

9 years agosome feedback from markus@: comment hostkeys_foreach()
djm [Sun, 18 Jan 2015 21:51:19 +0000 (21:51 +0000)]
some feedback from markus@: comment hostkeys_foreach()
context and avoid a member in it.

9 years agomake ssh-keygen use hostkeys_foreach(). Removes some
djm [Sun, 18 Jan 2015 21:49:42 +0000 (21:49 +0000)]
make ssh-keygen use hostkeys_foreach(). Removes some
horrendous code; ok markus@

9 years agoconvert load_hostkeys() (hostkey ordering and known_host
djm [Sun, 18 Jan 2015 21:48:09 +0000 (21:48 +0000)]
convert load_hostkeys() (hostkey ordering and known_host
matching) to use the new hostkey_foreach() iterator;
ok markus

9 years agoBack out previous. HOST_NAME_MAX is only defined for newer POSIX
millert [Sun, 18 Jan 2015 21:47:16 +0000 (21:47 +0000)]
Back out previous.  HOST_NAME_MAX is only defined for newer POSIX
revisions so it is not safe to define MAXHOSTNAMELEN in terms of it.

9 years agointroduce hostkeys_foreach() to allow iteration over a
djm [Sun, 18 Jan 2015 21:40:23 +0000 (21:40 +0000)]
introduce hostkeys_foreach() to allow iteration over a
known_hosts file or controlled subset thereof. This will
allow us to pull out some ugly and duplicated code, and
will be used to implement hostkey rotation later.

feedback and ok markus

9 years agoForward declare 'struct file' so that libkvm and others that indirectly pull
guenther [Sun, 18 Jan 2015 20:35:44 +0000 (20:35 +0000)]
Forward declare 'struct file' so that libkvm and others that indirectly pull
in sys/uio.h with _KERNEL defined don't warn.

ok deraadt@

9 years agoDo not trust the content of event TRBs coming from the hardware and
mpi [Sun, 18 Jan 2015 20:35:11 +0000 (20:35 +0000)]
Do not trust the content of event TRBs coming from the hardware and
maintain a list of possibly submitted commands.

9 years agoStop including <sys/param.h> from <netdb.h>. Portable software must either
deraadt [Sun, 18 Jan 2015 20:29:31 +0000 (20:29 +0000)]
Stop including <sys/param.h> from <netdb.h>.  Portable software must either
include <sys/param.h> (to operate in legacy mode) or if it wishes to operate
in the POSIX world use <limits.h>
ok guenther millert doug naddy

9 years agoEliminate a gcc warnings by not #defining _KERNEL when pulling in
guenther [Sun, 18 Jan 2015 20:05:20 +0000 (20:05 +0000)]
Eliminate a gcc warnings by not #defining _KERNEL when pulling in
<sys/socket.h>: it doesn't expose anything kdump cares about.
Also, COMPAT_43 is dead

warning noted by deraadt@

9 years agomore and better key tests
djm [Sun, 18 Jan 2015 19:54:46 +0000 (19:54 +0000)]
more and better key tests

test signatures and verification
test certificate generation
flesh out nested cert test

removes most of the XXX todo markers

9 years agomake the signature fuzzing test much more rigorous:
djm [Sun, 18 Jan 2015 19:53:58 +0000 (19:53 +0000)]
make the signature fuzzing test much more rigorous:
ensure that the fuzzed input cases do not match the
original (using new fuzz_matches_original() function)
and check that the verification fails in each case

9 years agoadd a fuzz_matches_original() function to the fuzzer to
djm [Sun, 18 Jan 2015 19:52:44 +0000 (19:52 +0000)]
add a fuzz_matches_original() function to the fuzzer to
detect fuzz cases that are identical to the original data.
Hacky implementation, but very useful when you need the
fuzz to be different, e.g. when verifying signature

9 years agobetter dumps from the fuzzer (shown on errors) - include the
djm [Sun, 18 Jan 2015 19:50:55 +0000 (19:50 +0000)]
better dumps from the fuzzer (shown on errors) - include the
original data as well as the fuzzed copy.

9 years agodidn't mean to commit these changes
djm [Sun, 18 Jan 2015 19:50:15 +0000 (19:50 +0000)]
didn't mean to commit these changes

9 years agoenable hostkey-agent.sh test
djm [Sun, 18 Jan 2015 19:47:55 +0000 (19:47 +0000)]
enable hostkey-agent.sh test

9 years agoImplement sending syslog messages over TLS.
bluhm [Sun, 18 Jan 2015 19:37:59 +0000 (19:37 +0000)]
Implement sending syslog messages over TLS.
OK reyk@

9 years agotweak previous
florian [Sun, 18 Jan 2015 18:39:46 +0000 (18:39 +0000)]
tweak previous
with help from jmc@

9 years agoThis size check was obviously commented out because of the incorrect
mpi [Sun, 18 Jan 2015 17:18:08 +0000 (17:18 +0000)]
This size check was obviously commented out because of the incorrect
size computed for reports with reportID.

Tested by Benjamin Baier.

9 years agoDo not calculated the length of a report with an extra byte for the
mpi [Sun, 18 Jan 2015 17:16:06 +0000 (17:16 +0000)]
Do not calculated the length of a report with an extra byte for the
reportID because the kernel skips it.

Problem reported and fix tested by Benjamin Baier.

9 years agoWhen restoring spsr values when handling traps use spsr_fsxc instead
jsg [Sun, 18 Jan 2015 16:26:39 +0000 (16:26 +0000)]
When restoring spsr values when handling traps use spsr_fsxc instead
of spsr_all so all the bits are restored.  Using the msr instruction
with spsr_all is treated the same as spsr_fc and does not include the
status and extension fields (bits 23:8).

This fixes the problem of some i.MX6 machines powering up with the
big endian bit set in the extension field causing them to crash
on returning from the first interrupt.

From NetBSD.

9 years agoSwitch some uses of msr that only deal with interrupts/mode to use
jsg [Sun, 18 Jan 2015 14:55:02 +0000 (14:55 +0000)]
Switch some uses of msr that only deal with interrupts/mode to use
just the control field ('c' bits 7:0) instead of 'all' which includes
the flags field ('f' bits 31:24) which isn't modified.

9 years agoDo not even try to dereference a NULL pointer.
mpi [Sun, 18 Jan 2015 14:51:43 +0000 (14:51 +0000)]
Do not even try to dereference a NULL pointer.

Found the hard way by Peter N. M. Hansteen.

ok claudio@, phessler@