Commit Graph

255869 Commits

Author SHA1 Message Date
maxv d89ae4bbdd Style, and fix two pretty bad mistakes in the crypto functions:
* They call M_PREPEND, but don't pass the updated pointer back to the
   caller.

 * They use memmove on the mbuf data, but they don't ensure that the
   area they touch is contiguous.

This fix is not complete, ieee80211_crypto_encap too needs to pass back
the updated pointer. This will be done in another commit.
2018-01-17 17:41:38 +00:00
mlelstv 0e321d4c9b Track 3rd party firmware in our tree. 2018-01-17 17:22:14 +00:00
maxv a45976c272 Several changes:
* Style in several places, to make the code more readable or easier to
   understand.

 * Instead of checking m->m_pkthdr.len, check m->m_len. m_pkthdr.len is
   the total size of the packet, not the size of the current mbuf (which
   may be smaller).

 * Add a missing length check when handling QoS frames.

 * Cast the lengths passed in IEEE80211_VERIFY_LENGTH to size_t.

 * Remove the length check on scan.sp_xrates, that I added yesterday.
   xrates gets silently truncated in ieee80211_setup_rates().

 * Fix several buffer overflows in the parsers of the MANAGEMENT frames.
2018-01-17 16:03:16 +00:00
sevan 868f3091a0 Note veriexec being enabed by default on macppc port 2018-01-17 13:52:12 +00:00
sevan c86011f6c2 Note fileassoc(9) support is a dependency Veriexec.
Resolves PR kern/52909
2018-01-17 12:49:06 +00:00
sevan a278b65172 Enable veriexec(4) support by default on the macppc port and update the manual to mention it.
Closes PR port-powerpc/52908
2018-01-17 12:41:48 +00:00
uwe c218eec932 Use more semantic markup. 2018-01-17 08:34:15 +00:00
mrg 9bdfc82fe4 fix previous:
CPUFLG_SUN4CACHEBUG was renamed to CACHE_TRAPPAGEBUG and moved
into the cacheinfo.  don't revive the no longer used value, but
fix the non-sun4m code to match cpu.c 1.251.
2018-01-17 07:38:20 +00:00
christos 177e5524a5 make lint compile again. 2018-01-17 06:10:27 +00:00
pgoyette 07275707cd Avoid applying .Dv to the left parenthesis, since it is not applied to
the closing right parenthesis.
2018-01-17 04:31:59 +00:00
christos 2966117648 PR/47615: Dr. W. Stukenbrock: Always zero out the result structs in the
svc procs to avoid returning stale request data to the client.
XXX: pullup-6,7,8
2018-01-17 03:16:10 +00:00
pgoyette 0a18c53300 Don't skip the superfluous "is" argument if it's not superfluous!
This allows us to use `wtf is` and get information for the acronym "is"
and produces the same output as `wtf is is` withough requiring the extra
typing by the user.
2018-01-17 03:03:59 +00:00
maya 6a06635178 document pfil_{add,remove}_ihook, pfil_run_{addr,if}hooks
from ryo shimizu in PR bin/51941

changes by myself: fix mdoc -Tlint, add missing set lists, adjust date
to today, reword history addition.
2018-01-17 02:45:38 +00:00
christos 87dfdf6fcc fix compilation 2018-01-17 02:39:16 +00:00
christos ecc7f0d3c0 rename DCACHE_SIZE to XSCALE_DCACHE_SIZE to avoid conflict with genassym
field offset with the same name.
2018-01-17 02:37:32 +00:00
knakahara 2d5128dc0e Fix duplicated "rxintr" evcnt counting. Pointed out by ozaki-r@n.o, thanks. 2018-01-17 02:16:07 +00:00
kamil 1bcc014257 Revert to commits as they broke few rump tests
"Include namespace.h in a few of libc source files
[...]
    This change finishes elimination of usage of the global name of the
    following symbols:
      - close -> _close
      - execve -> _execve
      - fcntl -> _fcntl
      - setcontext -> _setcontext
      - wait6 -> _wait6
      - write -> _write
      - writev -> _writev"

"Register more syscalls in namespace.h (of libc)

    Add weak symbols for:
     - fcntl
     - close
     - execve
     - setcontext
     - wait6
     - write
     - writev"

