256226 Commits

Author SHA1 Message Date
jakllsch
1c151164e6 remove unused softc variables 2018-01-30 19:13:08 +00:00
maxv
4e9bde34d6 Style, localify, remove dead code, and fix typos. No functional change. 2018-01-30 15:54:02 +00:00
maxv
5b47e99add Kick nested fragments. 2018-01-30 15:35:31 +00:00
shm
bfb29ad1d2 Fixed memory leak (CID: 977744) 2018-01-30 15:28:39 +00:00
maxv
71ad96023a Fix a buffer overflow in ip6_get_prevhdr. Doing
mtod(m, char *) + len

is wrong, an option is allowed to be located in another mbuf of the chain.
If the offset of an option within the chain is bigger than the length of
the first mbuf in that chain, we are reading/writing one byte of packet-
controlled data beyond the end of the first mbuf.

The length of this first mbuf depends on the layout the network driver
chose. In the most difficult case, it will allocate a 2KB cluster, which
is bigger than the Ethernet MTU.

But there is at least one way of exploiting this case: by sending a
special combination of nested IPv6 fragments, the packet can control a
good bunch of 'len'. By luck, the memory pool containing clusters does not
embed the pool header in front of the items, so it is not straightforward
to predict what is located at 'mtod(m, char *) + len'.

However, by sending offending fragments in a loop, it is possible to
crash the kernel - at some point we will hit important data structures.

As far as I can tell, PF protects against this difficult case, because
it kicks nested fragments. NPF does not protect against this. IPF I don't
know.

Then there are the more easy cases, if the MTU is bigger than a cluster,
or if the network driver did not allocate a cluster, or perhaps if the
fragments are received via a tunnel; I haven't investigated these cases.

Change ip6_get_prevhdr so that it returns an offset in the chain, and
always use IP6_EXTHDR_GET to get a writable pointer. IP6_EXTHDR_GET
leaves M_PKTHDR untouched.

