Commit graph

220 commits

Author SHA1 Message Date
kp
87900383a7 pf: Fix fragment timeout
We were inconsistent about the use of time_second vs. time_uptime.
Always use time_uptime so the value can be meaningfully compared.

Submitted by:	"Max" <maximos@als.nnov.ru>
MFC after:	4 days
2016-06-23 08:15:18 +02:00
delphij
2c50ff1c68 Fix multiple ntp vulnerabilities.
Security:	FreeBSD-SA-16:24.ntp
Approved by:	so
2016-06-05 10:27:00 +02:00
glebius
f5a1b2f43e Fix kernel stack disclosure in Linux compatibility layer. [SA-16:20]
Fix kernel stack disclosure in 4.3BSD compatibility layer. [SA-16:21]

Security:	SA-16:20
Security:	SA-16:21
Approved by:	so
2016-05-31 19:58:07 +02:00
Franco Fichtner
c3fc24abcf aslr: strip options to be enabled from tools.git
We have a merge.  I repeat, we have a merge.  :)
2016-05-19 21:08:09 +02:00
Shawn Webb
ec93b44059 HBSD: Change ASLR defaults for 32bit systems.
On i386, the stack isn't randomized enough to provide enough space for
the VDSO to be randomized. Bump the stack randomization up to 14 for
32bit systems and lower the VDSO randomization to 8. This provides
enough of a difference between the two to allow for both stack and
VDSO randomization.

Note that ASLR on 32bit systems is still rather weak. Not much entropy
can be introduced into the stack and VDSO. Brute forcing the stack and
VDSO is well within the realm of possibility. Users are strongly
advised to migrate to 64bit systems.

Signed-off-by:	Shawn Webb <shawn.webb@hardenedbsd.org>
2016-05-19 21:07:58 +02:00
Shawn Webb
e13c0d42eb HBSD OPNsense: Separate out the ASLR code.
On OPNsense's 16.7 roadmap is HardenedBSD's ASLR code. This commit
separates out the ASLR code from the rest of our exploit mitigation
and system hardening code.

