openbsd
9 years agoLABELSECTOR is a DEV_BSIZE quantity. So multiply by DEV_BSIZE and not
krw [Mon, 19 Oct 2015 19:07:59 +0000 (19:07 +0000)]
LABELSECTOR is a DEV_BSIZE quantity. So multiply by DEV_BSIZE and not
d_secsize when calculating disklabel location.

ok jsing@

9 years agoNuke unused variable.
krw [Mon, 19 Oct 2015 19:05:24 +0000 (19:05 +0000)]
Nuke unused variable.

9 years agoincluding <ohash.h> requires including <stdint.h> beforehand;
schwarze [Mon, 19 Oct 2015 18:58:20 +0000 (18:58 +0000)]
including <ohash.h> requires including <stdint.h> beforehand;
noticed by Svyatoslav Mishyn <juef at openmailbox dot org>

9 years agopledge "stdio exec proc" early on, setpriority, then pledge "stdio exec"
deraadt [Mon, 19 Oct 2015 18:53:35 +0000 (18:53 +0000)]
pledge "stdio exec proc" early on, setpriority, then pledge "stdio exec"
from Theo Buehler

9 years agofree rbio before wbio
beck [Mon, 19 Oct 2015 17:59:39 +0000 (17:59 +0000)]
free rbio before wbio
ok jsing@

9 years agomissing deref on char check. from David Binderman
tedu [Mon, 19 Oct 2015 17:24:07 +0000 (17:24 +0000)]
missing deref on char check. from David Binderman

9 years agoRemove the define NOT, replace it with '!'. No binary change.
mmcc [Mon, 19 Oct 2015 17:15:53 +0000 (17:15 +0000)]
Remove the define NOT, replace it with '!'. No binary change.

"The ^ is used in regular expressions and many versions of fnmatch(3)
accept both ! and ^. However, we are never going to accept ^ instead of
! so I think this makes sense" -millert@

"go for it" -nicm@

9 years agoA little style(9) for sh.h includes
mmcc [Mon, 19 Oct 2015 17:10:53 +0000 (17:10 +0000)]
A little style(9) for sh.h includes

ok nicm@

9 years agoStop supporing "legcay" time formats that OpenSSL supports. Rewrite the
beck [Mon, 19 Oct 2015 16:32:37 +0000 (16:32 +0000)]
Stop supporing "legcay" time formats that OpenSSL supports. Rewrite the
utctime and gentime wrappers accordingly. Along with some other cleanup.
this also removes the need for timegm.
ok bcook@ sthen@ jsing@

9 years agoChange regress to not believe legacy times are valid
beck [Mon, 19 Oct 2015 16:29:22 +0000 (16:29 +0000)]
Change regress to not believe legacy times are valid

9 years agoAllow setpriority in "proc" as well, since a few shells have "nice"
deraadt [Mon, 19 Oct 2015 16:20:56 +0000 (16:20 +0000)]
Allow setpriority in "proc" as well, since a few shells have "nice"
builtin.  make a note that setpriority() should be weakened, unless "id"
is also present.
pointed out by Theo Buehler

9 years agoMove stddef.h include from sh.h to the file that uses it.
mmcc [Mon, 19 Oct 2015 14:43:46 +0000 (14:43 +0000)]
Move stddef.h include from sh.h to the file that uses it.

ok nicm@

9 years agoMove string.h include from sh.h to the files that use it.
mmcc [Mon, 19 Oct 2015 14:42:16 +0000 (14:42 +0000)]
Move string.h include from sh.h to the files that use it.

ok nicm@

9 years agofix memory leaks in error paths
jsg [Mon, 19 Oct 2015 14:15:59 +0000 (14:15 +0000)]
fix memory leaks in error paths
ok renato@

9 years agoRevert transfer submission to r1.85. Seems to make okan@'s scanner
mpi [Mon, 19 Oct 2015 14:05:01 +0000 (14:05 +0000)]
Revert transfer submission to r1.85.  Seems to make okan@'s scanner
work properly.

9 years agoMove limits.h include from sh.h to the files that actually need it. No
mmcc [Mon, 19 Oct 2015 14:03:21 +0000 (14:03 +0000)]
Move limits.h include from sh.h to the files that actually need it. No
binary change.