This place is still fragile.
2018-01-30 14:49:25 +00:00
shm
442208c9a6 Fixed potential NULL pointer dereference (CID: 978477) 2018-01-30 13:11:28 +00:00
ozaki-r
cd3ab682fe Check if a queued work is tried to be enqueued again, which is not allowed 2018-01-30 11:03:06 +00:00
ozaki-r
af8d700fee Prevent rt_free_global.wk from being enqueued to workqueue doubly 2018-01-30 11:01:04 +00:00
ozaki-r
ad8c8ec2d4 Destroy ifq_lock at the end of if_detach
It still can be used in if_detach.
2018-01-30 10:40:02 +00:00
msaitoh
2e5c0cccf8 Avoid panic while detaching xhci. The xhci driver has both sc_child and
sc_child2 but xhci_childdet() only supported sc_child. OK'd by Nick.
2018-01-30 08:53:39 +00:00
knakahara
24a29a67de Make wm(4) watchdog MP-safe. There is almost no influence on performance.
wm(4) does not use ifp->if_watchdog now, that is, it does not touch
ifp->if_timer.
It also uses own callout(wm_tick) as watchdog now. The watchdog uses
per-queue counter to check timeout. So, global lock is not required.
2018-01-30 08:15:47 +00:00
ozaki-r
8812081aa6 Apply C99-style struct initialization to syncobj_t 2018-01-30 07:52:22 +00:00
christos
81afadce96 more cleanup (don't allow oldlenp == NULL) 2018-01-29 19:51:15 +00:00
macallan
aac882f162 remove some leftover references to ki2c in comments
no functional change
2018-01-29 19:33:39 +00:00
martin
a9abe48acc Cosmetics: fix the order of calloc() arguments. 2018-01-29 16:24:23 +00:00
sevan
9663b966f1 Drop commended out include to a hardcoded path in root's home directory. 2018-01-29 15:48:50 +00:00
roy
2fd46612ee Note import of dhcpcd-7.0.1 2018-01-29 11:14:12 +00:00
roy
d20bb8f953 Sync 2018-01-29 11:13:06 +00:00
roy
10383d8fc1 Import dhcpcd-7.0.1 with the following changes:
*  hooks: remove use of local builtin for better portability
*  dhcpcd: don't log errors working out carrier for departed interfaces
*  ipv4: allow configuration of static broadcast address
*  if: don't set MTU during interface discovery
*  if: don't activate non matching interfaces to commandline ones
*  eloop-bench: fix hangs when using a large number of cycles
*  dhcp: don't bind when we've just probed an address to inform
2018-01-29 11:11:22 +00:00
maxv
6f5024f576 Start cleaning up ip6_input.c. Several pieces of code have evolved but
their neighboring comments were not updated. So update them, and remove
code that has been disabled for years (it has no use anyway).
2018-01-29 10:57:13 +00:00
maxv
6163bade20 Style, and use __cacheline_aligned.
By the way, it would be nice to revisit the use of 'ip6flow_lock' in
ip6flow_fastforward(): it is taken right away because of 'ip6flow_inuse',
but then we perform several checks that do not require it.
2018-01-29 08:27:10 +00:00
maxv
90dd9967f8 style 2018-01-29 08:17:18 +00:00
maxv
a7c056383d Fix two pretty bad mistakes. If ipsec6_check_policy fails m is not freed,
and a 'goto out' is missing after ipsec6_process_packet.
2018-01-29 08:14:54 +00:00
knakahara
f7d67ad1e7 Fix unmatched return type. The return value of wm_txeof() is not useded yet. 2018-01-29 04:17:32 +00:00
pgoyette
b418119fb8 One more from christos@
No need to initialize fill_func
2018-01-29 03:42:53 +00:00
knakahara
8e6c9b23cd Fix if_wm.c:r1.557 merge miss, sorry. 2018-01-29 03:42:30 +00:00
pgoyette
eea2cd6dc9 More simplification, this time from ozaki-r@
No need to break after return.
2018-01-29 03:35:23 +00:00
pgoyette
ce7078ed7c Simplify, from christos@ 2018-01-29 03:29:26 +00:00
pgoyette
3bf8ebadfd Use existing fill_[pd]rlist() functions to calculate size of buffer to
allocate, rather than relying on an arbitrary length passed in from
userland.

Allow copyout() of partial results if the user buffer is too small, to
be consistent with the way sysctl(3) is documented.

Garbage-collect now-unused third parrameter in the fill_[pd]rlist()
functions.

As discussed on IRC.
OK kamil@ and christos@

XXX Needs pull-up to netbsd-8 branch.
2018-01-29 02:02:14 +00:00
christos
96bd66bcf0 - don't return ENOMEM for errors not related to memory
- don't overload return values (-error/+size)
- don't allocate kernel memory from user supplied length.
2018-01-28 22:24:58 +00:00
jmcneill
8982bc4889 Enable CPU frequency scaling and thermal sensors. 2018-01-28 18:31:41 +00:00
jmcneill
42d0ff1a1f Add support for H5 simple framebuffer, CPUX clocks, R_I2C controller, SID
controller, and thermal sensors.
2018-01-28 18:31:15 +00:00
jmcneill
fdc625b412 Add support for H5 CPU and GPU thermal sensors. 2018-01-28 18:24:50 +00:00
jmcneill
ebac5eb903 Allow set_voltage/get_voltage to succeed on a fixed regulator so long as
the requested range overlaps with the fixed rate defined in the devicetree.
2018-01-28 18:21:52 +00:00
mlelstv
6703d1a248 Compute Core/SMT-IDs for AMD family 17h (Ryzen). 2018-01-28 16:32:43 +00:00
mlelstv
71d727f251 CPUID tells the ApicIdCoreIdSize in bits. 2018-01-28 16:15:41 +00:00
christos
01bc43e387 add an annotation. 2018-01-28 16:12:41 +00:00
christos
05b75fe4b1 CID-1428639: make sure we always initialiaze hash, because if ultimately
the file is not found and we end up looping we need them.
2018-01-28 15:48:44 +00:00
mlelstv
eb468dc1b1 Check for undefined behaviour when doing right-shift. 2018-01-28 15:00:42 +00:00
maya
c66c60f8a9 Fix copy paste error. from coverity. 2018-01-28 14:34:26 +00:00
jmcneill
62477eae66 Don't print an error when we find a CIS tuple code in the vendor-unique
range (80h-8Fh).
2018-01-28 14:34:06 +00:00
tsutsui
57fdeaadbc Replace CRTC register values with ones taken from sys/dev/ic/vga_subr.c.
This fixes noise around column 3 and 4 and makes screen output clearer
on Milan with S3 Trio64V.
2018-01-28 14:22:23 +00:00
maya
501cede865 Use a protocol-agnostic URL (don't degrade HTTPS->HTTP)
Suggested by Travis Paul in PR bin/52958.
2018-01-28 13:37:39 +00:00
hannken
67070b1e36 Prevent use-after-free where genfs_node_destroy() would destroy
a lock residing in the just freed inode data.
2018-01-28 10:02:00 +00:00
hannken
4c6335f141 Make sure inode blocks and size are zero when VOP_INACTIVE()
finalises a now unlinked inode.
Counterpart of the check in ffs_newvnode().
2018-01-28 10:01:18 +00:00
jandberg
e680fc296c Make the console framebuffer visible when polling mode console input is used. 2018-01-28 10:00:31 +00:00
rin
dc26222726 Shrink ramdisk to fit INSTALL kernel within 5MB:
- drop shutdown
- replace disklabel, fsck_ffs, and newfs with stripped-down versions
2018-01-28 01:09:57 +00:00
christos
dcdb6449b4 explain how to allow coverity to use sysroot 2018-01-27 23:59:17 +00:00
chs
807fa9ea1e apply the change from arch/x86/x86/pmap.c rev. 1.266 commitid vZRjvmxG7YTHLOfA:
In pmap_enter_ma(), only try to allocate pves if we might need them,
and even if that fails, only fail the operation if we later discover
that we really do need them.  If we are replacing an existing mapping,
reuse the pv structure where possible.

This implements the requirement that pmap_enter(PMAP_CANFAIL) must not fail
when replacing an existing mapping with the first mapping of a new page,
which is an unintended consequence of the changes from the rmind-uvmplock
branch in 2011.

The problem arises when pmap_enter(PMAP_CANFAIL) is used to replace an existing
pmap mapping with a mapping of a different page (eg. to resolve a copy-on-write).
If that fails and leaves the old pmap entry in place, then UVM won't hold
the right locks when it eventually retries.  This entanglement of the UVM and
pmap locking was done in rmind-uvmplock in order to improve performance,
but it also means that the UVM state and pmap state need to be kept in sync
more than they did before.  It would be possible to handle this in the UVM code
instead of in the pmap code, but these pmap changes improve the handling of
low memory situations in general, and handling this in UVM would be clunky,
so this seemed like the better way to go.

This somewhat indirectly fixes PR 52706 on the remaining platforms where
this problem existed.
2018-01-27 23:07:36 +00:00
pgoyette
6ecfb3c540 Recent changes have increased the number of "things" the bootloader
needs to deal with.  Increase the table size so we don't overflow.
2018-01-27 22:25:23 +00:00