Commit Graph

242482 Commits

Author SHA1 Message Date
christos
931302e025 Turn on MPROTECT on GENERIC and both MPROTECT and ASLR on XEN* 2016-05-14 17:11:30 +00:00
christos
2a096139aa only print debugging info if we are actually going to change the permission. 2016-05-14 17:04:09 +00:00
spz
cb08e2756f .. and don't forget to update doc/3RDPARTY when updating external/* stuff 2016-05-14 14:46:55 +00:00
spz
67c3041c33 merge conflicts, bump shlib version, add expat.pc 2016-05-14 14:39:39 +00:00
spz
8a91d82a35 Import of a new expat version. Upstream Changes:
Release 2.1.1 Sat March 12 2016
        Security fixes:
            #582: CVE-2015-1283 - Multiple integer overflows in XML_GetBuffer

        Bug fixes:
            #502: Fix potential null pointer dereference
            #520: Symbol XML_SetHashSalt was not exported
            Output of "xmlwf -h" was incomplete

        Other changes
            #503: Document behavior of calling XML_SetHashSalt with salt 0
            Minor improvements to man page xmlwf(1)
            Improvements to the experimental CMake build system
            libtool now invoked with --verbose
2016-05-14 14:30:18 +00:00
mlelstv
f3c013cf09 In station mode filter packets that or not for us in case the
interface is in promiscous mode or doesn't filter packets itself.
2016-05-14 13:35:40 +00:00
maxv
b561cb98a5 KNF so it appears aligned on NXR, and fix a comment. 2016-05-14 12:48:31 +00:00
mlelstv
1956fdfb7c All com devices have an issue that they sleep in the final close
when they signal a hangup while still using the device. This allows
a concurrent open to succeed without proper locking because it
only checks the state of the tty layer.

This issue triggers an assertion in ucom due to a reused USB xfer,
but it can also cause misbehaviour in other com devices.

For now in ucom:
- make open block while close is in progress
- also serialize close operations
2016-05-14 10:52:29 +00:00
skrll
2835d51bba #if 0 an assert around rootintr that's no longer correct. root hub
interrupt transfers could do with reworking.
2016-05-14 10:07:52 +00:00
maxv
8f728b8ede Actually, put the NOX identification above. Old CPUs do not support the
cpuid instruction.
2016-05-14 09:51:56 +00:00
maxv
15756d7e09 The NOX bit on large pages does not need to be amd64-specific anymore.
The i386 secondary CPUs can now properly handle it.
2016-05-14 09:37:21 +00:00
skrll
9bdeadfc6e Another locking fix in slhci_roothub_ctrl 2016-05-14 08:52:20 +00:00
maxv
f63de3d1a3 Map rodata and data+bss independently, and give them R and RW with
fillkpt_nox. The code is exactly the same as amd64's.
2016-05-14 08:49:16 +00:00
maxv
e39b2c82ed Define fillkpt_nox on i386, same as amd64.
But there is a difference in the way it is done here. If PAE is not enabled,
PDE_SIZE = 4, so there is no NOX bit set. If PAE is enabled, PDE_SIZE = 8,
so the NOX bit is set.

This works exactly as intended, since NOX does not exist in the non-PAE
case.
2016-05-14 08:39:41 +00:00
maxv
9d6cfafacd Fix the secondary CPUs bug in i386. Same as amd64. 2016-05-14 08:34:00 +00:00
maxv
3b5965adb8 Align the segments on i386. We're going to map them independently. 2016-05-14 08:19:42 +00:00
skrll
b8319f9aea Only set QH CMASK for FS/LS interrupt transfers 2016-05-14 07:14:31 +00:00
maxv
60dc596ebe Define killkpt, and don't use _RELOC. Same as amd64. 2016-05-14 06:49:34 +00:00
kre
cd13213fdd Add another test for the 48875 fix fallout... 2016-05-14 00:33:02 +00:00
palle
f985c2c1eb sun4v: add missing implementation of sun4v_datatrap_tl0 so data_access_fault() is called - mostly from OpenBSD 2016-05-13 21:48:15 +00:00
nakayama
3d642aeb5c Interrupt handlers are now allocated by kmem_zalloc(9), so free
them by kmem_free(9).
2016-05-13 21:24:11 +00:00
nakayama
4cb5a9c6dd Allocate interrupt handlers for clockintr and statintr dynamically. 2016-05-13 21:23:30 +00:00
nakayama
78ba29b05a Use newly introduced intrhand_alloc(). 2016-05-13 21:22:47 +00:00
palle
4b8507f0c9 Fixed typo in comment + reorder parameters for trap debug output to match function prototype for data_access_fault() 2016-05-13 21:21:43 +00:00
nakayama
948555d679 - ci_paddr is always 64-bit.
- intrlev is array of pointer.
- ih_ack is pointer.
2016-05-13 21:21:25 +00:00
christos
f305e57def - make pax aslr stack eat up to 1/8 of the max stack space insted of 1/4
and reduce the length of the randomization bits since this is unused.
- call the pax aslr stack function sooner so we don't need to re-adjust the
  stack size.
- adjust the stack max resource limit to account for the maximum space that
  can be lost by aslr
- tidy up debugging printfs
2016-05-13 17:33:43 +00:00
christos
ea598550c4 clamp getrlimit the same way we clamp setrlimit 2016-05-13 16:54:36 +00:00
christos
4b3392da81 From Bastian Maerkisch, via Igno Schwarze:
Even though section "2.3.3 Information About the History List"
of the history(3) info(1) manual only says

  -- Function: int where_history (void)
     Returns the offset of the current history element.

