Commit Graph

301286 Commits

Author SHA1 Message Date
christos 4170684f22 Import OpenSSL-3.0.9
### Changes between 3.0.8 and 3.0.9 [30 May 2023]

 * Mitigate for the time it takes for `OBJ_obj2txt` to translate gigantic
   OBJECT IDENTIFIER sub-identifiers to canonical numeric text form.

   OBJ_obj2txt() would translate any size OBJECT IDENTIFIER to canonical
   numeric text form.  For gigantic sub-identifiers, this would take a very
   long time, the time complexity being O(n^2) where n is the size of that
   sub-identifier.  ([CVE-2023-2650])

   To mitigitate this, `OBJ_obj2txt()` will only translate an OBJECT
   IDENTIFIER to canonical numeric text form if the size of that OBJECT
   IDENTIFIER is 586 bytes or less, and fail otherwise.

   The basis for this restriction is RFC 2578 (STD 58), section 3.5. OBJECT
   IDENTIFIER values, which stipulates that OBJECT IDENTIFIERS may have at
   most 128 sub-identifiers, and that the maximum value that each sub-
   identifier may have is 2^32-1 (4294967295 decimal).

   For each byte of every sub-identifier, only the 7 lower bits are part of
   the value, so the maximum amount of bytes that an OBJECT IDENTIFIER with
   these restrictions may occupy is 32 * 128 / 7, which is approximately 586
   bytes.

   Ref: https://datatracker.ietf.org/doc/html/rfc2578#section-3.5

   *Richard Levitte*

 * Fixed buffer overread in AES-XTS decryption on ARM 64 bit platforms which
   happens if the buffer size is 4 mod 5 in 16 byte AES blocks. This can
   trigger a crash of an application using AES-XTS decryption if the memory
   just after the buffer being decrypted is not mapped.
   Thanks to Anton Romanov (Amazon) for discovering the issue.
   ([CVE-2023-1255])

   *Nevine Ebeid*

 * Reworked the Fix for the Timing Oracle in RSA Decryption ([CVE-2022-4304]).
   The previous fix for this timing side channel turned out to cause
   a severe 2-3x performance regression in the typical use case
   compared to 3.0.7. The new fix uses existing constant time
   code paths, and restores the previous performance level while
   fully eliminating all existing timing side channels.
   The fix was developed by Bernd Edlinger with testing support
   by Hubert Kario.

   *Bernd Edlinger*

 * Corrected documentation of X509_VERIFY_PARAM_add0_policy() to mention
   that it does not enable policy checking. Thanks to David Benjamin for
   discovering this issue.
   ([CVE-2023-0466])

   *Tomáš Mráz*

 * Fixed an issue where invalid certificate policies in leaf certificates are
   silently ignored by OpenSSL and other certificate policy checks are skipped
   for that certificate. A malicious CA could use this to deliberately assert
   invalid certificate policies in order to circumvent policy checking on the
   certificate altogether.
   ([CVE-2023-0465])

   *Matt Caswell*

 * Limited the number of nodes created in a policy tree to mitigate
   against CVE-2023-0464.  The default limit is set to 1000 nodes, which
   should be sufficient for most installations.  If required, the limit
   can be adjusted by setting the OPENSSL_POLICY_TREE_NODES_MAX build
   time define to a desired maximum number of nodes or zero to allow
   unlimited growth.
   ([CVE-2023-0464])

   *Paul Dale*