Testing and verification still need to be performed. Initial testing
(compile + boot + `procstat -v PIDofPIEapplication) has been
performed. More thorough testing should occur.

Shared object load order randomization in the RTLD is not included in
this patch. That will be discussed with the fine folks at OPNsense at
a later time.

Since OPNsense is based on FreeBSD 10.x, this patch will need to be
backported to 10-STABLE. However, a "horizontal port" to 11-CURRENT,
which is what this commit is, needed to be done first.

Signed-off-by:	Shawn Webb <shawn.webb@hardenedbsd.org>
2016-05-19 21:07:57 +02:00
glebius
e0977fd0da - Use unsigned version of min() when handling arguments of SETFKEY ioctl.
- Validate that user supplied control message length in sendmsg(2)
  is not negative.

Security:	SA-16:18
Security:	CVE-2016-1886
Security:	SA-16:19
Security:	CVE-2016-1887
Submitted by:	C Turt <cturt hardenedbsd.org>
Approved by:	so
2016-05-18 06:43:21 +02:00
Franco Fichtner
31926631c1 ipfw: apply incremental dummynet aqm patch 0.2.1
Taken from: http://caia.swin.edu.au/freebsd/aqm/
2016-05-17 06:49:16 +02:00
delphij
4f3791bd3d Fix multiple OpenSSL vulnerabilitites. [SA-16:17]
Fix excessive latency in x86 IPI delivery. [EN-16:07]

Fix memory leak in ZFS. [EN-16:08]

Approved by:	so
2016-05-05 07:59:15 +02:00
Franco Fichtner
04033f5f88 ipfw: apply incremental dummynet aqm patch 0.2
Taken from: http://caia.swin.edu.au/freebsd/aqm/
2016-05-02 09:09:31 +02:00
delphij
48a2faaff7 Fix ntp multiple vulnerabilities.
Approved by:	so
2016-04-29 12:51:58 +02:00
hselasky
2dd8030917 Properly drain callouts in the IPFW subsystem to avoid use after free
panics when unloading the dummynet and IPFW modules:

- The callout drain function can sleep and should not be called having
a non-sleepable lock locked. Remove locks around "ipfw_dyn_uninit(0)".

- Add a new "dn_gone" variable to prevent asynchronous restart of
dummynet callouts when unloading the dummynet kernel module.

- Call "dn_reschedule()" locked so that "dn_gone" can be set and
checked atomically with regard to starting a new callout.

Reviewed by:	hiren
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D3855
2016-03-25 11:58:43 +01:00
Franco Fichtner
02adfc59c1 netgraph: prevent panic during attach to-non ethernet devices
PR: https://forum.opnsense.org/index.php?topic=2385

(cherry picked from commit 56b3d8393e)
(cherry picked from commit 6edfc6fe9d)
(cherry picked from commit 9b57a37488)
2016-03-25 11:57:04 +01:00
Franco Fichtner
b8ff7a2767 amdtemp: adds APU2 support
Taken from: http://www.pcengines.info/forums/?page=post&id=6DA3284E-4973-4EC5-921D-A93AB72123DC
2016-03-20 08:09:42 +01:00
loos
8c0470b3e1 Reapply r196551 which was accidentally reverted by r223637 (update to
OpenBSD pf 4.5).

Fix argument ordering to memcpy as well as the size of the copy in the
(theoretical) case that pfi_buffer_cnt should be greater than ~_max.

This fix the failure when you hit the self table size and force it to be
resized.

MFC after:	3 days
Sponsored by:	Rubicon Communications (Netgate)
2016-03-18 08:24:24 +01:00
glebius
2b850834df o Fix OpenSSH xauth(1) command injection. [SA-16:14]
o Fix incorrect argument validation in sysarch(2). [SA-16:15]
o Fix Hyper-V KVP (Key-Value Pair) daemon indefinite sleep. [EN-16:04]
o Fix hv_netvsc(4) incorrect TCP/IP checksums. [EN-16:05]

Errata:         FreeBSD-EN-16:04.hyperv
Errata:         FreeBSD-EN-16:05.hv_netvsc
Security:       FreeBSD-SA-16:14.openssh-xauth, CVE-2016-3115
Security:       FreeBSD-SA-16:15.sysarch, CVE-2016-1885
Approved by:    so
2016-03-17 07:58:16 +01:00
Franco Fichtner
c98601cd28 dummynet: fix kernel load on i386
PR: https://lists.freebsd.org/pipermail/freebsd-ipfw/2016-March/006047.html
2016-03-10 07:10:26 +01:00
Franco Fichtner
66c944ae9e ipfw: apply dummynet aqm patch 0.1
Taken from: http://caia.swin.edu.au/freebsd/aqm/

(cherry picked from commit ca148a09c3)
2016-03-08 08:25:09 +01:00
Franco Fichtner
b6c07be9be netgraph: revert an unused patch to the standard FreeBSD 10.2 state
(cherry picked from commit b04f2d8598)
2016-03-06 14:32:05 +01:00
delphij
55e09cf1f6 Fix multiple OpenSSL vulnerabilities.
Security:	FreeBSD-SA-16:12.openssl
Approved by:	so
2016-03-06 11:34:58 +01:00
Franco Fichtner
b53b5c4463 boot: improve branding by adding a shiny logo and version info
Logo kindly supplied by the Schellevis brothers @jschellevis
and @adschellevis, who had a lot of fun doing this.  :)

Time is ticking.... tick tock tick tock :)

(cherry picked from commit 3c2aaddaa4)
(cherry picked from commit 7a0f30b0a2)
(cherry picked from commit 5dc2a15077)
2016-02-15 09:30:30 +01:00
oshogbo
6fbb5246b2 Use correct src/dst ports when removing states.
Submitted by:	Milosz Kaniewski <m.kaniewski@wheelsystems.com>,
		UMEZAWA Takeshi <umezawa@iij.ad.jp> (orginal)
Reviewed by:	glebius
Approved by:	pjd (mentor)
Obtained from:	OpenBSD
MFC after:	3 days
2016-02-14 19:20:39 +01:00
royger
f768af7dfe MFC r292258:
hyperv/kvp: wake up the daemon if it's sleeping due to poll()

Submitted by:           Dexuan Cui <decui@microsoft.com>
Sponsored by:		Microsoft OSTC
2016-02-08 20:52:54 +01:00
royger
14491e08c7 MFC r291156:
Ignore the inbound checksum flags when doing packet forwarding in netvsc
driver.

Sponsored by:	Microsoft OSTC
PR:		203630

(cherry picked from commit a5f1c95b3c8a3114c0dd550de01326f7c442020a)
2016-02-02 21:04:39 +01:00
garga
bbff73ecb5 MFC r285945, r285960:
Respect pf rule log option before log dropped packets with IP options or
dangerous v6 headers

Reviewed by:	gnn, eri
Approved by:	gnn, glebius
Obtained from:	pfSense
Sponsored by:	Netgate
Differential Revision:	https://reviews.freebsd.org/D3222
2016-01-31 08:39:14 +01:00
delphij
372a5a5fd3 Fix OpenSSL SSLv2 ciphersuite downgrade vulnerability.
Security:	CVE-2015-3197
Security:	FreeBSD-SA-16:11.openssl
Approved by:	so
2016-01-30 14:38:01 +01:00
Franco Fichtner
82ad3de7f0 netmap: ring size limit not enough for multi-queue em(4)
Bravely going where no man has gone before.  :)
2016-01-28 11:03:21 +01:00
delphij
86e48d4566 Fix multiple vulnerabilities of ntp. [SA-16:09]
Fix Linux compatibility layer issetugid(2) system call
vulnerability. [SA-16:10]

Security:	FreeBSD-SA-16:09.ntp
Security:	FreeBSD-SA-16:10.linux
Approved by:	so
2016-01-27 09:29:55 +01:00
Franco Fichtner
0c43eb0819 Revert "tools: apply dscp.RELENG_10.diff"
This reverts commit 8f8e34e6f2.

Non-standard feature is non-standard.

Approved by: @adschellevis
2016-01-24 19:08:11 +01:00
Franco Fichtner
7930d3c381 sys/boot: branding by the one and only @kurbel 2016-01-24 17:59:58 +01:00
glebius
ca5d619411 Fix OpenSSH client information leak.
Security:       SA-16:07.openssh
Security:       CVE-2016-0777
Approved by:	so
2016-01-15 06:59:32 +01:00
glebius
8d5e66974d o Fix filemon and bmake meta-mode stability issues. [EN-16:01] o Fix invalid TCP checksums with pf(4). [EN-16:02.pf] o Fix YP/NIS client library critical bug. [EN-16:03.yplib] o Fix SCTP ICMPv6 error message vulnerability. [SA-16:01.sctp] o Fix ntp panic threshold bypass vulnerability. [SA-16:02.ntp] o Fix Linux compatibility layer incorrect futex handling. [SA-16:03.linux] o Fix Linux compatibility layer setgroups(2) system call. [SA-16:04.linux] o Fix TCP MD5 signature denial of service. [SA-16:05.tcp] o Fix insecure default bsnmpd.conf permissions. [SA-16:06.bsnmpd]
Errata:		FreeBSD-EN-16:01.filemon
Errata:		FreeBSD-EN-16:02.pf
Errata:		FreeBSD-EN-16:03.yplib
Security:	FreeBSD-SA-16:01.sctp, CVE-2016-1879
Security:	FreeBSD-SA-16:02.ntp, CVE-2015-5300
Security:	FreeBSD-SA-16:03.linux, CVE-2016-1880
Security:	FreeBSD-SA-16:04.linux, CVE-2016-1881
Security:	FreeBSD-SA-16:05.tcp, CVE-2016-1882
Security:	FreeBSD-SA-16:06.bsnmpd, CVE-2015-5677
Approved by:	so
2016-01-14 11:21:11 +01:00
mav
7b370bd90d MFC r287654: Add support for PPP-Max-Payload PPPoE tag (RFC4638).
Submitted by:   Dmitry Luhtionov <dmitryluhtionov@gmail.com>
2015-12-27 17:21:54 +01:00
delphij
d1efe8058d Fix OpenSSL multiple vulnerabilities.
Security:	FreeBSD-SA-15:26.openssl
Approved by:	so
2015-12-05 12:21:10 +01:00
Franco Fichtner
680115d9a6 stf: merge the missing half of the stf implementation
Thumbs up to the pfSense guys for publishing this!  STF (6rd) patching
is probably going away for us with 11-CURRENT though, unless more work
is done in FreeBSD.  Contacted the original maintainer a while ago, but
no response.

Other BSDs are in a similar state, suggesting that GIF basically works.

Taken from: https://github.com/pfsense/FreeBSD-src/commit/73261ef4d5a
See also:   https://lists.freebsd.org/pipermail/freebsd-net/2013-June/035749.html
See also:   http://undeadly.org/cgi?action=article&sid=20130828151241
2015-11-21 01:59:08 +01:00
Franco Fichtner
b5287825fd netgraph: do the previous here as well for proper locking 2015-11-21 01:59:04 +01:00
glebius
84877008ef Remove ifa_mtx. It was used only in one place in kernel, and ifnet's ifaddr lock can substitute it there.
Discussed with:	melifaro, ae
Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2015-11-21 01:59:00 +01:00
Franco Fichtner
e40080fe17 net: M_IPIN_SKIPPFIL is the same as M_PROTO12
Make the patch more portable by using it directly.
2015-11-21 01:58:55 +01:00
Franco Fichtner
453fe71bf8 netmap: mute a spammy netmap message 2015-11-20 11:48:34 +01:00
glebius
6027063685 o Fix regressions related to SA-15:25 upgrade of NTP. [1] o Fix kqueue write events never fired for files greater 2GB. [2] o Fix kpplications exiting due to segmentation violation on a correct memory address. [3]
PR:		204046 [1]
PR:		204203 [1]
Errata Notice:	FreeBSD-EN-15:19.kqueue [2]
Errata Notice:	FreeBSD-EN-15:20.vm [3]
Approved by:	so
2015-11-05 07:22:24 +01:00
kib
c55f000709 Remove a check which caused spurious SIGSEGV on usermode access to the
mapped address without valid pte installed, when parallel wiring of
the entry happen.  The entry must be copy on write.  If entry is COW
but was already copied, and parallel wiring set
MAP_ENTRY_IN_TRANSITION, vm_fault() would sleep waiting for the
MAP_ENTRY_IN_TRANSITION flag to clear.  After that, the fault handler
is restarted and vm_map_lookup() or vm_map_lookup_locked() trip over
the check.  Note that this is race, if the address is accessed after
the wiring is done, the entry does not fault at all.

There is no reason in the current kernel to disallow write access to
the COW wired entry if the entry permissions allow it.  Initially this
was done in r24666, since that kernel did not supported proper
copy-on-write for wired text, which was fixed in r199869.  The r251901
revision re-introduced the r24666 fix for the current VM.

Note that write access must clear MAP_ENTRY_NEEDS_COPY entry flag by
performing COW.  In reverse, when MAP_ENTRY_NEEDS_COPY is set in
vmspace_fork(), the MAP_ENTRY_USER_WIRED flag is cleared.  Put the
assert stating the invariant, instead of returning the error.

Reported and debugging help by:	peter
Reviewed by:	alc
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2015-10-30 10:25:53 +01:00
glebius
6cd494ea4d Upgrade NTP to 4.2.8p4.
Security:	FreeBSD-SA-15:25.ntp
Security:	CVE-2015-7871
Security:	CVE-2015-7855
Security:	CVE-2015-7854
Security:	CVE-2015-7853
Security:	CVE-2015-7852
Security:	CVE-2015-7851
Security:	CVE-2015-7850
Security:	CVE-2015-7849
Security:	CVE-2015-7848
Security:	CVE-2015-7701
Security:	CVE-2015-7703
Security:	CVE-2015-7704, CVE-2015-7705
Security:	CVE-2015-7691, CVE-2015-7692, CVE-2015-7702
Approved by:	so
2015-10-28 06:31:44 +01:00
hselasky
2bc1d40306 Add new USB ID.
MFC after:	1 month
PR:		202968
2015-10-22 07:35:43 +02:00
delphij
ea14f6aab9 Fix a regression with SA-15:24 patch that prevented NIS from working.
Approved by:	so
2015-10-03 11:51:54 +02:00
delphij
1238e4cf0d The Sun RPC framework uses a netbuf structure to represent the transport specific form of a universal transport address. The structure is expected to be opaque to consumers. In the current implementation, the structure contains a pointer to a buffer that holds the actual address.
In rpcbind(8), netbuf structures are copied directly, which would
result in two netbuf structures that reference to one shared
address buffer.  When one of the two netbuf structures is freed,
access to the other netbuf structure would result in an undefined
result that may crash the rpcbind(8) daemon.

Fix this by making a copy of the buffer that is going to be freed
instead of doing a shallow copy.

Security:	FreeBSD-SA-15:24.rpcbind
Security:	CVE-2015-7236
Approved by:	so
2015-09-29 23:11:45 +02:00
delphij
8886101039 Fix regression in pw(8) when creating numeric users or groups. [EN-15:16]
Fix libc handling of signals for multi-threaded processes.
[EN-15:17]

Implement pubkey support for pkg(7) bootstrap. [EN-15:18]

Approved by:	so
2015-09-17 08:57:19 +02:00
delphij
fce3610083 Fix OpenSSH multiple vulnerabilities. [SA-15:22]
Fix insufficient check of unsupported pkg(7) signature methods.
[EN-15:15]

Approved by:	so
2015-08-25 23:37:38 +02:00
delphij
ab2d8fd367 Fix multiple integer overflows in expat.
Security:	CVE-2015-1283
Security:	FreeBSD-SA-15:20.expat

Fix make(1) syntax errors when upgrading from 9.x and earlier.
[EN-15:11]

Fix incorrect netstat(1) data handling on 32-bit systems.
[EN-15:12]

Allow size argument to vidcontrol(1) for syscons(4). [EN-15:13]

Approved by:	so
2015-08-19 07:03:39 +02:00
Franco Fichtner
85a60388af Revert "ipfw: add extra test in dummynet_send to avoid kernel panic"
This reverts commit 96d838e86e.
Does not apply to our use cases anymore.  Less patches the better.
2015-08-19 07:02:58 +02:00
Ad Schellevis
bd15265242 tools: apply pf_match.diff 2015-08-14 15:54:06 +02:00