ok nicm@

9 years agoMore removal of EXTERN.
mmcc [Mon, 19 Oct 2015 14:01:37 +0000 (14:01 +0000)]
More removal of EXTERN.

ok nicm@

9 years agoPrint vnode type for sendfd/recvfd not file type, ok semarie
nicm [Mon, 19 Oct 2015 12:55:32 +0000 (12:55 +0000)]
Print vnode type for sendfd/recvfd not file type, ok semarie

9 years agoStop checking for RTF_UP directly, call rtisvalid(9) instead.
mpi [Mon, 19 Oct 2015 12:11:28 +0000 (12:11 +0000)]
Stop checking for RTF_UP directly, call rtisvalid(9) instead.

While here add two missing ``rtableid'' checks in in6_selectsrc().

ok bluhm@

9 years agoStop checking for RTF_UP directly, call rtisvalid(9) instead.
mpi [Mon, 19 Oct 2015 12:10:05 +0000 (12:10 +0000)]
Stop checking for RTF_UP directly, call rtisvalid(9) instead.

While here add a missing ``rtableid'' check in in_selectsrc().

ok bluhm@

9 years agoSync rtisvalid(9) check for local route entries with r1.257 of
mpi [Mon, 19 Oct 2015 12:02:11 +0000 (12:02 +0000)]
Sync rtisvalid(9) check for local route entries with r1.257 of
net/ip_input.c

9 years agoRemove superfluous NULL checks.
mpi [Mon, 19 Oct 2015 11:59:26 +0000 (11:59 +0000)]
Remove superfluous NULL checks.

ifa are refcounted to ensure that rt_ifa is always valid.

9 years agooptarg and optind are declared by unistd.h
jca [Mon, 19 Oct 2015 11:52:51 +0000 (11:52 +0000)]
optarg and optind are declared by unistd.h

9 years agoAdd err.h, missing after pledge() introduction.
jca [Mon, 19 Oct 2015 11:51:17 +0000 (11:51 +0000)]
Add err.h, missing after pledge() introduction.

9 years agoFix control_imsg_forward() by changing imsg_compose() to
reyk [Mon, 19 Oct 2015 11:27:35 +0000 (11:27 +0000)]
Fix control_imsg_forward() by changing imsg_compose() to
imsg_compose_event().  This was done by pyr@ in relayd/control.c
-r1.32 (2009/06/05, ok eric@) but somehow didn't slip into other
daemons that imported control.c.

9 years agoRemove the ikev1 stub - Since I started iked, it has an empty privsep
reyk [Mon, 19 Oct 2015 11:25:35 +0000 (11:25 +0000)]
Remove the ikev1 stub - Since I started iked, it has an empty privsep
process for ISAKMP+IKEv1.  I kept it to let somebody either contribute
the old protocol one day, I never intended to implement IKEv1 myself,
or to add a new kind of pipe to isakmpd to hand off IKEv1 messages.
As IKEv2 is widely supported by all major OS and networking vendors
now, I'm happy to scrap the idea of supporting ISAKMP+IKEv1.  It is
still possible to use isakmpd for legacy VPNs.

OK mikeb@

9 years agoRemove a duplicated '#include <stdio.h>' line.
yasuoka [Mon, 19 Oct 2015 09:47:37 +0000 (09:47 +0000)]
Remove a duplicated '#include <stdio.h>' line.

9 years agoFix control_imsg_forward() by changing imsg_compose() to
reyk [Mon, 19 Oct 2015 09:32:51 +0000 (09:32 +0000)]
Fix control_imsg_forward() by changing imsg_compose() to
imsg_compose_event().  This was done by pyr@'s in relayd/control.c
-r1.32 (2009/06/05, ok eric@) but somehow didn't slip into other
daemons that imported control.c.

9 years agoPrint control socket client fd in debug message to differentiate between
reyk [Mon, 19 Oct 2015 09:17:23 +0000 (09:17 +0000)]
Print control socket client fd in debug message to differentiate between
control connections.  Helps to debug problems.

9 years agoKill whitespace at eol.
sunil [Mon, 19 Oct 2015 09:15:35 +0000 (09:15 +0000)]
Kill whitespace at eol.

Ok gilles@