These changes broke:

    fs/nfs/t_rquotad:get_nfs_be_1_both
    fs/nfs/t_rquotad:get_nfs_be_1_group
    fs/nfs/t_rquotad:get_nfs_be_1_user
    fs/nfs/t_rquotad:get_nfs_le_1_both
    fs/nfs/t_rquotad:get_nfs_le_1_group
    fs/nfs/t_rquotad:get_nfs_le_1_user
    lib/librumphijack/t_config:fdoff
    lib/librumphijack/t_tcpip:http
    lib/librumphijack/t_tcpip:nfs
    lib/librumphijack/t_vfs:cpcopy
    lib/librumphijack/t_vfs:mv_x
    lib/librumphijack/t_vfs:paxcopy
    net/net/t_forwarding:ipforwarding_fastforward_v4
    net/net/t_forwarding:ipforwarding_fastforward_v6
    net/net/t_forwarding:ipforwarding_fragment_v4
    net/net/t_forwarding:ipforwarding_misc
    net/net/t_mtudisc6:mtudisc6_basic

This revert fixes the failures, except lib/librumphijack/t_vfs.

The original changes were added in order to facilitate a usage of
sanitizers against programs linked with NetBSD's libc. It is no longer
needed, so abandon these changes.

Sponsored by <The NetBSD Foundation>
2018-01-17 01:24:29 +00:00
maya ee3bb8535b Use 0600 as the mode for histfile here too.
pointed out by John D. Baker in PR bin/52480
2018-01-17 00:29:22 +00:00
maya b42dccbff0 Use sysctl -n rather than parse the output.
From Ngie Cooper in PR bin/51870
2018-01-17 00:23:17 +00:00
maya 687000d215 - Add inttypes.h #include for PR* macros.
- close fd when done to prevent leak.
- use correct socket length when calling bind(2).

From Ngie Cooper in PR bin/51870
2018-01-17 00:22:29 +00:00
maya bcc7b2aa78 Improve portability of headers and sort them.
From Ngie Cooper in PR bin/51833
2018-01-17 00:16:43 +00:00
maxv 11a42b5c1a Various fixes: style, remove tiring XXXs, and prevent integer overflow in
ieee80211_setup_rates (normally it already can't happen, because I added a
length check on xrates in ieee80211_recv_mgmt_beacon).
2018-01-16 18:53:32 +00:00
maxv 1df75eef54 Prepend 'sp_' to the name of the fields, so that they can easily be found
via NXR or grep.
2018-01-16 18:42:43 +00:00
maxv 3b005d6b1f Add comments about the length checks, and check xrates. 2018-01-16 16:54:54 +00:00
maxv 1551d983f8 Gather related code. 2018-01-16 16:31:37 +00:00
kre dffed09b47 Attempt to complete previous and allow XEN to compile (as well as link) 2018-01-16 16:24:23 +00:00
maxv 0170309ae1 Style on the new functions. 2018-01-16 16:20:57 +00:00
maxv 82e96ed75b Introduce ieee80211_recv_mgmt_disassoc. 2018-01-16 16:09:30 +00:00
maxv e51554e17b Introduce ieee80211_recv_mgmt_deauth. 2018-01-16 16:04:16 +00:00
maxv 24023c750d Introduce ieee80211_recv_mgmt_assoc_resp. 2018-01-16 16:00:17 +00:00
maxv 6d9e139ff1 Introduce ieee80211_recv_mgmt_assoc_req. 2018-01-16 15:55:14 +00:00
maxv f940273b30 Introduce ieee80211_recv_mgmt_auth. 2018-01-16 15:48:32 +00:00
maxv 85acfa9c16 Start splitting ieee80211_recv_mgmt. 2018-01-16 15:42:52 +00:00
maxv e54b750f47 More overflows... 2018-01-16 15:18:37 +00:00
maxv 24fb50b383 Fix overflow. 2018-01-16 14:37:24 +00:00
maxv 07db534b4d Mmh refix previous, we also need to make sure frm[1] is there. 2018-01-16 14:23:15 +00:00
maxv bea24f0ecf Fix memory leak. If m1 == m, m = NULL, so it's safe to just call m_freem. 2018-01-16 14:01:13 +00:00
maxv d44e08e5cc Fix overflow, noted by Maya. 2018-01-16 13:48:21 +00:00
roy d214f1bd3a Fix XEN builds 2018-01-16 11:52:09 +00:00
maya 108791360f Make MDSET_NOGZIP behave as documented also if MDSET_SUFFIX is set
MDSET_NOGZIP is documented as intended to apply for all kernels, even if
MDSET_NOGZIP.filename is not set.

