Commit Graph

231231 Commits

Author SHA1 Message Date
sborrill f76d427f5b Ticket #1731 2020-05-07 12:03:47 +00:00
sborrill b3a976d7f3 Pull up the following revisions(s) (requested by aymeric in ticket #1731):
bin/rcp/rcp.c:	revision 1.50

In sink(), upon error, avoid multiple replies to the source as this
would lead to a desynchronization of the protocol and further files or
directories to be ignored or corrupted.
2020-05-07 12:02:24 +00:00
martin bab719467b Pull up following revision(s) (requested by nia in ticket #1729):
games/fortune/strfile/strfile.c: revision 1.39
	games/fortune/unstr/unstr.c: revision 1.15

strfile: Check that input/output filenames don't exceed the buffer size
unstr: Check that the input filename fits in the buffer.
2020-04-30 21:24:25 +00:00
martin fc34270b3e Ticket #1729 2020-04-30 16:25:15 +00:00
martin ad790b0775 Ticket #1727 2020-04-15 14:59:54 +00:00
martin 6559e02534 Pull up following revision(s) (requested by kim in ticket #1727):
sys/netinet6/nd6_rtr.c: revision 1.148 (via patch)

Fix default route selection

The primary issue was that in revision 1.79 a check was added in the
nd6_defrouter_select() search loop to ignore the entry if RA processing
is enabled on its interface.  In practice this results in all entries
being ignored.

This fix reverses the condition, so that an entry is ignored when RA
processing is NOT enabled on its interface.  Further, the entry is
only ignored for being selected as the default router.  The currently
installed router must be identified regardless of the (current) status
of its interface, so that we can delete the route before installing a
new one.

I also added error logging when adding or deleting a route fails. This
should help the administrator (or kernel developer) in noticing possible
problems.

Finally, if deleting a route fails, the corresponding default route
entry no longer has its "installed" flag cleared, so that deletion will
be retried.  At a minimum, this will cause repeated messages about the
failed deletion as opposed to only getting repeated messages about the
installation of a new default route failing.

Fixes PR kern/55091 and also PR bin/54997 as far as the behaviour
observed with ndp(8).
2020-04-15 14:59:33 +00:00
martin 4bd01aac0f Ticket #1722 2020-02-12 20:24:07 +00:00
martin b655189130 Pull up following revision(s) (requested by christos in ticket #1722):
external/bsd/ppp/dist/pppd/eap.c: revision 1.5

pppd: Fix bounds check in EAP code

Given that we have just checked vallen < len, it can never be the case
that vallen >= len + sizeof(rhostname).  This fixes the check so we
actually avoid overflowing the rhostname array.

Reported-by: Ilja Van Sprundel <ivansprundel%ioactive.com@localhost>

Signed-off-by: Paul Mackerras <paulus%ozlabs.org@localhost>

From:
8d7970b8f3
2020-02-12 20:23:39 +00:00
martin 4f02b3c5e5 Ticket #1719 2020-01-02 09:58:20 +00:00
martin 8736ea2285 Pull up following revision(s) (requested by mlelstv in ticket #1719):
sys/conf/copyright: revision 1.18

Welcome to 2020.
2020-01-02 09:57:59 +00:00
martin 490b4b36de Ticket #1718 2019-12-17 16:35:52 +00:00
martin 10fc56956e Pull up following revision(s) (requested by christos in ticket #1718):
sys/dev/ic/ath.c: revision 1.129

Protect network ioctls from non-authorized users. (Ilja Van Sprundel)
2019-12-17 16:35:28 +00:00
martin 900e20b4cc Ticket #1717 2019-12-08 10:27:54 +00:00
martin c9d680aa55 Pull up following revision(s) (requested by riastradh in ticket #1717):
sys/dev/cons.c: revision 1.76
	sys/dev/cons.c: revision 1.77

Fix reference count leak in cons(4).
Don't forget to vrele after you're done, folks!
Restore historical $Hdr$ tag after git cvsexportcommit nixed it.
2019-12-08 10:27:32 +00:00
bouyer f33d108712 ticket 1715 2019-12-05 16:23:51 +00:00
bouyer 766a8ff08c Pull up following revision(s) (requested by riastradh in ticket #1715):
share/man/man4/rnd.4: revision 1.26
	share/man/man4/rnd.4: revision 1.27
	share/man/man4/rnd.4: revision 1.28
	share/man/man4/rnd.4: revision 1.25
Update man page to reflect switch from CTR_DRBG to Hash_DRBG.
Replace slightly wrong rant by shorter and slightly less long rant.
(If X and Y in Z/2Z are independent, then so are X and X+Y.  What was
I thinking.)
Update NIST SP800-90A reference.
New sentence, new line. Use \(em.
2019-12-05 16:23:22 +00:00
martin a984eb520a Ticket #1714 2019-11-25 15:49:05 +00:00
martin ca11f2a278 Pull up following revision(s) (requested by riastradh in ticket #1714):
sys/kern/subr_cprng.c: revision 1.33

Use cprng_strong, not cprng_fast, for sysctl kern.arnd.
2019-11-25 15:48:40 +00:00
martin d7283bcf23 Fix set lists for ticket #1710 2019-10-31 01:55:22 +00:00
martin c43e1971d8 Ticket #1710 2019-10-28 18:06:42 +00:00
martin 5fc37e8fa4 Pull up following revision(s) (requested by maya in ticket #1710):
distrib/sets/lists/modules/mi: revision 1.127
	sys/modules/Makefile: revision 1.230
	sys/modules/filemon/Makefile: revision 1.4 (manually adjusted)
	sys/modules/Makefile: revision 1.229

Disable filemon.

It isn't suited for general use (that is, it poses security risks),
but the existence of the module means it is auto-loaded when /dev/filemon
is opened, which can be done by any user.

Thanks Ilja van Sprundel for the heads up.

 -

Continue to build the filemon module, but don't install it.  Hopefully
this will help us detect any additional bit-rot that might occur.

XXX It might be a good idea to modify the file permissions on /dev/filemon
XXX to prevent auto-loading of the driver module by non-privileged users.
2019-10-28 18:06:13 +00:00
martin 947dd4e902 Ticket #1709 2019-09-28 07:52:18 +00:00
martin 0391018946 Pull up following revision(s) (requested by plunky in ticket #1709):
sys/netbt/hci_event.c: revision 1.26
	sys/netbt/hci.h: revision 1.46

When encrypted connections are configured, verify that the encryption
key length has a minimum size when the adaptor supports that.

This addresses the 'Key Negotiation of Bluetooth' attack, CVE-2019-9506
https://www.bluetooth.com/security/statement-key-negotiation-of-bluetooth/
2019-09-28 07:51:57 +00:00
martin 17fa25f880 Ticket #1708 2019-09-17 18:10:00 +00:00
martin 64cb2ccf0c Pull up following revision(s) (requested by bouyer in ticket #1708):
sys/netinet6/ip6_input.c: revision 1.209 via patch
	sys/netinet/ip_input.c: revision 1.390 via patch

Packet filters can return an mbuf chain with fragmented headers, so
m_pullup() it if needed and remove the KASSERT()s.
2019-09-17 18:09:37 +00:00
martin 4f2be8cf00 Ticket #1706 2019-09-17 17:36:58 +00:00
martin c711eb25ef Pull up following revision(s) (requested by maya in ticket #1706):
lib/libc/nameser/ns_name.c: revision 1.12

Since we advance cp after the bounds check, we need to test for bounds
again before using it. Discovered via fuzzing, reported by enh at google, via:

    https://android-review.googlesource.com/c/platform/bionic/+/1093130
2019-09-06 13:53:31 +00:00
martin ce1da42858 Ticket #1705 2019-09-03 12:31:11 +00:00
martin e400c05caf Pull up following revision(s) (requested by riastradh in ticket #1705):
sys/crypto/nist_hash_drbg/nist_hash_drbg.c: revision 1.1
	sys/crypto/nist_hash_drbg/nist_hash_drbg.h: revision 1.1
	sys/rump/kern/lib/libcrypto/Makefile: revision 1.5
	sys/crypto/nist_hash_drbg/files.nist_hash_drbg: revision 1.1
	sys/rump/librump/rumpkern/Makefile.rumpkern: revision 1.176
	sys/crypto/nist_ctr_drbg/nist_ctr_drbg_aes256.h: file removal
	sys/crypto/nist_ctr_drbg/nist_ctr_drbg_config.h: file removal
	sys/conf/files: revision 1.1238
	sys/dev/rndpseudo.c: revision 1.38
	sys/crypto/nist_ctr_drbg/nist_ctr_drbg.c: file removal
	sys/sys/cprng.h: revision 1.13 - 1.15
	sys/crypto/nist_ctr_drbg/nist_ctr_drbg.h: file removal
	sys/crypto/nist_ctr_drbg/nist_ctr_aes_rijndael.h: file removal
	sys/crypto/nist_ctr_drbg/files.nist_ctr_drbg: file removal
	sys/kern/subr_cprng.c: revision 1.31
	sys/crypto/nist_ctr_drbg/nist_ctr_drbg_aes128.h: file removal

cprng.h: use static __inline for consistency with other include
headers and remove an unused function.

 -

Switch from NIST CTR_DRBG with AES to NIST Hash_DRBG with SHA-256.

Benefits:
- larger seeds -- a 128-bit key alone is not enough for `128-bit security'
- better resistance to timing side channels than AES
- a better-understood security story (<a  rel="nofollow" href="https://eprint.iacr.org/2018/349">https://eprint.iacr.org/2018/349</a>)
- no loss in compliance with US government standards that nobody ever
  got fired for choosing, at least in the US-dominated western world
- no dirty endianness tricks
- self-tests

Drawbacks:
- performance hit: throughput is reduced to about 1/3 in naive measurements
  => possible to mitigate by using hardware SHA-256 instructions
  => all you really need is 32 bytes to seed a userland PRNG anyway
  => if we just used ChaCha this would go away...
2019-09-03 12:30:45 +00:00
martin 3a75f83072 Ticket #1703 2019-08-29 16:17:08 +00:00
martin e1189770c8 Pull up following revision(s) (requested by hannken in ticket #1703):
sys/miscfs/kernfs/kernfs_vnops.c: revision 1.161
	sys/miscfs/procfs/procfs_vnops.c: revision 1.207

Add missing operation VOP_GETPAGES() returning EFAULT.

Without this operation posix_fadvise(..., POSIX_FADV_WILLNEED)
would leave the v_interlock held.

Observed by maxv@
2019-08-29 16:15:35 +00:00
martin 7abbd20046 Fix typo in last entry 2019-06-15 15:59:33 +00:00
martin 73609125d4 Ticket #1699 2019-06-15 15:58:02 +00:00
martin 1e93bbba46 Pull up the following revisions (via patch) requested by mrg in ticket #1699:
libexec/httpd/CHANGES			1.31-1.40
	libexec/httpd/Makefile			1.28
	libexec/httpd/auth-bozo.c		1.23-1.24
	libexec/httpd/bozohttpd.8		1.75-1.79
	libexec/httpd/bozohttpd.c		1.100-1.113
	libexec/httpd/bozohttpd.h		1.58-1.60
	libexec/httpd/cgi-bozo.c		1.46-1.48
	libexec/httpd/daemon-bozo.c		1.20-1.21
	libexec/httpd/dir-index-bozo.c		1.29-1.32
	libexec/httpd/ssl-bozo.c		1.26
	libexec/httpd/testsuite/Makefile	1.12-1.13
	libexec/httpd/testsuite/t11.out 	1.2
	libexec/httpd/testsuite/test-bigfile	1.6
	libexec/httpd/testsuite/test-simple	1.6

Don't display special files in the directory index.  They aren't
served, but links to them are generated.
---
All from "Rajeev V. Pillai" <rajeev_v_pillai@yahoo.com>:
- use html tables for directory index.
- don't include "index.html" in html headers
- additional escaping of names
- re-add top/bottom borders
- adds an aquamarine table header
- Zebra-stripes table rows using CSS instead of code
- fix CGI '+' param and error handling.
- remove unused parameter to daemon_poll_err().
- avoid sign extension in % handling
fix a few problems pointed out by clang static analyzer:
- bozostrnsep() may return with "in = NULL", so check for it.
- nul terminating in bozo_escape_rfc3986() can be simpler
- don't use uniinit variables in check_remap()
- don't use re-used freed data in check_virtual().
- fix bozoprefs->size setting when increasing the size (new total was
  being added to the prior total.)
  however, bozostrdup() may reference request->hr_file.
---
Add ssl specific timeout value (30s).  If SSL_accept() doesn't
work with in this timeout value, ssl setup now fails.
---
Fix handling of bozo_set_timeout() timeouts (and `-T' option parsing)
---
Avoid .htpasswd exposure to authenticated users when .htpasswd is
in the slashdir too.
---
Avoid possible NULL dereference when sending a big request that timeout.
---
Use strings.h for strcasecmp (on linux)
---
Account for cgihandler being set when counting the number of CGI environment
headers we are about to set. Avoids an assertion failure (and overruninng
the array) later.
2019-06-15 15:57:32 +00:00
martin a7c819d518 Ticket #1698 2019-05-31 08:15:50 +00:00
martin 03fbcc0b86 Pull up following revision(s) (requested by mlelstv in ticket #1698):
sys/dev/scsipi/scsipi_ioctl.c: revision 1.72 (via patch)

use correct size when copying outgoing sense data.
2019-05-31 08:15:24 +00:00
martin 3c3d4cea6e Ticket #1697 2019-05-29 15:55:41 +00:00
martin 784cecf3c2 Pull up following revision(s) (requested by kardel in ticket #1697):
sys/ufs/ffs/ffs_alloc.c: revision 1.164

PR/53990, PR/52380, PR/52102: UFS2 cylinder group inode allocation botch

Fix rare allocation botch in ffs_nodealloccg().

Conditions:
    a) less than
         #_of_initialized_inodes(cg->cg_initediblk)
         - inodes_per_filesystem_block
       are allocated in the cylinder group
    b) cg->cg_irotor points to a uninterupted run of
       allocated inodes in the inode bitmap up to the
       end of dynamically initialized inodes
       (cg->cg_initediblk)

In this case the next inode after this run was returned
without initializing the respective inode block. As the
block is not initialized these inodes could trigger panics
on inode consistency due to old (uninitialized) disk data.

In very rare cases data loss could occur when
the uninitialized inode block is initialized via the
normal mechanism.

Further conditions to occur after the above:
    c) no panic
    d) no (forced) fsck
    e) and more than cg->cg_initediblk - inodes_per_filesystem_block
       allocated inodes.

Fix:

Always insure allocation always in initialized inode range
extending the initialized inode range as needed.

Add KASSERTMSG() safeguards.

ok hannken@
2019-05-29 15:55:18 +00:00
martin 5864656c76 Ticket #1696 2019-05-07 18:56:53 +00:00
martin 1f61f7cad7 Pull up following revision(s) (requested by christos in ticket #1696):
sys/netsmb/smb_conn.c: revision 1.30

Prevent a NULL pointer dereference when the local endpoint is not defined.

From Andy Nguyen, many thanks.
2019-05-07 18:55:48 +00:00
martin a68fd07827 Tickets #1693 and #1694 2019-05-05 09:12:01 +00:00
martin 66c07839b2 Apply patch, requested by roy in ticket #1695:
external/bsd/dhcpcd/dist/src/dhcp6.c

DHCPv6: Fix a potential read overflow with D6_OPTION_PD_EXCLUDE
2019-05-05 09:09:50 +00:00
martin 4b98583e72 Pull up following revision(s) (requested by maxv in ticket #1693):
sys/arch/amd64/amd64/copy.S: revision 1.33
	sys/arch/i386/i386/copy.S: revision 1.31

Hum. Fix a potentially catastrophic bug: kcopy() sets DF=1 if the areas
overlap, but doesn't clear it if the copy faults. If this happens, we
return to the caller with DF=1, and each future memory copy will be
backwards.

I wonder if there really are places where kcopy() is called with
overlapping areas.
2019-05-05 08:49:18 +00:00
martin ca3e0be4b0 Ticket #1690 2019-05-01 09:43:37 +00:00
martin 401d06e37e Apply patch, requested by roy in ticket #1690:
external/bsd/dhcpcd/dist/configure
	external/bsd/dhcpcd/dist/src/auth.c
	external/bsd/dhcpcd/dist/src/dhcp.c
	external/bsd/dhcpcd/dist/src/dhcp6.c
	external/bsd/dhcpcd/dist/compat/consttime_memequal.h

Security fixes for dhcpcd:
Fix a potential 1 byte read overflow with DHO_OPTSOVERLOADED.
Use consttime_memequal(3) to compare hashes.
2019-05-01 09:26:23 +00:00
martin df6c34b8e8 Ticket #1689 2019-04-19 16:05:05 +00:00
martin 035df2662d Pull up following revision(s) via patch (requested by christos in ticket #1689):
sys/compat/linux/common/linux_socket.c: revision 1.145
	sys/net/if.c: revision 1.449
	sys/compat/linux32/common/linux32_socket.c: revision 1.30
	sys/compat/common/uipc_syscalls_40.c: revision 1.19

Zero out the ifreq struct for SIOCGIFCONF to avoid up to 127 bytes of stack
disclosure. From Andy Nguyen, many thanks!

 -

Zero out the ifreq struct for SIOCGIFCONF to avoid up to 127 bytes of stack
disclosure. From Andy Nguyen, many thanks! This is the compat code part
pointed out by ozaki-r@
2019-04-19 16:03:08 +00:00
msaitoh 6478bcae00 Ticket #1688. 2019-04-16 03:57:12 +00:00
msaitoh 53a5f0a942 Pull up following revision(s) (requested by martin in ticket #1688):
sys/kern/sys_mqueue.c: revision 1.44
mq_send1: fix argument validation and reject too large lengths early.
Discovered by Andy Nguyen.
2019-04-16 03:53:25 +00:00
msaitoh 35d91e0505 Ticket #1684. 2019-03-13 12:36:14 +00:00