9 years agodeduplicate in[6]_pcbbind() port scan loop.
vgross [Mon, 19 Oct 2015 08:49:13 +0000 (08:49 +0000)]
deduplicate in[6]_pcbbind() port scan loop.

ok mpi@

9 years agoAvoid a NULL dereference when getgrnam_r() returns NULL for `result'.
yasuoka [Mon, 19 Oct 2015 07:58:28 +0000 (07:58 +0000)]
Avoid a NULL dereference when getgrnam_r() returns NULL for `result'.

9 years agoUpdate etc/mtree/BSD.x11.dist (freetype-2.6.1)
dcoppa [Mon, 19 Oct 2015 07:55:31 +0000 (07:55 +0000)]
Update etc/mtree/BSD.x11.dist (freetype-2.6.1)

9 years agoCall tzset() before dropping the priviledge to use correct timezone.
yasuoka [Mon, 19 Oct 2015 07:18:31 +0000 (07:18 +0000)]
Call tzset() before dropping the priviledge to use correct timezone.

9 years agoCan't assert "module->fd >= 0" in radiusd_stop() since the module may
yasuoka [Mon, 19 Oct 2015 06:56:58 +0000 (06:56 +0000)]
Can't assert "module->fd >= 0" in radiusd_stop() since the module may
be closed already when error.

9 years agoMove bge rxeof and txeof outside the kernel lock.
jmatthew [Mon, 19 Oct 2015 05:31:25 +0000 (05:31 +0000)]
Move bge rxeof and txeof outside the kernel lock.
To make rxeof safe, use a separate ring refill timeout for each ring.
We activate the refill timeout for a ring when it's too empty to receive
packets, which ensures we won't attempt to refill it from interrupt context.

To make txeof safe, remove the list of dma maps and just allocate maps based on
the ring slots occupied by the packet, and use atomic operations to adjust
bge_txcnt.  Rework some parts of the txeof and start loops so that we only
adjust bge_txcnt after exiting the loop, and only take actions such as setting
or clearing OACTIVE based on the final value.

tested on 5703, 5714, 5721 by me, 5753 by semarie@, 5761 by naddy@, and
also in snapshots for a while
ok mpi@, dlg@

9 years agoApply style(9) to header includes.
mmcc [Mon, 19 Oct 2015 02:15:45 +0000 (02:15 +0000)]
Apply style(9) to header includes.

ok nicm@

9 years agoNeed <string.h> for memset()
guenther [Sun, 18 Oct 2015 23:27:43 +0000 (23:27 +0000)]
Need <string.h> for memset()

9 years agopledge bgplg(8).
benno [Sun, 18 Oct 2015 22:37:30 +0000 (22:37 +0000)]
pledge bgplg(8).
ok deraadt

9 years agoFinish first round of rework of the rc script.
rpe [Sun, 18 Oct 2015 21:33:18 +0000 (21:33 +0000)]
Finish first round of rework of the rc script.

OK krw@ halex@

9 years agoPass current directory as a string rather than a file descriptor because
nicm [Sun, 18 Oct 2015 20:42:42 +0000 (20:42 +0000)]
Pass current directory as a string rather than a file descriptor because
pledge doesn't let us pass directory file descriptors.

9 years agoThe change of 5.7's sys/arch/i386/i386/bus_space.c and
uaa [Sun, 18 Oct 2015 20:24:10 +0000 (20:24 +0000)]
The change of 5.7's sys/arch/i386/i386/bus_space.c and
sys/arch/i386/include/bus.h invokes the kernel crash at boot
when ignored (disabled) channel is detected.

In all ATA controllers, ignored (disabled) channel is still set cp->hwok = 1.
And pciide_mapregs_native() is not called, wdc_cp->cmd_iot is 0.

5.6 and before, cmd_iot = 0 is treated as I386_BUS_SPACE_IO,
so there is no problem to call bus_space_read_1() in wdcintr().

5.7 and after, cmd_iot is used as function pointer.
We have to initialize it with pciide_mapregs_native() or something,
otherwise set cp->hwok = 0 to prevent calling wdcintr().

When ignored (disabled) channel is found, default_chip_map() should set
cp->hwok = 0. So all controllers do same thing.

ok by deraadt@

