Commit Graph

301629 Commits

Author SHA1 Message Date
rin f598570bdb paxctl(8): Introduce -0 option to clear all PaX flag bits in ELF note.
Part of PR toolchain/52675
2023-06-23 01:56:21 +00:00
christos d375f34d40 fix sun2 2023-06-22 22:39:22 +00:00
rillig f8ab6e2320 tests/make: demonstrate inconsistency in pattern matching with ranges 2023-06-22 20:36:24 +00:00
rillig ce1173515b make: unclutter string matching code 2023-06-22 16:59:17 +00:00
rillig beecb5fe66 make: rename variables in string matching, remove redundant code
No functional change.
2023-06-22 16:32:09 +00:00
rillig ec19c40c90 lint: add query for comma operator 2023-06-22 13:57:44 +00:00
rillig 89f5cd4545 tests/make: fix line numbers in test result, since the previous commit 2023-06-22 13:02:42 +00:00
rillig 64136ea7a5 make: speed up pattern matching in the ':M' and ':N' modifiers
In the code coverage report, the highest count for Str_Match goes from
5,298,924 down to 79,646.
2023-06-22 12:59:54 +00:00
rillig eedba8df3f make: clean up comments related to pattern matching 2023-06-22 09:09:08 +00:00
rillig f8df28f589 make: merge common code for handling the ':M' and ':N' modifiers
No functional change.
2023-06-22 08:55:33 +00:00
nat 76ceaf88d3 Bump date for previous commit.
XXX pullup-10.
2023-06-22 01:35:12 +00:00
gutteridge 9a11c4231e 3RDPARTY: new versions of libuv, unbound, and nsd out 2023-06-21 22:30:52 +00:00
wiz c8799c5889 libedit: fix pkg-config to really provide readline directory as intended 2023-06-21 21:44:31 +00:00
sjg 79b14042b0 Cleanup guard tests
The .PARSEFILE:tA tests add no value, the correct form
is ${.PARSEDIR:tA}/${.PARSEFILE} but even there :tA rarely matters.
2023-06-21 21:21:52 +00:00
mrg 0406bf1d28 adjust for new fontconfig files. 2023-06-21 18:46:06 +00:00
rillig cb47d8fabf make: skip a file protected by a multiple-inclusion guard more often
In practice, the common situation is that a file is first included,
defines its multiple-inclusion guard and is then skipped instead of
being included again.

The other way round is that the multiple-inclusion guard is defined when
the file is included first.  In that case, the file is now regarded as
guarded as well.
2023-06-21 14:33:36 +00:00
rillig 36ab81f975 tests/make: document how wildcards behave in a dependency declaration 2023-06-21 12:27:50 +00:00
rillig 20a5d8cfe5 tests/make: clean up and extend tests for multiple-inclusion guards
Multiple-inclusion guards can be defined either as variables or as
targets.  Rename the variable tests so they include the word 'variable'.

Add tests to cover special characters in guard names (both variable and
target), just in case ParseVarnameGuard gets removed someday.

Document the pitfalls associated with choosing a naming scheme for
guards that leads to name clashes, such as with .PARSEFILE without
.PARSEDIR.
2023-06-21 12:16:31 +00:00
rillig 87a486936d tests/make: document a few tests 2023-06-21 07:30:50 +00:00
sjg e06cdfbde9 Allow guard targets to use variables.
I commonly use __${.PARSEDIR:tA}__ where a unique guard
is needed, __${.PARSEDIR}__ is also useful in many cases.

Combination of patch from rillig and mine
2023-06-21 04:20:20 +00:00
pgoyette 399bc09bd8 Looks like this debug library disappeared with the new heimdal. Mark
it obsolete to fix the MKDEBUGLIB build.
2023-06-21 02:48:49 +00:00
wiz c093f0b69f install pkg-config file for libedit
version number matches portable libedit
--cflags output matches portable libedit, since users probably want the
readline interface
2023-06-20 23:09:13 +00:00
riastradh ed4af7289b pam_krb5: Refuse to operate without a key to verify tickets.
New allow_kdc_spoof overrides this to restore previous behaviour
which was vulnerable to KDC spoofing, because without a host or
service key, pam_krb5 can't distinguish the legitimate KDC from a
spoofed one.

This way, having pam_krb5 enabled isn't dangerous even if you create
an empty /etc/krb5.conf to use client SSO without any host services.

Perhaps this should use krb5_verify_init_creds(3) instead, and
thereby respect the rather obscurely named krb5.conf option
verify_ap_req_nofail like the Linux pam_krb5 does, but:

- verify_ap_req_nofail is default-off (i.e., vulnerable by default),
- changing verify_ap_req_nofail to default-on would probably affect
  more things and therefore be riskier,