From Harold Gutch in PR toolchain/52836
2018-01-16 09:59:37 +00:00
maxv 01f382e322 Style, remove pointless XXXs, and add a comment about LLC. 2018-01-16 09:42:11 +00:00
maxv 6cfd170308 Update the mbuf pointer when m_pullup succeeds, I forgot this in my last
revision (I only fixed the UAF in one branch). Meanwhile, style.
2018-01-16 09:04:30 +00:00
uwe 4f2e9ed826 Do not use HOST_CFLAGS and others. build.sh calls configure with
CFLAGS set to HOST_CFLAGS, etc - so HOST_* environment variables are
already taken into account if set.

OTOH, if configure were to add anything to CFLAGS etc, the old code
would happily ignore those changes, picking up original environment
variables instead.
2018-01-16 08:53:51 +00:00
maxv 1151dedd75 Split ieee80211_input into three sub-functions, that parse received
packets depending on their type:

	DATA       -> ieee80211_input_data
	MANAGEMENT -> ieee80211_input_management
	CONTROL    -> ieee80211_input_control

No real functional change, but makes the code much clearer.
2018-01-16 08:39:29 +00:00
mrg eb656dacb5 note sparc* cpuctl identify support. 2018-01-16 08:37:43 +00:00
mrg 8ea873287d implement cpuctl identify for sparc and sparc64.
sparc:
- move enum vactype and struct cacheinfo into cpu.h
- move the cache flags from cpuinfo.flags into CACHEINFO.c_flags
  (this allows the new cache_printf_backend() to see them.)
  remove unused CPUFLG_CACHEIOMMUTABLES and CPUFLG_CACHEDVMA.
- align xmpsg to 64 bytes
- move cache_print() into cache_print.h so it can be shared with
  cpuctl.  it only depends upon a working printf().
- if found, store the CPU node's "name" into cpu_longname.  this
  changes the default output to show the local CPU not the
  generic CPU family.  eg:
  cpu0 at mainbus0: mid 8: Ross,RT625 @ 90 MHz, on-chip FPU
  vs the generic "RT620/625" previously shown.
- for each CPU export these things:
  - name
  - fpuname
  - mid
  - cloc
  - freq
  - psr impl and version
  - mmu impl, version, and number of contexts
  - cacheinfo structure (which changed for the first time ever
    with this commit.)

sparc64:
- add a minimal "cacheinfo" structure to export the i/d/e-cache
  size and linesize.
- store %ver, cpu node "name" and cacheinfo in cpu_info.
- set cpu_info ver, name and cacheinfo in cpu_attach(), and
  export them via sysctl, as well as CPU ID and clock freq

cpuctl:
- add identifycpu_bind() that returns false on !x86 as their
  identify routines do not need to run on a particular CPU to
  obtain its information, and use it to avoid trying to set
  affinity when not needed.
- add sparc and sparc64 cpu identify support using the newly
  exported values.
2018-01-16 08:23:17 +00:00
ozaki-r d56bf90bfb Sanity-check if interlock is held when it's passed 2018-01-16 08:15:29 +00:00
ozaki-r 1b37ab7b8c Make DAD destructions (MP-)safe with callout_stop
arp_dad_stoptimer and nd6_dad_stoptimer can be called with or without
softnet_lock held and unfortunately we have no easy way to statically know which.
So it is hard to use callout_halt there.

To address the situation, we use callout_stop to make the code safe. The new
approach copes with the issue by delegating the destruction of a callout to
callout itself, which allows us to not wait the callout to finish. This can be
done thanks to that DAD objects are separated from other data such as ifa.

The approach is suggested by riastradh@
Proposed on tech-kern@ and tech-net@
2018-01-16 08:13:47 +00:00
maya e3a81445cb Returns void, mark noreturn.
From Eitan Adler in PR bin/52925
2018-01-16 07:57:58 +00:00
ozaki-r d8462ff5f2 Revert "Work around softnet_lock handling" as per pgoyette@'s request
We should avoid if (mutex_owned(softnet_lock)).
2018-01-16 07:56:55 +00:00