9 years agoInstead of fragile CMSG parsing, control pledge "sendfd" and "recvfd"
deraadt [Sun, 18 Oct 2015 20:15:10 +0000 (20:15 +0000)]
Instead of fragile CMSG parsing, control pledge "sendfd" and "recvfd"
in unp_internalize and unp_externalize.
ok kettenis guenther

9 years agoPull in <float.h> instead of declaring __flt_rounds() locally
guenther [Sun, 18 Oct 2015 19:30:39 +0000 (19:30 +0000)]
Pull in <float.h> instead of declaring __flt_rounds() locally

ok miod@ jsg@

9 years agofix lmtp delivery regressions introduced in previous:
jung [Sun, 18 Oct 2015 18:59:51 +0000 (18:59 +0000)]
fix lmtp delivery regressions introduced in previous:

- strip \r\n and add them explicitly to all DATA lines
- fix DATA termination
- add missing QUIT command (and check for reply)
- remove free() and fclose() and use exit(3) instead of _exit(2)
  to handle cleanup

ok sunil gilles

9 years agoMove more EXTERN-defined globals from sh.h.
mmcc [Sun, 18 Oct 2015 18:05:35 +0000 (18:05 +0000)]
Move more EXTERN-defined globals from sh.h.

ok nicm@

9 years agoBackport another Broadwell fix from Linux 3.15
kettenis [Sun, 18 Oct 2015 18:00:45 +0000 (18:00 +0000)]
Backport another Broadwell fix from Linux 3.15

Ben Widawsky
drm/i915: Provide PDP updates via MMIO
e178f7057b81c87a7ceaae0ca204487b6f7eedcf

Doesn't make resume work, but at least it prevents the machine from hanging
and/or resetting.

9 years agoUse "getpw" rather than "flock", per deraadt@'s suggestion.
miod [Sun, 18 Oct 2015 17:53:51 +0000 (17:53 +0000)]
Use "getpw" rather than "flock", per deraadt@'s suggestion.

9 years agoAvoid integer overflow with very large files.
tobias [Sun, 18 Oct 2015 17:32:22 +0000 (17:32 +0000)]
Avoid integer overflow with very large files.

ok millert

9 years agoFix comments.
rpe [Sun, 18 Oct 2015 17:24:25 +0000 (17:24 +0000)]
Fix comments.

OK krw@

9 years agopledge+=flock, for /var/run/ypbind.lock. ok semarie@
miod [Sun, 18 Oct 2015 17:20:49 +0000 (17:20 +0000)]
pledge+=flock, for /var/run/ypbind.lock. ok semarie@

9 years agoDo not warn for sort -o if we can't chown the output temporary file
millert [Sun, 18 Oct 2015 17:02:03 +0000 (17:02 +0000)]
Do not warn for sort -o if we can't chown the output temporary file
to match the owner of the output file.

9 years agoAdd "id" pledge to syslogd privsep process. Needed for logging to pipe.
bluhm [Sun, 18 Oct 2015 16:35:06 +0000 (16:35 +0000)]
Add "id" pledge to syslogd privsep process.  Needed for logging to pipe.
OK deraadt@

9 years agoMake use of pledge(2); initial diff from deraadt@
jca [Sun, 18 Oct 2015 16:11:19 +0000 (16:11 +0000)]
Make use of pledge(2); initial diff from deraadt@

As Theo says, there's probably room for stricter pledge requests, but
this would involve refactoring.

9 years agoactually, it uses getaddrinfo
deraadt [Sun, 18 Oct 2015 15:28:03 +0000 (15:28 +0000)]
actually, it uses getaddrinfo

9 years agolibc DNS functions will now use the new dnssocket() / dnsconnect()
deraadt [Sun, 18 Oct 2015 15:15:00 +0000 (15:15 +0000)]
libc DNS functions will now use the new dnssocket() / dnsconnect()
system calls.  These signal to the pledge kernel code that a DNS
transaction is happening.  These special sockets only work well with
port 53 (there are some cute plans...).
Programs calling pledge "inet" will not work! You need pledge "dns",

and of course, you need a fairly fresh kernel.

ok guenther kettenis tedu

9 years agoTweak previous: call fatal(), not err(3), for consistency. err.h goes away.
jca [Sun, 18 Oct 2015 14:35:36 +0000 (14:35 +0000)]
Tweak previous: call fatal(), not err(3), for consistency. err.h goes away.