- allow_kdc_spoof is a much clearer way to spell the idea,
- this patch is a smaller semantic change and thus less risky, and
- a security change with compatibility issues shouldn't have a
  workaround that might introduce potentially worse security issues
  or more compatibility issues.

Perhaps this should use krb5_verify_user(3) with secure=1 instead,
for simplicity, but it's not clear how to do that without first
prompting for the password -- which we shouldn't do at all if we
later decide we won't be able to use it anyway -- and without
repeating a bunch of the logic here anyway to pick the service name.

References about verify_ap_req_nofail:
- mit-krb5 discussion about verify_ap_req_nofail:
  https://mailman.mit.edu/pipermail/krbdev/2011-January/009778.html
- Oracle has the default-secure setting in their krb5 system:
  https://docs.oracle.com/cd/E26505_01/html/E27224/setup-148.html
  https://docs.oracle.com/cd/E26505_01/html/816-5174/krb5.conf-4.html#REFMAN4krb5.conf-4
  https://docs.oracle.com/cd/E19253-01/816-4557/gihyu/
- Heimdal issue on verify_ap_req_nofail default:
  https://github.com/heimdal/heimdal/issues/1129
2023-06-20 22:17:18 +00:00
riastradh f9fe2f8c36 pam_ksu: No need for homedir access. 2023-06-20 22:17:09 +00:00
riastradh c4717c3f66 pam: Disable pam_krb5, pam_ksu by default.
These are not useful unless you also set up /etc/krb5.conf and a
keytab for the host from the Kerberos KDC.  But having them enabled
by default means that creating /etc/krb5.conf just to enable use of
Kerberos for _client-side_ single sign-on creates usability issues.

As proposed on tech-security:
https://mail-index.netbsd.org/tech-security/2023/06/16/msg001160.html
2023-06-20 22:00:00 +00:00
christos 23582e911e Use PROGDPLIBS instead of LDADD/DPADD; remove ui.c kludges 2023-06-20 17:23:01 +00:00
christos 65a6eb62ad Don't use the hcrypto version, use the OpenSSL one. 2023-06-20 17:22:01 +00:00
christos 9b6abc8760 Add hcrypto/ui.h to avoid -I gymnastics everywhere else 2023-06-20 16:49:46 +00:00
riastradh 695ce1f326 linux32_rt_sendsig: Memset zero before copyout.
Not sure if there's any padding here, but it's a pretty big
structure, fairly likely, so let's be rather safe than sorry.

XXX pullup-8
XXX pullup-9
XXX pullup-10
2023-06-20 15:22:15 +00:00
riastradh 46aa4c99e5 compat_ossaudio: Zero-initialize idat before copyout.
Unclear if there are any paths to the copyout without initialization,
but let's play it safe to keep the auditing effort low.

XXX pullup-8
XXX pullup-9
XXX pullup-10
2023-06-20 15:22:04 +00:00
riastradh bba2b2a5ee compat_sunos32: Memset zero before copyout.
Unclear if this can leak anything but let's be on the safe side.

XXX pullup-8
XXX pullup-9
XXX pullup-10
2023-06-20 15:21:55 +00:00
martin 982f63aa62 Obsolete ati_drv.so.19 and add .22 in the other md.* files affected
by the recentish X update.
2023-06-20 11:00:29 +00:00
rillig d7881bb6ea make: allow targets to be used as multiple-inclusion guards
This style is used by FreeBSD, among others.
2023-06-20 09:25:33 +00:00
rin 8fcaa3fb5f nc(1): Declare and initialize ``on'' ifdef SO_BINDANY. NFC yet for us. 2023-06-20 08:51:24 +00:00
rin 3827b167b3 ``int i'' is used only for SUPPORT_NFS || SUPPORT_TFTP. 2023-06-20 07:46:03 +00:00
mrg 6913120ff0 re-fix the previous - i had only fixed one case, not the general one.
guard the .BEGIN: rule with:

   .if !make(clean) && !make(cleandir) && !make(distclean) && !make(obj)

so that it doesn't trigger in cases where we don't expect the objdir
to exist already, or we don't want to be adding things while we're
cleaning them out.
2023-06-20 07:17:11 +00:00
mrg 1a2bd47ea1 don't try to setup things in objdir before it exists. 2023-06-20 05:06:04 +00:00
nat 816dd7c3bd Manual page fixups.
Fix EXAMPLES section.

Use correct flags when used with pad(4).
Use correct encoding format (sinear_le).

XXX pullup-10.
2023-06-20 03:24:08 +00:00
mrg 32f4e6acb7 update for fontconfig 2.14.2. 2023-06-20 02:25:19 +00:00
gutteridge 8960a02553 npflog.4: add a man page for the npflog device
Addresses PR misc/57441 from Taylor R Campbell. (Not yet hooked into
source sets, will be done separately.)