which maybe isn't completely clear, a plausible implementation
is that the offset returned is the same offset that can be used
for history_set_pos(), i.e. that it is 0 for the oldest entry
and increases with time, and that's how the GNU implementation
behaves indeed.

The libedit implementation, on the other hand, returns 1 for the
newest entry and increases going back in time.
2016-05-13 15:55:59 +00:00
christos
241761204e We now use cpu_intr_p() all the time. 2016-05-13 15:25:57 +00:00
maxv
d0f608b1bb Mention SMEP. 2016-05-13 14:09:38 +00:00
maxv
b9750d0de9 Bring some amd64 swag. No functional changes. 2016-05-13 14:03:00 +00:00
christos
4b31d24b7f From scole_mail:
So here is a patch to get basic ski console output working.  The ski
simulator was decoding the wrong registers in ssccnputc() due to
automagically inlined ssc() which contains a "break" simulated system
call.

The ski loader "skiload" has almost exactly the same inline assembly
call for ssc(), but for whatever reason, (maybe ssc() and
ski_cons_putchar() are in different files?), the ssc() function didn't
get inlined and I/O worked fine.
2016-05-13 13:40:55 +00:00
maxv
d32d8095a7 KNF a little, use C-style comments, and remove susword/fusword. No
functional changes.
2016-05-13 13:24:01 +00:00
pooka
0a4930ca68 mark read_random xfail kern/51135 2016-05-13 13:22:28 +00:00
maxv
2b98d8b4ef Actually, make the NOX part amd64-specific. The secondary CPUs bug is not
yet fixed on i386.
2016-05-13 11:47:02 +00:00
maxv
5d4038a3e2 KNF, so it appears aligned on NXR. 2016-05-13 11:17:20 +00:00
kre
3b5786dccc More fallout from the fix for PR bin/48875 - this one found just by
code reading, rather than any actual real use case failing.

With this script
	f()
	{
		echo hello $1
	}

	exec 3>&1
	echo $(
		for i in a b c
		do
			echo @$i
			f >&3
		done >/tmp/foo
	)
	echo foo= $(cat /tmp/foo)

what should be output is

	hello
	hello
	hello

	foo= @a @b @c

but since the (my) 48875 fix the other day, we've been getting

	hello
	@b
	hello
	@c
	hello

	foo= @a

This fixes that.   I think (hope) this is the last of these fixes...
2016-05-13 10:32:52 +00:00
maxv
d8433c925e Remap the rodata and data+bss segments with large pages on x86. There still
is a bug in the way the text segment is mapped, but I'll see later.
2016-05-13 10:24:42 +00:00
maxv
7c62ff1587 Define __kernel_end. 2016-05-13 10:18:01 +00:00
skrll
c0bc9f43b6 Clarify the intention here after discussing it with soda@ 2016-05-13 07:41:47 +00:00
maxv
f1985d170d Xen therefore uses x86/db_memrw.c, as I suspected. Define __rodata_start
in the Xen ld scripts, so that it can compile. We put the __rodata_start
definition right before __data_start, for it to appear as dead code, since
the rodata segment is not yet mapped independently on Xen.
2016-05-13 05:45:13 +00:00
soda
5407bb6145 - change major number limit for MI devices from 255 to 511,
because twe is already using 332
- clarify that new MI devices should go to this file
  instead of majors.{ws,usb,std,tty,storage}
- fix major number conflict about hdmicec vs tty

OKed by matt@
the expression "previously not MI" is suggested by matt@ too.
2016-05-13 02:00:36 +00:00
sjg
ccfdc94797 Propagate errors from filemon.
If we encounter errors producing a .meta file,
we should not consider the target completed successfully.
2016-05-12 20:28:34 +00:00
skrll
b9dddcf6fe Fix locking in slhci_roothub_ctrl 2016-05-12 18:57:38 +00:00
skrll
11d5fda1b2 Preserve the arm architecture version (if present) 2016-05-12 15:27:54 +00:00
christos
11a32426c3 Avoid taking locks during interrupts and explain why we are doing it this way. 2016-05-12 14:50:39 +00:00
kre
e588572b24 Grunge. I know I fixed this typo before... must have been in a different
couy of the test.
2016-05-12 14:25:11 +00:00
kre
2f35ca415e Verify that questionable characters don't have bad associates.
ok christos@
2016-05-12 13:34:23 +00:00
kre
698541ceb7 More work on file descriptors... This is the copyfd() cleanup.
copyfd() duplicates file descriptors - it used to be widely used,
but these days has seen its popularity dwindle.   Strip it of an
option that ceased to be variable (simplifying code) and cause all
its users to check its result, so it does not need to handle errors
itself (simplifying code further), and make it become a private inernal
routine in redir.c (all callers from other places have switched to a
more modern interface.)  Make sure we error() if N>&N fails (if N is closed.)
2016-05-12 13:31:37 +00:00
kre
f112b7e1a3 Document that a N>&N (or N<&N) redirection turns off close-on-exec for N
(where N is a decimal fd number) either when used as
	some-command N>&N
(where fd N is passed, open, to some-command - which is obviously what is
wanted)

Or as
	exec N>&N
which effects fd N for all future commands.

Note that this means
	exec N>foo N>&N
returns to the old behaviour of leaving the file descriptor open
when commands are run (as do most shells, other than ksh) and works for
both new and old NetBSD shells (old ones never set close-on-exec, and treat
N>&N as a rather meaingless no-op request, and just ignore it), new ones
set close-on-exec on the first redirection, then disable it again on the
second.

Everything here about >& for output fds applies to <& for input ones.

OK christos@
2016-05-12 13:15:43 +00:00