9 years agoregress pledge: test kill()
semarie [Sun, 18 Oct 2015 13:01:40 +0000 (13:01 +0000)]
regress pledge: test kill()

since "inet" has PLEDGE_SELF, and now calling kill() to self is permitted with PLEDGE_SELF, try this with "fattr"

9 years agoregress pledge: remove cmsg
semarie [Sun, 18 Oct 2015 12:54:25 +0000 (12:54 +0000)]
regress pledge: remove cmsg

it has no sens to keep it.

9 years agoregress pledge: cpath test
semarie [Sun, 18 Oct 2015 12:53:32 +0000 (12:53 +0000)]
regress pledge: cpath test

you need to read the directory before creating something in. add rpath

9 years agoregress pledge: cmsg is deprecated
semarie [Sun, 18 Oct 2015 12:26:21 +0000 (12:26 +0000)]
regress pledge: cmsg is deprecated

9 years agoregress pledge: tweak a bit the manner to grab hte syscall number
semarie [Sun, 18 Oct 2015 12:25:33 +0000 (12:25 +0000)]
regress pledge: tweak a bit the manner to grab hte syscall number

permit debug string be present on the line

9 years agoNeed native-pledge for id.
doug [Sun, 18 Oct 2015 11:27:17 +0000 (11:27 +0000)]
Need native-pledge for id.

9 years agold.so no longer needs or uses a bind lock, so stop setting it. This
guenther [Sun, 18 Oct 2015 08:02:58 +0000 (08:02 +0000)]
ld.so no longer needs or uses a bind lock, so stop setting it.  This
eliminates a chunk of complexity from the libpthread init and the fork
wrapper, as it was the bind lock that needed prebinding before use.

9 years agoTadpole/Sun Voyager IIi reported to work via dmesg@
jsg [Sun, 18 Oct 2015 07:09:44 +0000 (07:09 +0000)]
Tadpole/Sun Voyager IIi reported to work via dmesg@

9 years agomove SS_DNS socket check from kern_plegde.c to sys_generic.c
semarie [Sun, 18 Oct 2015 05:26:55 +0000 (05:26 +0000)]
move SS_DNS socket check from kern_plegde.c to sys_generic.c

this check has nothing to do with pledge(2). make it lives in sys_ioctl() call.

while here, move the (fp == NULL) check early and remove duplicate check from
pledge_ioctl_check().

ok guenther@ deraadt@

9 years agoUse offsetof() instead of adding the sizes of the preceeding struct members
guenther [Sun, 18 Oct 2015 05:03:22 +0000 (05:03 +0000)]
Use offsetof() instead of adding the sizes of the preceeding struct members

ok millert@

9 years agoMake sure sm_rotate_bak() is only run once.
ajacoutot [Sun, 18 Oct 2015 04:45:21 +0000 (04:45 +0000)]
Make sure sm_rotate_bak() is only run once.

9 years agogetting sloppy, lost a }
deraadt [Sun, 18 Oct 2015 04:21:39 +0000 (04:21 +0000)]
getting sloppy, lost a }

9 years agosorry, sdiff -o interactive mode does another spawn
deraadt [Sun, 18 Oct 2015 04:18:41 +0000 (04:18 +0000)]
sorry, sdiff -o interactive mode does another spawn

9 years agoAdd "dns" to the pledges. Previously these worked because of "inet",
deraadt [Sun, 18 Oct 2015 03:54:22 +0000 (03:54 +0000)]
Add "dns" to the pledges.  Previously these worked because of "inet",
alas "dns" is now a mandatory statement if you want to do dns!

9 years agoForcibly delete /var/run/ypbind.lock to prepare for the worst cases.
deraadt [Sun, 18 Oct 2015 03:51:11 +0000 (03:51 +0000)]
Forcibly delete /var/run/ypbind.lock to prepare for the worst cases.
ok aja

9 years agounrelated commit; not ready yet
deraadt [Sun, 18 Oct 2015 03:41:14 +0000 (03:41 +0000)]
unrelated commit; not ready yet