2023-05-31 19:25:17 +00:00
riastradh 3e105dc2be ld.elf_so: Sprinkle tls debug messages.
XXX pullup-10
2023-05-31 18:44:39 +00:00
uwe a2db434eb1 date(1): sync two [[[[[CC]yy]mm]dd]HH]MM[.SS] instances
The markup was the same (modulo Li vs Cm for the dot before the
seconds), but use the same source markup grouping/layout in both to
make this fact more obvious.
2023-05-31 18:04:00 +00:00
kim 219c5cc723 Add -R to usage 2023-05-31 17:56:54 +00:00
uwe 8710cd3b8d date(1): minor markup fixes 2023-05-31 17:52:02 +00:00
kim 04f2a3c19d Add -R option for displaying time in RFC 5322 format, similar to GNU date. 2023-05-31 16:01:53 +00:00
riastradh 3e86fda22b ld.elf_so: Fix set lists for MKDEBUG=yes builds with t_tls_extern.
XXX pullup-10
2023-05-31 13:02:10 +00:00
lukem ef8663be6b CHANGES: pax fixes 2023-05-31 09:33:09 +00:00
riastradh fca22ba5cb ld.elf_so: Nix inadvertently committed private test program. 2023-05-31 01:06:43 +00:00
riastradh 111bb99c35 ld.elf_so: Fix extern TLS test to match PR toolchain/50277.
Now it's actually testing the problem.
2023-05-31 00:46:11 +00:00
riastradh 12037d6a69 ld.elf_so: New test for extern initial-exec TLS, PR toolchain/50277.
XXX pullup-10
2023-05-31 00:18:44 +00:00
hgutch d9afbe107f Fix LLVM build with host gcc 13
Building LLVM with a host gcc 13 fails and suggests including <cstdint>
in external/apache2/llvm/dist/llvm/include/llvm/Support/Signals.h .
Instead of this, joerg@ suggested not modifying the llvm vendor branch
but instead working around this in our LLVM build infrastructure.
2023-05-30 19:05:04 +00:00
lukem 39d234c9f0 tools/compat: regen 2023-05-30 19:04:42 +00:00
lukem 8d651401a4 tools/compat: disable host CC warnings
Determine if the host CC supports flags to disable various
warnings similar to <bsd.own.mk> GCC_*, CLANG_*, and CC_*,
and override the <bsd.own.mk> equivalents in defs.mk.

Silences "warning: unknown warning option '...'" from our source.
External source (e.g., binutils and gcc) need their own fixes
to enhance their detection of supported clang compiler flags.
2023-05-30 18:54:21 +00:00
lukem 2356d03a18 tools/compat: detect supported host compiler flags
Define NB_CC_FLAG(FLAG) to use AX_CHECK_COMPILE_FLAG
to determine if the host compiler supports FLAG
and define and AC_SUBST CC_FLAG if so.

Use workarounds to force clang to hard-fail on unknown -Wwarning,
and gcc to use -WWARN to check unknown -Wno-WARN because the
latter doesn't cause an error in gcc.

In the future we could use NB_CC_FLAG([-fcommon]) for
older NetBSD release branches compiled with host gcc 10+.

Rework Darwin -no-cpp-precomp check to use NB_CC_FLAG().
Note: this flag probably hasn't been required on macOS (Darwin)
for a long time, but serves as a good example on how to use this.

Display varaibles at the end of configure to show what was detected.
2023-05-30 18:39:19 +00:00
lukem 69c1db2ad0 tools/compat: import AX_CHECK_COMPILE_FLAG
Import AX_CHECK_COMPILE_FLAG serial 6 from autoconf-archive
  https://github.com/autoconf-archive/autoconf-archive.git
as at commit 5b5ce7f on 2023-05-01.
2023-05-30 18:35:16 +00:00
lukem c578bb77d2 tools/compat: don't expose HAVE_PTHREAD_H to make
Non of the tools Makefiles needs HAVE_PTHREAD_H, so don't
AC_SUBST it or provide in defs.mk.
2023-05-30 18:31:55 +00:00
lukem f7d6f1b13f tools/compat: use autoreconf, support MAKEVERBOSE
Use autoreconf instead of autoconf + autoheader;
we'll need aclocal in the near future.