(Borrows heavily from the equivalent pflog.4 man page already in tree,
and so retains the original copyright attribution as well.)
2023-06-20 01:02:46 +00:00
mrg 02952e8c1c XXX stop gap to fix the builds in a way that doesn't make them useless.
it does build "ui.c" a large number of times into individual places.
in the libraries, they're force to local symbols, and in the binaries
it doesn't really matter.
2023-06-20 00:30:16 +00:00
mrg a4ccfd02eb fix missing header issues.
might seems to have an undef symbol issue in libkrb5.so:
hc_UI_UTIL_read_pw_string
2023-06-19 23:56:55 +00:00
christos e2a3a913a6 Adjust the build to include ui.c from hcrypto. 2023-06-19 23:11:43 +00:00
christos 3120d7d64c need the hcrypto/ui.h header for UI_UTIL_read_pw_string/UI_UTIL_FLAG_VERIFY* 2023-06-19 23:10:48 +00:00
christos 342b5ab386 new Heimdal 2023-06-19 21:44:37 +00:00
christos afab4e300d Merge differences between 7.7.0 and 7.8.0 2023-06-19 21:41:38 +00:00
christos dd75ac5b44 Import heimdal-7.8.0 (previous was 7.7.0)
This release includes both the Heimdal 7.7.1 Security Vulnerability
fixes and non-Security bug fixes/improvements.

Security Vulnerabilities:
- CVE-2022-42898 PAC parse integer overflows
- CVE-2022-3437 Overflows and non-constant time leaks in DES{,3} and arcfour
- CVE-2022-41916 Fix Unicode normalization read of 1 bytes past end of array
- CVE-2021-44758 A null pointer de-reference DoS in SPNEGO acceptors
- CVE-2021-3671 A null pointer de-reference when handling missing sname
  in TGS-REQ
- CVE-2022-44640 Heimdal KDC: invalid free in ASN.1 codec
  Note that CVE-2022-44640 is a severe vulnerability, possibly a 10.0
  on the Common Vulnerability Scoring System (CVSS) v3, as we believe
  it should be possible to get an RCE on a KDC, which means that
  credentials can be compromised that can be used to impersonate
  anyone in a realm or forest of realms.

  Heimdal's ASN.1 compiler generates code that allows specially
  crafted DER encodings of CHOICEs to invoke the wrong free function
  on the decoded structure upon decode error. This is known to impact
  the Heimdal KDC, leading to an invalid free() of an address partly
  or wholly under the control of the attacker, in turn leading to a
  potential remote code execution (RCE) vulnerability.

  This error affects the DER codec for all extensible CHOICE types
  used in Heimdal, though not all cases will be exploitable. We have
  not completed a thorough analysis of all the Heimdal components
  affected, thus the Kerberos client, the X.509 library, and other
  parts, may be affected as well.

  This bug has been in Heimdal's ASN.1 compiler since 2005, but it may
  only affect Heimdal 1.6 and up. It was first reported by Douglas
  Bagnall, though it had been found independently by the Heimdal
  maintainers via fuzzing a few weeks earlier.

  While no zero-day exploit is known, such an exploit will likely be
  available soon after public disclosure.
- CVE-2019-14870: Validate client attributes in protocol-transition
- CVE-2019-14870: Apply forwardable policy in protocol-transition
- CVE-2019-14870: Always lookup impersonate client in DB

Other changes:
- Bugs found by UBSAN (including the incorrect encoding of unconstrained
  INTEGER value -1).
- Errors found by the LLVM scan-build static analyzer.
- Errors found by the valgrind memory debugger.
- Work around GCC Bug 95189 (memcmp wrongly stripped like strcmp).
- Correct ASN.1 OID typo for SHA-384
- Fix a deadlock in in the MEMORY ccache type.
- TGS: strip forwardable and proxiable flags if the server is
  disallowed.
- CVE-2019-14870: Validate client attributes in protocol-transition
- CVE-2019-14870: Apply forwardable policy in protocol-transition
- CVE-2019-14870: Always lookup impersonate client in DB
- Incremental HDB propagation improvements
  Refactor send_diffs making it progressive
  Handle partial writes on non-blocking sockets
  Disable Nagle in iprop master and slave
  Use async I/O
  Don't send I_HAVE in response to AYT
  Do not recover log in kadm5_get_principal()
  Don't send diffs to slaves with not yet known version
  Don't stutter in send_diffs
- Optional backwards-compatible anon-pkinit behavior
2023-06-19 21:33:04 +00:00
rillig 12c71db15f tests/make: test triple negation in '.ifndef' 2023-06-19 20:44:06 +00:00
rillig 2c31888746 make: sort files in coverage report alphabetically 2023-06-19 20:14:45 +00:00
rillig f015d63135 make: add tests for full code coverage of multiple-inclusion guards 2023-06-19 20:07:35 +00:00