9 years agoFirst casualty of making pledge "dns" mandatory for dns users.
deraadt [Sun, 18 Oct 2015 03:39:37 +0000 (03:39 +0000)]
First casualty of making pledge "dns" mandatory for dns users.
"dns" was missing, and this was relying on "inet" support..

9 years agoMove your drink further away... When a program pledged "getpw" fails to
deraadt [Sun, 18 Oct 2015 03:30:01 +0000 (03:30 +0000)]
Move your drink further away...  When a program pledged "getpw" fails to
get a response from a YP server, it will open "/dev/tty" and spit out:
    'YP server for domain %s not responding, still trying'
For now allow open of /dev/tty for "getpw".  I hope to re-architect the
libc:YP communication protocol (strategy similar to syslog->sendsyslog,
isatty->fcntl, dnssocket/dnsconnect) and then we can reevaluate this.

9 years agoafter kmem is open and setup, pledge "stdio rpath wpath cpath"
deraadt [Sun, 18 Oct 2015 03:17:48 +0000 (03:17 +0000)]
after kmem is open and setup, pledge "stdio rpath wpath cpath"
seems to be working.  commiting to get feedback from people who crash.

9 years agoCollapse some strange programmer style with too much abstraction.
deraadt [Sun, 18 Oct 2015 03:13:07 +0000 (03:13 +0000)]
Collapse some strange programmer style with too much abstraction.

9 years agoWith TIOCSTI supported in pledge "tty proc", csh is good enough to run
deraadt [Sun, 18 Oct 2015 03:09:11 +0000 (03:09 +0000)]
With TIOCSTI supported in pledge "tty proc", csh is good enough to run
with pledge "stdio rpath wpath cpath fattr getpw proc exec tty".  (Note
that ksh "emacs mode" is also a abus^Wconsumer of TIOCSTI, but we had
let that slide for a week since noone uses it...)

9 years agoA whole buncha unsigned char casts for ctype function arguments.
mmcc [Sun, 18 Oct 2015 03:04:11 +0000 (03:04 +0000)]
A whole buncha unsigned char casts for ctype function arguments.

ok guenther@

9 years agoUse explicit_bzero() when the memory is freed directly afterward.
mmcc [Sun, 18 Oct 2015 02:39:04 +0000 (02:39 +0000)]
Use explicit_bzero() when the memory is freed directly afterward.

ok deraadt@

9 years agoUse explicit_bzero() when the memory is freed directly afterward.
mmcc [Sun, 18 Oct 2015 02:30:53 +0000 (02:30 +0000)]
Use explicit_bzero() when the memory is freed directly afterward.

ok deraadt@

9 years agoTIOCSTI and TIOCSCTTY; oops got the condition backwards.
deraadt [Sun, 18 Oct 2015 01:53:31 +0000 (01:53 +0000)]
TIOCSTI and TIOCSCTTY; oops got the condition backwards.

9 years agobetter placement for dnssocket/dnsconnect
deraadt [Sun, 18 Oct 2015 01:45:48 +0000 (01:45 +0000)]
better placement for dnssocket/dnsconnect

9 years agoDescribe dnssocket / dnsconnect arguments
deraadt [Sun, 18 Oct 2015 01:32:05 +0000 (01:32 +0000)]
Describe dnssocket / dnsconnect arguments

9 years agoAllow read/write access to /dev/tty when using "tty" pledge.
doug [Sun, 18 Oct 2015 01:07:19 +0000 (01:07 +0000)]
Allow read/write access to /dev/tty when using "tty" pledge.

Without this change, you need "rpath" and "wpath" to open /dev/tty.  Some
applications explicitly open /dev/tty, but deraadt@ found the most
common use is indirectly via readpassphrase().

tweak and ok deraadt@
pre-tweak ok millert@, semarie@

9 years agocreate libc stubs for dnssocket() and dnsconnect()
deraadt [Sun, 18 Oct 2015 00:36:20 +0000 (00:36 +0000)]
create libc stubs for dnssocket() and dnsconnect()

9 years agosync
deraadt [Sun, 18 Oct 2015 00:05:59 +0000 (00:05 +0000)]
sync