If MAKEVERBOSE >= 2, add -v to autoreconf.
2023-05-30 18:27:04 +00:00
christos f3bd495543 Fix some const qual (Piotr Pawel Stefaniak) 2023-05-30 11:53:40 +00:00
msaitoh 0692385f37 Use device_printf() instead of aprint_error_dev(). 2023-05-30 04:14:30 +00:00
gutteridge 92ce9f6bbb sysctl.7: be a little more descriptive about kern.osrevision
It's expressed as an integer, and is also returned as an integer type
should one retrieve it via sysctl(3) (as this man page already
correctly documents in the table above its description).
2023-05-29 23:30:47 +00:00
lukem e6c216806f tools/compat: regen 2023-05-29 21:34:57 +00:00
lukem 2ec2a2d759 tools/compat/configure.ac: style tweaks
Use "NB_" prefix not "AC_" for our macros ("AC_" is for autoconf).
Fail is NB_ macro isn't defined.
Use AC_DEFUN() instead of define().
Consistently use () in zero argument macro calls.
2023-05-29 21:30:42 +00:00
andvar 3532fe7de5 mdnsd(8): restore fixes for PR bin/46758, lost on resolving merge conflicts.
Original commit message from Roy Marples:
"Derive our primary interface and address by trying to connect to an
address in the TEST-NET-2 network as noted in RFC5737 instead of using
the 1.1.1.1 address. Also, use port 7 (echo) for better style.
Fixes PR bin/46758 thanks to Lloyd Parkes."

pullups needed for netbsd-9, netbsd-10.
2023-05-29 21:16:58 +00:00
lukem 11f18d4109 bsd.own.mk: rename NO_ADDR_OF_PACKED_MEMBER to CC_NO_ADDR_OF_PACKED_MEMBER
Add "CC_" prefix to NO_ADDR_OF_PACKED_MEMBER.

We now have the following convention:
GCC_NO_*: Disable specific warnings from GCC.
CLANG_NO_*: Disable specific warnings from Clang.
CC_NO_*: Disable specific warnings from both Clang and GCC.

This reserves "NO_*" Makefile variables to disable other features.

Some space->tab fixes.
2023-05-29 20:31:09 +00:00
lukem c1aa87e38c libc: fix typo in comments: NO_SRSC -> NO_SRCS 2023-05-29 18:25:52 +00:00
lukem 0c67090a00 bsd.own.mk: sort list of NO* variables
List the NO variables in order, leaving enough room to add more entries,
not splitting the next letter after "NO" across a line.

No functional change; just prettier and easier to review.
2023-05-29 17:35:11 +00:00
rin d708cb6fb0 aq(4): if_transmit: Invoke softint_schedule(9) with kpreempt disabled.
XXX
Pull up to netbsd-10 and netbsd-9.
2023-05-29 08:00:05 +00:00
rin 9bacf14f2a libsa/printf: Do not fetch long va_arg as long long.
This does real harm iff all of the following conditions are satisfied:

(1) On ILP32 architectures.
(2) Both LIBSA_PRINTF_LONGLONG_SUPPORT and LIBSA_PRINTF_WIDTH_SUPPORT
    compile-time options are enabled.
(3) Width field is used with 'l' modifier.

This is an implicit-fallthrough bug, but unfortunately, GCC 10.4 cannot
find this out somehow...

XXX
Pull up to netbsd-10 and netbsd-9. netbsd-8 is not affected.
2023-05-29 03:56:52 +00:00
lukem d2813c5205 pax: don't overwrite destination if -r -w copy fails
Add more error handling to pax -r -w so that any failure
during the copy to the temporary file (including a failed flush)
prevents any existing destination file from being replaced
with the partial (including possibly empty) temporary file.
The partial temporary file is removed.  pax still exists non-zero.

Thanks to Michael van Elst (mlelstv@) for the analysis
of the problem in the PR.

Should fix PR misc/33753.
2023-05-28 21:42:40 +00:00
lukem 81f726b0e0 pax: exit 0 if stdin filelist is used and empty
If copying a list of files from stdin, exit zero instead of non-zero
if there are no files supplied.

AFAICT, POSIX doesn't require a non-zero an error in this situation,
since there are no files to not match.

