deraadt [Tue, 6 Oct 2015 21:17:01 +0000 (21:17 +0000)]
oops, mistaken commit, spotted by naddy
matthew [Tue, 6 Oct 2015 20:49:32 +0000 (20:49 +0000)]
0xffffffff is 32 bits, not 24 bits
ok deraadt
schwarze [Tue, 6 Oct 2015 18:46:05 +0000 (18:46 +0000)]
With growing functionality, the synopsis became long and confusing.
The syntax of some subcommands has almost nothing in common with the
syntax of others. So split the synopsis to make it more readable.
"if you feel it helps, go for it" jmc@ ajacoutot@
schwarze [Tue, 6 Oct 2015 18:35:55 +0000 (18:35 +0000)]
use ellipsis for arguments that can be repeated;
ok ajacoutot@ jmc@
deraadt [Tue, 6 Oct 2015 18:35:09 +0000 (18:35 +0000)]
A process should be able to do sigpending for itself
schwarze [Tue, 6 Oct 2015 18:30:43 +0000 (18:30 +0000)]
modernize style: "return" is not a function; ok cmp(1)
deraadt [Tue, 6 Oct 2015 18:15:02 +0000 (18:15 +0000)]
For TAME_PROC, allow setrlimit()
benno [Tue, 6 Oct 2015 17:23:21 +0000 (17:23 +0000)]
fix flowsrc spec, ok florian, thx ingo!
deraadt [Tue, 6 Oct 2015 17:05:30 +0000 (17:05 +0000)]
When "proc" is requested, allow setpgid() and sigsuspend().
Also the combination of "proc tty" needs to permit TIOCSPGRP.
This is the start at minimum semantics required by processes which
work on process groups, sessions, ttys.
tedu [Tue, 6 Oct 2015 16:51:15 +0000 (16:51 +0000)]
we're running rm. call it rm too.
semarie [Tue, 6 Oct 2015 15:45:31 +0000 (15:45 +0000)]
update "cmsg" tests: it lost TAME_SELF flag.
deraadt [Tue, 6 Oct 2015 15:39:44 +0000 (15:39 +0000)]
Move from tame "cmsg" to tame "sendfd" or "recvfd", depending on which
way the process moves fd's.
semarie [Tue, 6 Oct 2015 15:24:54 +0000 (15:24 +0000)]
add some tests for rpath, wpath, cpath
deraadt [Tue, 6 Oct 2015 15:21:26 +0000 (15:21 +0000)]
Add new "tty" request, which allows TIOCGETA, TIOCGPGRP, TIOCGWINSZ,
TIOCSBRK, TIOCCDTR, TIOCSETA, TIOCSETAW, and TIOCSETAF on tty
vnodes. This helps programs which call tcsetattr(), tcgetattr(), or
readpassphrase(). Especially the latter - tame's goal is to satisfy
the libc requirements of security-sensitive programs.
Remove TIOCSETAF from the basic "ioctl" request, because it is a "set"
option. "ioctl" is slowly turning into a "request information, cannot
set options" package.
Split the "cmsg" request into "sendfd" and "recvfd". Non-SCM_RIGHTS
messages are currently flowing through freely and we'll need to think
about that. This split lets us more strictly describe what our many
fd-passing programs will do.
kettenis [Tue, 6 Oct 2015 15:21:16 +0000 (15:21 +0000)]
Make sure that tx_buffer->next_eop is properly set before we bump the number
of available descriptors, such that the interrupt handler doesn't attempt
to complete partially initialized descriptors. Seems to fix the watchdog
timeouts reported by various people.
Tested by Mattieu Baptiste and Gregor Best.
ok mikeb@
tim [Tue, 6 Oct 2015 15:09:08 +0000 (15:09 +0000)]
Remove the -C option that converts an S/Key database to the new format. It has
been 13 years since the new format was introduced.
OK millert@
tim [Tue, 6 Oct 2015 15:07:45 +0000 (15:07 +0000)]
Don't burden keycrunch_{md5,sha1,rmd160}() with identical code to prepare a
buffer based on whether they are called by keycrunch() or f(). Instead let
keycrunch() and f() take care of this themselves.
OK millert@
tim [Tue, 6 Oct 2015 15:06:29 +0000 (15:06 +0000)]
Update path in comment; OK millert@
tedu [Tue, 6 Oct 2015 14:58:37 +0000 (14:58 +0000)]
clear out some more legacy code and whatnot
claudio [Tue, 6 Oct 2015 14:55:41 +0000 (14:55 +0000)]
Rework the tame cmsg handler to make it work both ways. While on recv one
mbuf blob with all the cmsgs inside while on send cmsgs in an mbuf chain,
one mbuf per message. Adjust the calls accordingly.
Putting it in so deraadt@ can move forward.
deraadt [Tue, 6 Oct 2015 14:39:07 +0000 (14:39 +0000)]
rmdir() is just a CPATH operation; remove RPATH marker that snuck in.
claudio [Tue, 6 Oct 2015 14:38:32 +0000 (14:38 +0000)]
Make sure that all padding bytes in cmsgs are actually zero by memset
CMSG_SIZE(len) bytes of the mbuf.
deraadt [Tue, 6 Oct 2015 14:38:23 +0000 (14:38 +0000)]
oops, namei was never allowing through valid CPATH operations
deraadt [Tue, 6 Oct 2015 14:02:49 +0000 (14:02 +0000)]
Add getrusage() to the TAME_SELF catagory.
stsp [Tue, 6 Oct 2015 14:02:25 +0000 (14:02 +0000)]
Fix buf leak in error path. ok gilles@ eric@
deraadt [Tue, 6 Oct 2015 13:49:33 +0000 (13:49 +0000)]
only modifies data, stdin to stdout, so tame "stdout"
deraadt [Tue, 6 Oct 2015 13:48:34 +0000 (13:48 +0000)]
use tame "stdio rpath wpath cpath fattr". There is some timezone
database stuff here which goes further than most programs, but the
neccessary files are readable using "rpath".
deraadt [Tue, 6 Oct 2015 13:47:08 +0000 (13:47 +0000)]
simple tame "stdio rpath"
deraadt [Tue, 6 Oct 2015 13:29:56 +0000 (13:29 +0000)]
tame "stdio rpath" before opening the file, tame "stdio" after that
bcook [Tue, 6 Oct 2015 12:54:24 +0000 (12:54 +0000)]
prefer limits.h over sys/limits.h
ok deraadt@
nicm [Tue, 6 Oct 2015 09:29:13 +0000 (09:29 +0000)]
Simple update for pdf, from file 5.x.
stsp [Tue, 6 Oct 2015 09:12:00 +0000 (09:12 +0000)]
Make iwm(4) set the MAC address the same way other wireless drivers do.
ok mpi@
gilles [Tue, 6 Oct 2015 08:51:35 +0000 (08:51 +0000)]
we don't need this temporary buffer since we're going to strdup() it right
away anyways
ok eric@
nicm [Tue, 6 Oct 2015 08:51:00 +0000 (08:51 +0000)]
Another simple update for xwindows, from 5.x.
nicm [Tue, 6 Oct 2015 08:20:10 +0000 (08:20 +0000)]
Log the matched offset (and the new offset) instead of just of the new
offset (as if it was where the match was found).
nicm [Tue, 6 Oct 2015 08:13:03 +0000 (08:13 +0000)]
ssh and ssl key file magic, from file 5.x.
nicm [Tue, 6 Oct 2015 08:12:30 +0000 (08:12 +0000)]
Another simple update from file 5.x.
gilles [Tue, 6 Oct 2015 06:44:47 +0000 (06:44 +0000)]
fix snprintf() error checking in token expansion code, these can't possibly
fail but it's no excuse for getting the checks wrong.
spotted by qualys
gilles [Tue, 6 Oct 2015 06:07:28 +0000 (06:07 +0000)]
fix chdir() call for the sake of correctness
reported by qualys
gilles [Tue, 6 Oct 2015 06:04:46 +0000 (06:04 +0000)]
fix values passed to umask(), they should be octal.
the permissions are even more restrictive than they should.
misc bug reported by qualys
deraadt [Tue, 6 Oct 2015 06:03:11 +0000 (06:03 +0000)]
do not need ioctl.h
deraadt [Tue, 6 Oct 2015 05:51:01 +0000 (05:51 +0000)]
Obvious tame "stdio rpath wpath cpath" to a program I will never use.
gilles [Tue, 6 Oct 2015 05:48:34 +0000 (05:48 +0000)]
fix reallocarray() constructs to always use temporary variable
deraadt [Tue, 6 Oct 2015 05:42:12 +0000 (05:42 +0000)]
Enable ioctl() in the "rw" request, to support FIONREAD/FIONBIO easier
for the stdio/libevent usage case. Further ioctl commands are narrowly
checked as before.
ok djm guenther semarie
deraadt [Tue, 6 Oct 2015 03:29:49 +0000 (03:29 +0000)]
these do not use ioctl.h
guenther [Tue, 6 Oct 2015 03:29:35 +0000 (03:29 +0000)]
struct knote's kn_sdata needs to be the same type as struct kevent's data
ok deraadt@
deraadt [Tue, 6 Oct 2015 03:27:25 +0000 (03:27 +0000)]
tame "stdio getpw"
discussed with guenther
deraadt [Tue, 6 Oct 2015 03:26:31 +0000 (03:26 +0000)]
data processing stdin to stdout; tame "stdout"
deraadt [Tue, 6 Oct 2015 03:25:02 +0000 (03:25 +0000)]
unfortunately tame "stdio" can only happen well after the sequence of:
utmp parsing, tty opening, setresgid to drop privs. it only protects
a basic io loop.
discussed with doug
djm [Tue, 6 Oct 2015 01:20:59 +0000 (01:20 +0000)]
adapt to recent sshkey_parse_private_fileblob() API change
deraadt [Tue, 6 Oct 2015 00:30:30 +0000 (00:30 +0000)]
The performance hit for -fstack-protector-all is worth it here.
ok gilles
deraadt [Tue, 6 Oct 2015 00:24:20 +0000 (00:24 +0000)]
Appears that tame "stdio getpw rpath" will satisfy all code paths.
deraadt [Mon, 5 Oct 2015 23:59:11 +0000 (23:59 +0000)]
During getopt(), an optional file may be opened. After that, tame "stdio"
works.
Time for some commentary! tame became possible because syslog(3) in
openbsd uses a system call -- sendsyslog(2) -- which does not require
an elaborate dance opening an AF_UNIX socket and using connect() or
send() to deliver to a "/dev/log" unix socket in the filesystem.
sendsyslog(2) was invented to ensure the stack-protector's
__stack_smash_handler() can gaurantee delivery of failure messages to
syslogd(8) in harsh conditions -- such as file descriptor exhaustion
or inside chroot(2). Now it also works in tame(2)'d proceses, since
sendsyslog(2) is always allowed. Our syslog(3) needs no elaborate
socket code, therefore piles of software does not have an inate need
for socket(2), connect(2), send(2), nor access to the filesystem.
syslog(3) remains fully compatible otherwise.
How does the stack protector report an error in fully capsicum'd
program? Or in some other Linux protection mechanism, if someone
protectes a program too far and takes sockets away, how do they see
the stack protector working?
You can have nice things when the underlying rules change.
deraadt [Mon, 5 Oct 2015 23:42:40 +0000 (23:42 +0000)]
tame "stdio rpath wpath cpath", because this program reads and creates
files, using stdio. It does nothing else.
nicm [Mon, 5 Oct 2015 23:32:15 +0000 (23:32 +0000)]
Remove EXTERN from lex.h and put the definitions in lex.c, from Michael
McConville.
nicm [Mon, 5 Oct 2015 23:26:58 +0000 (23:26 +0000)]
Remove EXTERN from table.h and put the definitions in table.c, from
Michael McConville.
nicm [Mon, 5 Oct 2015 23:21:52 +0000 (23:21 +0000)]
Another trivial update, some extra bits for timezone, from file 5.x.
nicm [Mon, 5 Oct 2015 23:15:31 +0000 (23:15 +0000)]
Set the line file descriptor nonblocking and make it blocking again for
xmodem and child processes, makes xmodem work with -d. Reported by Kim
Zeitler via guenther@, tested by Jiri B. ok (and a small change) guenther
yasuoka [Mon, 5 Oct 2015 22:59:39 +0000 (22:59 +0000)]
Fix efiboot not to use the usual kernel load address. Load the kernel in
an allocated region and also move the stack to the end of the heap region.
Then move the kernel to the usual place just before run the kernel, after
calling ExitBootService().
report/test Toby Slight, Brian Conway
nicm [Mon, 5 Oct 2015 22:48:26 +0000 (22:48 +0000)]
Very trivial changes from file 5.x: spelling mistakes, %ld->%d and some
style nits.
nicm [Mon, 5 Oct 2015 22:45:26 +0000 (22:45 +0000)]
Get BE and LE UTF-32 correct, from file 5.x.
nicm [Mon, 5 Oct 2015 22:36:23 +0000 (22:36 +0000)]
Update compress magic from the upstream file 5.x magic files.
stsp [Mon, 5 Oct 2015 22:08:14 +0000 (22:08 +0000)]
actually use lbuf in getmailname()
ok millert@ gilles@
tedu [Mon, 5 Oct 2015 21:59:29 +0000 (21:59 +0000)]
change a few examples to be more stylistic. pointed out by rob pierce
millert [Mon, 5 Oct 2015 20:15:00 +0000 (20:15 +0000)]
Remove the non-standard -l flag that pipes the output through pr(1).
Based on a diff from and OK deraadt@
nicm [Mon, 5 Oct 2015 20:05:52 +0000 (20:05 +0000)]
Add support for !:strength modifier to adjust strength of a test.
nicm [Mon, 5 Oct 2015 19:50:38 +0000 (19:50 +0000)]
Offset into the file can be size_t and add some casts to remove warnings.
uebayasi [Mon, 5 Oct 2015 19:05:09 +0000 (19:05 +0000)]
Revert if_oqdrops accounting changes done in kernel, per request from mpi@.
(Especially adding IF_DROP() after IFQ_ENQUEUE() was completely wrong because
IFQ_ENQUEUE() already does it. Oops.)
After this revert, the situation becomes:
- if_snd.ifq_drops is incremented in either IFQ_ENQUEUE() or IF_DROP(), but
it is not shown to userland, and
- if_data.ifi_oqdrops is shown to userland, but it is not incremented by
anyone.
nicm [Mon, 5 Oct 2015 17:53:56 +0000 (17:53 +0000)]
Style nits on a couple of casts.
millert [Mon, 5 Oct 2015 17:31:17 +0000 (17:31 +0000)]
Use explicit_bzero() instead of memset() for zeroing out secrets.
OK deraadt@
deraadt [Mon, 5 Oct 2015 17:26:22 +0000 (17:26 +0000)]
this process deserves -fstack-protector-all
djm [Mon, 5 Oct 2015 17:11:21 +0000 (17:11 +0000)]
some more bzero->explicit_bzero, from Michael McConville
jmc [Mon, 5 Oct 2015 16:41:51 +0000 (16:41 +0000)]
correct picasso's birth date;
from comet (freebsd 116952), via richard
deraadt [Mon, 5 Oct 2015 16:29:55 +0000 (16:29 +0000)]
alpha ramdisk ran out of space, very slightly. Probably due to the
development of tame? option CD9660 and mount_cd9660 are already
absent, so remove the cd(4) driver
ok miod
deraadt [Mon, 5 Oct 2015 16:16:41 +0000 (16:16 +0000)]
tame "stdio inet cmsg" should work well in the session engine.
ok benno
deraadt [Mon, 5 Oct 2015 16:09:56 +0000 (16:09 +0000)]
KNF a switch statement, moving a local variable up a frame as well -
carefully.
krw [Mon, 5 Oct 2015 16:07:57 +0000 (16:07 +0000)]
Out, damned whitespace!
uebayasi [Mon, 5 Oct 2015 15:57:27 +0000 (15:57 +0000)]
Count IFQ_ENQUEUE() failure as output drop.
mpi@ prefers checking IFQ_ENQUEUE() error, and this matches that.
OK dlg@
uebayasi [Mon, 5 Oct 2015 15:52:46 +0000 (15:52 +0000)]
Don't count IF_DROP()'ed packets as if_oerrors too.
mpi@ plans to clean-up IF_DROP()'s, but fix consistent use of it for now.
OK dlg@
millert [Mon, 5 Oct 2015 15:50:01 +0000 (15:50 +0000)]
Remove unused errstr variable.
semarie [Mon, 5 Oct 2015 15:42:54 +0000 (15:42 +0000)]
use different tame requests if TMPDIR is in env:
- tmppath for when mktemp() operates in /tmp proper
- cpath+wpath for use of $TMPDIR
based on log-message from previous commit
ok deraadt@
uebayasi [Mon, 5 Oct 2015 15:40:39 +0000 (15:40 +0000)]
Handle ifi_oqdrops in netstat(8).
OK mpi@ dlg@
uebayasi [Mon, 5 Oct 2015 15:39:01 +0000 (15:39 +0000)]
Accumulate ifq_drops into if_oqdrops if if_start().
mpi@ questioned usefulness of if_snd.ifq_drops, but this is what exists now.
This area is going to be readily polished.
OK dlg@
uebayasi [Mon, 5 Oct 2015 15:29:14 +0000 (15:29 +0000)]
Teach snmpd(8) about if_oqdrops.
OK mpi@ dlg@
deraadt [Mon, 5 Oct 2015 15:25:16 +0000 (15:25 +0000)]
If expression omits -exec/execdir/-ok primaries, then find will never
enter the fork+execve codepath. That allows use of "stdio getpw rpath"!
Use of -exec methods have been discouraged for years anyways, with
-print0/xargs -0 now considered safer practice.
ok guenther millert
uebayasi [Mon, 5 Oct 2015 15:19:29 +0000 (15:19 +0000)]
Add ifi_oqdrops and its alias to struct if_data.
Necessary bumps in Ports will be handled by sthen@.
OK mpi@ dlg@
deraadt [Mon, 5 Oct 2015 15:16:23 +0000 (15:16 +0000)]
If the -l flag is set, diff will fork/execve pr on a pipe. But other
uses can tame "stdio wpath rpath cpath tmppath". tmppath for when
mktemp() operates in /tmp proper, but cpath+wpath for use of $TMPDIR.
ok sthen millert
semarie [Mon, 5 Oct 2015 14:58:37 +0000 (14:58 +0000)]
correct a rtget() error check
this function could only return 0 or 1, and 1 on error.
avoid to deref an uninitialised variable if rtget() return an error.
ok millert@ benno@ deraadt@
deraadt [Mon, 5 Oct 2015 14:18:33 +0000 (14:18 +0000)]
these 3 files do not need sys/socket.h
deraadt [Mon, 5 Oct 2015 13:30:30 +0000 (13:30 +0000)]
tame "stdio rpath" or tame "stdio" suffices for all of these programs.
fairly easy to audit by running nm and noticing nothing beyond base
stdio except for fopen/freopen. Then review all callpaths to those
functions, and place the tame() calls.
ok sthen
deraadt [Mon, 5 Oct 2015 13:27:45 +0000 (13:27 +0000)]
This can use tame "stdio rpath" from the top. If we are only working on
stdin, an additional tame "stdio" is easy.
same diff from sthen
deraadt [Mon, 5 Oct 2015 13:24:39 +0000 (13:24 +0000)]
tame "stdio rpath" works. (Someone could refactor the processing loop
to handle the stdin case without rpath, but it looks a bit invasive.
ok sthen
stsp [Mon, 5 Oct 2015 13:05:08 +0000 (13:05 +0000)]
Simplify iwm(4) newstate task by only queuing one state transition
at a time. The newstate task now always transitions to the most
recently requested state, rather than hopping along with every request.
This allows us get rid of the silly newstate generation counter, and
we can now task_del() a pending transition when the interface goes down.
While several issues with this driver remain, I believe this change
does not introduce new problems.
Tested by myself, jasper@, and zhuk@
mikeb [Mon, 5 Oct 2015 13:00:04 +0000 (13:00 +0000)]
Factor LACP frame processing out to a separate task
This is slightly refactored version of the diff by jmatthew@
that makes use of a single per-trunk task but retains per-port
mbuf queues.
Running LACP frame processing in a task context allows a simple
way to synchronize changes to the trunk ports and trunk itself
performed from the ioctl, timeout and task contexts with a kernel
lock.
OK mpi
krw [Mon, 5 Oct 2015 12:49:58 +0000 (12:49 +0000)]
Remove 'landisk' from the comment about NUMBOOT archs. Only one
NUMBOOT arch is left: Vax.
sobrado [Mon, 5 Oct 2015 10:25:59 +0000 (10:25 +0000)]
fix some spelling messes.
sobrado [Mon, 5 Oct 2015 10:25:19 +0000 (10:25 +0000)]
typo.
ratchov [Mon, 5 Oct 2015 07:18:03 +0000 (07:18 +0000)]
Fix missing checks for truncation of long file names. Rather than
checking for truncation every time we touch the string, simply allocate
a memory chunk large enough to store the full path.
deraadt [Mon, 5 Oct 2015 07:16:03 +0000 (07:16 +0000)]
tame "stdio rpath" works fine, as long as we sidestep the demangling
process which involves fork+execve....
ok doug
deraadt [Mon, 5 Oct 2015 07:09:46 +0000 (07:09 +0000)]
Since the dawn of time, this has contained freopen() for the tty path
with mode "w", as root, since "w" implies O_CREAT. That will create
the raw file in /dev if it does not yet exist (due to a lie in utmp).
It should use "r+", to open it for for O_RDWR only.
Oh man this reminds me of 1988, how old is this bug?
ok doug