9 years agoAdd two new system calls: dnssocket() and dnsconnect(). This creates a
deraadt [Sun, 18 Oct 2015 00:04:43 +0000 (00:04 +0000)]
Add two new system calls: dnssocket() and dnsconnect().  This creates a
SS_DNS tagged socket which has limited functionality (for example, you
cannot accept on them...)  The libc resolver will switch to using these,
therefore pledge can identify a DNS transaction better.
ok tedu guenther kettenis beck and others

9 years agonaddy asks me if __tfork should be allowed by "proc". yes!
deraadt [Sat, 17 Oct 2015 23:50:04 +0000 (23:50 +0000)]
naddy asks me if __tfork should be allowed by "proc".  yes!
We may need a better semantic later ("thread"?), but this allows
progress, and people can report their experiences.

9 years agoconnect() to an AF_UNIX socket is really read/write, so tell pledge this
deraadt [Sat, 17 Oct 2015 23:15:10 +0000 (23:15 +0000)]
connect() to an AF_UNIX socket is really read/write, so tell pledge this
is a RPATH|WPATH operation.
Discussed with doug and millert

9 years agoAllow the nasty ioctl TIOCSTI in "tty", but also require the "proc"
deraadt [Sat, 17 Oct 2015 23:12:46 +0000 (23:12 +0000)]
Allow the nasty ioctl TIOCSTI in "tty", but also require the "proc"
permission.  For now, we'll tighten it down further later.

9 years agobetter wording in a comment
deraadt [Sat, 17 Oct 2015 23:04:06 +0000 (23:04 +0000)]
better wording in a comment

9 years agoUnify TIOCGPGRP/TIOCGWINSZ/TIOCGWINSZ behaviour regarding ENOTTY return.
deraadt [Sat, 17 Oct 2015 23:01:37 +0000 (23:01 +0000)]
Unify TIOCGPGRP/TIOCGWINSZ/TIOCGWINSZ behaviour regarding ENOTTY return.
(both "tty" and "ioctl" allow these; they should behave the same)

9 years agoAllow TIOCSCTTY on tty devices, if the pledge says "tty id"
deraadt [Sat, 17 Oct 2015 22:58:30 +0000 (22:58 +0000)]
Allow TIOCSCTTY on tty devices, if the pledge says "tty id"
worked out with nicm

9 years agowhitespace
deraadt [Sat, 17 Oct 2015 22:54:23 +0000 (22:54 +0000)]
whitespace

9 years agoRename SYSEXIT() to SYSCALL_END() for consistency with most other archs.
guenther [Sat, 17 Oct 2015 22:40:54 +0000 (22:40 +0000)]
Rename SYSEXIT() to SYSCALL_END() for consistency with most other archs.
No change in resulting object files

ok millert@

9 years agomailaddr_match() allows comparing two struct mailaddr taking into account
gilles [Sat, 17 Oct 2015 22:24:36 +0000 (22:24 +0000)]
mailaddr_match() allows comparing two struct mailaddr taking into account
catchall and +-tags

ok millert@ and jung@ for util.c

9 years agoMove the last of the __DBINTERFACE_PRIVATE bits from <db.h> to libc's wrapper
guenther [Sat, 17 Oct 2015 21:48:42 +0000 (21:48 +0000)]
Move the last of the __DBINTERFACE_PRIVATE bits from <db.h> to libc's wrapper
and eliminate the now superfluous -D option

ok kettenis@ millert@

9 years agoFix the code that sets up the MCH BAR on systems where the (buggy) BIOS
kettenis [Sat, 17 Oct 2015 21:41:12 +0000 (21:41 +0000)]
Fix the code that sets up the MCH BAR on systems where the (buggy) BIOS
doesn't do this for us.  The code was poking registers on the wrong PCI
device.  We were just lucky that it worked on most systems.

This should fix machines such as the Asus EeePC 701 and get rid of the

error: [drm:pid0:i915_gem_detect_bit_6_swizzle] *ERROR* Couldn't read from
MC HBAR.  Disabling tiling.

messages on that machine.

9 years agoTighten pledge: We only write to stdio and never to any files if
naddy [Sat, 17 Oct 2015 21:34:07 +0000 (21:34 +0000)]
Tighten pledge: We only write to stdio and never to any files if
in cat mode (-c, zcat), or in test mode (-t), or if there are no
file arguments and there is no -o outfile.  Due to fts(3) we require
rpath even for compress <in >out.

"seems sound" deraadt@