Fix from PR bin/41736 by Lloyd Parkes.
2023-05-28 17:01:46 +00:00
skrll 67743dc0d8 Second arg to fdt_memory_remove_range is a size so pass dtbsize and not
dtb + dtbsize
2023-05-28 12:56:56 +00:00
lukem 775257d3af deprecate remnants of MKCRYPTO
MKCRYPTO was removed by riastradh@ on 2017-05-22,
so remove references to it in comments.
2023-05-28 11:00:03 +00:00
lukem 5c5a9a025f bsd.own.mk: deprecate NOCRYPTO
MKCRYPTO was removed by riastradh@ on 2017-05-22,
so the NOCRYPTO override is now unnecessary.
2023-05-28 10:49:00 +00:00
lukem 09b4f93adb share/mk: finish USE_COMBINE, NOCOMBINE deprecation
Remove the leftover remnants of deprecated USE_COMBINE and NOCOMBINE,
as gcc -combine has been EOL for many years.

Completes the work done by maya@ on 2019-05-10 in bsd.kmodule.mk rev 1.61.
2023-05-28 10:33:13 +00:00
andvar a2dd66b846 s/Resture/Restore/ and s/restared/restarted/ in comments. 2023-05-28 08:21:24 +00:00
hannken b3a4996943 Add RUMPHIJACK option "blanket=/DEV" so mount_ffs may canonicalise
and mount the device path.  Cannot use "/rump/DEV" here as the device
path is embedded in "struct ufs_args" where it doesnt get hijacked.
2023-05-28 08:17:00 +00:00
andvar d7488b2d05 s/explcit/explicit/ in comment. 2023-05-28 08:09:34 +00:00
andvar 176f1e87ce s/sessoin/session/ in warning message. 2023-05-28 08:01:46 +00:00
mlelstv 7a42b63011 With the latest changes, pad(4) will return partial reads to allow a
more fine grained pacing of audio data. But this broke bta2dpd which
relied on full buffers returned (like reading from a file).

Replace the single read() in bta2dpd with a loop that fetches a full
buffer. This restores the old behaviour but loops in userland instead
of the kernel at the cost of a few extra system calls.
2023-05-28 07:59:17 +00:00
dholland 80d04161c0 In sys/param.h document that MAXPATHLEN includes space for a null byte.
Also note that it's the same as PATH_MAX. Reflow the comment.

Suggested by Thierry Laronde.
2023-05-28 06:21:00 +00:00
dholland 75411a3871 add a fortune 2023-05-28 03:35:24 +00:00
andvar e8fa8ba427 fix word endings toin -> tion in comments. 2023-05-27 21:38:06 +00:00
hgutch 18ffd308fa Explicitly run openssl's "gen" script in a shell
The script has permissions 755 in the repo but ends up with permissions
644 in the source sets, therefore we cannot invoke it simply as
path/to/gen .
2023-05-27 20:51:22 +00:00
andvar 95bdbe7c60 reapply changes for the built-in drop-privs support by tsarna.
this commit doesn't reapply "dumping of the unicast server list
to the DumpStateLog debugging output" enhancement.
It doesn't build anymore, no idea how to rewrite.
Should fix PR 57442. Needs pull-ups for netbsd-9, netbsd-10.
2023-05-27 17:58:58 +00:00
nat d42b5bde34 Revert to previous.
This change broke the intention of recent changes to pad(4).

The solution to address PR/57436 must be done in bta2dpd(8).
2023-05-27 14:51:47 +00:00
riastradh 4448c6469d openssl: Add missing sparc compat openssl engines to set list. 2023-05-27 10:12:11 +00:00
riastradh 7072e38764 openssl: Delete capi makefiles -- not likely to ever see use here. 2023-05-27 02:30:40 +00:00
riastradh aae5207d1c openssl: Nix capi.so engine -- it's for the Windows crypto API.
Not likely to work in NetBSD base!
2023-05-27 02:28:45 +00:00
riastradh 6c7ceb7a1b openssl: Fix typo in mips set list. 2023-05-27 00:09:06 +00:00