Link [ NetBSD | NetBSD OpenGrok source search | PR fulltext-search | Summary of daily snapshot builds | history of daily build result | pkgsrc commit viewer ]


   
        usage: [branch:branch] [user:user] [path@revision] keyword [... [-excludekeyword [...]]] (e.g. branch:MAIN sys/arch/arm, if_wm.c@1.234 )




switch to index mode

recent branches: MAIN (2h)  netbsd-8 (5d)  netbsd-10 (5d)  netbsd-9 (11d)  thorpej-ifq (175d)  thorpej-altq-separation (178d) 

2024-05-10 06:14:51 UTC Now

2021-01-16 23:51:51 UTC MAIN commitmail json YAML

remove unused "_DIAGNOSTIC" option and opt_diagnostic.h.
note that this is unrelated to the widely used "DIAGNOSTIC" option.

(chs)

2021-01-16 23:50:49 UTC MAIN commitmail json YAML

remove a const to allow building with QUEUEDEBUG.

(chs)

2021-01-16 23:19:50 UTC MAIN commitmail json YAML

Instead of defining VCONS_DONT_READ as the raw value of 0x30, instead
define it as (VCONS_NO_COPYCOLS|VCONS_NO_COPYROWS) for clarify. NFC.

(jmcneill)

2021-01-16 22:18:14 UTC MAIN commitmail json YAML

lint: remove custom stdbool.h for strict bool mode again

Adding it broke the official builds.

(rillig)

2021-01-16 21:05:15 UTC MAIN commitmail json YAML

2021-01-16 20:49:31 UTC MAIN commitmail json YAML

2021-01-16 20:33:32 UTC MAIN commitmail json YAML

2021-01-16 20:30:37 UTC MAIN commitmail json YAML

Add PPP_BSDCOMP, PPP_DEFLATE, PPP_FILTER options

(jmcneill)

2021-01-16 20:30:05 UTC MAIN commitmail json YAML

add directory /usr/libdata/lint/strict-bool

This is needed for usr.bin/xlint/xlint.

(rillig)

2021-01-16 20:29:16 UTC MAIN commitmail json YAML

Add UFS_ACL and UFS_EXTATTR options

(jmcneill)

2021-01-16 20:27:29 UTC MAIN commitmail json YAML

Add QUOTA and QUOTA2 options

(jmcneill)

2021-01-16 20:26:25 UTC MAIN commitmail json YAML

2021-01-16 19:11:36 UTC MAIN commitmail json YAML

lint: refactor strict bool mode and improve comments

The previous comment above typeok_strict_bool_compatible was too hard to
understand.

(rillig)

2021-01-16 19:03:47 UTC MAIN commitmail json YAML

lint: in strict bool mode, perform the normal checks as well

(rillig)

2021-01-16 18:58:22 UTC MAIN commitmail json YAML

2021-01-16 18:48:52 UTC MAIN commitmail json YAML

2021-01-16 18:46:59 UTC MAIN commitmail json YAML

lint: simplify typeok_strict_bool_assign

When that function is called, the nodes are already before_conversion.

(rillig)

2021-01-16 17:54:22 UTC MAIN commitmail json YAML

2021-01-16 16:58:39 UTC MAIN commitmail json YAML

lint: add test for missing check in strict bool mode

(rillig)

2021-01-16 16:53:24 UTC MAIN commitmail json YAML

lint: replace integer constant expressions with true and false

LINTFLAGS=-gST make lint, with manual review.

The error messages from lint are all correct, they are not complete
though.  The return value of a function returning bool may still be
compared to the integer 0.

(rillig)

2021-01-16 16:03:47 UTC MAIN commitmail json YAML

lint: in strict bool mode, integer constants do not have type bool

Previously, lint1 allowed integer constants such as 0 and 1 to be used
as bool constants.  This was only half-baked since after fixing all
error messages from that strict mode, there may still be integer
literals in the code that should be replaced with true or false.  This
would stop a migration from int to bool in the middle, leaving
inconsistent code around.

To find the remaining type inconsistencies, treat integers and bool as
completely incompatible, even for compile time constants.

(rillig)

2021-01-16 15:35:28 UTC MAIN commitmail json YAML

2021-01-16 15:34:37 UTC MAIN commitmail json YAML

ID_AA64PFR0_EL1.GIC=0 means that the CPU interface system registers are
not implemented. This does not necessarily mean that there is no GIC in the
system, as GICv2 uses MMIO instead of system registers for the CPU
interface.

While here, add description for GIC=3, which means that the v4.1 system
register interface is supported.

(jmcneill)

2021-01-16 15:26:23 UTC MAIN commitmail json YAML

2021-01-16 15:02:12 UTC MAIN commitmail json YAML

lint: prepare to make strict bool mode even stricter

Currently, strict bool mode still allows integer constant expressions to
be converted implicitly to bool.  This is something that other languages
such as Go, Java, C#, Pascal don't allow.

By providing a custom implementation of <stdbool.h> that defines false
and true to custom bool constant identifiers, lint will cover these
cases as well.

To prepare for this, reword the rules and restructure the tests in
d_c99_bool_strict.c.

(rillig)

2021-01-16 12:57:37 UTC MAIN commitmail json YAML

2021-01-16 09:09:37 UTC MAIN commitmail json YAML

oops, fix mistake in previous commit. removed unwanted member that had been added.

(ryo)

2021-01-16 02:40:03 UTC MAIN commitmail json YAML

lint: replace 0 and 1 with false and true, where appropriate

Change in behavior: Passing the option -h exactly 4294967296 times or
any multiple thereof is no longer equivalent to passing it never at all,
it is now equivalent to passing it once.  See main2.c, hflag++ for the
actual change.

Other than that, no functional change intended.

A very large portion of the code already conformed to the requirements
of the strict bool mode.  The only missing thing was using the constant
literals false and true instead of 0 and 1.  For sure there are some
integer literals left that can be converted.  For now, all literals that
appeared in the form " = 0" or " = 1" have been replaced.

(rillig)

2021-01-16 02:21:26 UTC MAIN commitmail json YAML

entropy: Record number of time and data samples for userland.

This more or less follows the semantics of the RNDGETESTNUM and
RNDGETESTNAME ioctls to restore useful `rndctl -lv' output.

Specifically: We count the number of time or data samples entered
with rnd_add_*.  Previously it would count the total number of 32-bit
words in the data, rather than the number of rnd_add_* calls that
enter data, but I think the number of calls makes more sense here.

(riastradh)

2021-01-16 02:20:00 UTC MAIN commitmail json YAML

entropy: Sample cycle counter or timecounter in hardclock.

Only do so when we're short on entropy, in order to minimize
performance impact.

The sampling should stay close to the time of the actual hardclock
timer interrupt, so that the oscillator driving it determines when we
sample the cycle counter or timecounter, which we hope is driven by
an independent oscillator.

If we used a callout, there might be many other influences -- such as
spin lock delays possibly synchronized with this core's cycle counter
-- that could get between the timer interrupt and the sample.

In the glorious tickless future, this should instead be wired up to
the timer interrupt handler, however that manifests in the future
tickless API.

(riastradh)

2021-01-16 01:47:23 UTC MAIN commitmail json YAML

Note that TPM 1.2 devices can attach to ACPI, as well.

(thorpej)

2021-01-16 01:43:42 UTC MAIN commitmail json YAML

Enable tpm @ acpi (now that it can match TPM 1.2 devices, which are not,
as the comment implies, experimental).

(thorpej)

2021-01-16 01:23:04 UTC MAIN commitmail json YAML

Match PNP0C31 as a TPM 1.2 device.  Works on my ThinkPad X260, and
eliminates the last of the devices that attach to "isa".

(thorpej)

2021-01-16 00:43:04 UTC MAIN commitmail json YAML

Add missing printing-of-newlines in the attach routine.

(thorpej)

2021-01-16 00:09:28 UTC MAIN commitmail json YAML

lint: fix LINTFLAGS for lint2

These have never worked since they report a syntax error in
<sys/cdefs.h> just because there is an __inline over there.

I wonder why it has been necessary at all to have custom LINTFLAGS for
lint itself.  It's just an ordinary program.

(rillig)

2021-01-15 23:58:18 UTC MAIN commitmail json YAML

2021-01-15 23:43:51 UTC MAIN commitmail json YAML

2021-01-15 23:19:33 UTC MAIN commitmail json YAML

2021-01-15 23:15:28 UTC MAIN commitmail json YAML

2021-01-15 23:11:59 UTC MAIN commitmail json YAML

2021-01-15 23:02:38 UTC MAIN commitmail json YAML

2021-01-15 23:02:07 UTC MAIN commitmail json YAML

use fdtbus_intr_establish_xname

(jmcneill)

2021-01-15 22:59:50 UTC MAIN commitmail json YAML

2021-01-15 22:58:49 UTC MAIN commitmail json YAML

2021-01-15 22:47:33 UTC MAIN commitmail json YAML

2021-01-15 22:35:40 UTC MAIN commitmail json YAML

2021-01-15 22:07:54 UTC MAIN commitmail json YAML

2021-01-15 22:04:27 UTC MAIN commitmail json YAML

2021-01-15 21:14:53 UTC MAIN commitmail json YAML

Install image built with all of MKDEBUG, MKKDEBUG, and MKDEBUGLIB all
set to "yes" is a bit larger, so bump the image size accordingly.

(pgoyette)

2021-01-15 20:50:49 UTC MAIN commitmail json YAML

2021-01-15 18:42:41 UTC MAIN commitmail json YAML

2021-01-15 17:47:48 UTC netbsd-9 commitmail json YAML

2021-01-15 17:46:40 UTC netbsd-9 commitmail json YAML

Pull up following revision(s) (requested by knakahara in ticket #1185):

share/man/man9/pci_msi.9: revision 1.18

Fix PR kern/55920 .  Add pci_msi_count() and pci_msix_count() description.

(martin)

2021-01-15 17:17:05 UTC MAIN commitmail json YAML

2021-01-15 15:54:20 UTC MAIN commitmail json YAML

rnd(4): Fix formatting of authors paragraph with `.An -nosplit'.

(riastradh)

2021-01-15 15:18:32 UTC MAIN commitmail json YAML

Tweak wording for consistency: `if empty or not set', not `if unset'.

(riastradh)

2021-01-15 15:17:09 UTC MAIN commitmail json YAML

Clarify that `entropy' may be left unset in rc.conf.

(riastradh)

2021-01-15 14:07:15 UTC MAIN commitmail json YAML

- Match 400-, 495-, and 500-series controllers.
- Apply OpenBSD rev 1.38, which ignores the SMBALERT# interrupt that
  fires spuriously on some systems (ignored by Linux and FreeBSD, as
  well).

(thorpej)

2021-01-15 05:34:49 UTC MAIN commitmail json YAML

Improve error messages.
- prefix MD device name if it's considered to be related to the MD driver.
- revise some messages.

(isaki)

2021-01-15 04:09:28 UTC MAIN commitmail json YAML

Change (harmless) zero-length debug messages.
sys/modules is compiled with -Wzero-length-format and this
makes sys/modules compilable even if AUDIO_DEBUG is defined.

(isaki)

2021-01-15 03:51:41 UTC MAIN commitmail json YAML

Remove unused LIMITCHECK() macro (now contained in netbsd32_rlimit.c).

(simonb)

2021-01-15 00:38:23 UTC MAIN commitmail json YAML

2021-01-14 23:32:12 UTC MAIN commitmail json YAML

Initial attempt at documenting the KERNEL_DIR option.

XXX EXPERIMENTAL, Work-In-Progress ! XXX

(pgoyette)

2021-01-14 23:30:50 UTC MAIN commitmail json YAML

Remove some blank lines to group the VND and FSS ioctls together.

(simonb)

2021-01-14 22:18:14 UTC MAIN commitmail json YAML

2021-01-14 19:11:48 UTC MAIN commitmail json YAML

Update sets lists to accomodate KERNEL_DIR.  When both KERNEL_DIR and
MKDEBUG are defined, we create an empty $DESTDIR/usr/libdata/debug/netbsd/
directory.

Should fix ``build.sh release'' issue reported in kern/55923

XXX Since nothing ever seems to populate this directory, perhaps we should
XXX simply prevent its creation?  If we do create it, should its creation
XXX perhaps be conditioned on MKKDEBUG rather than MKDEBUG?

XXX There is still another problem with ``build.sh install-image'' but I
XXX open a new PR for that.

(pgoyette)

2021-01-14 19:07:03 UTC MAIN commitmail json YAML

2021-01-14 14:38:22 UTC MAIN commitmail json YAML

Use acpi_dsm() in acpi_usb_post_reset().

(thorpej)

2021-01-14 14:37:17 UTC MAIN commitmail json YAML

In acpi_pci_ignore_boot_config(), use acpi_dsm() and add some comments
describing the (somewhat confusing) semantics of the _DSM method used
here.

(thorpej)

2021-01-14 14:35:53 UTC MAIN commitmail json YAML

- Add a new routine, acpi_pack_compat_list(), that packs the _HID
  and _CID device ID strings into an OpenFirmware-like string list,
  analogous to how the "compatible" property is represented in
  OpenFirmware and the Device Tree specifications.
- Add generic routines for evaluating Device Specific Methods (_DSM).

(thorpej)

2021-01-14 08:22:51 UTC MAIN commitmail json YAML

Handle the KFILTER_BYFILTER and KFILTER_BYNAME ioctls for compat32.
Passes "atf kernel/kqueue/t_ioctl".

(simonb)

2021-01-14 08:00:45 UTC MAIN commitmail json YAML

Handle FSSIOCSET and FSSIOCGET; vndconfig(8) works with compat32 now.
XXX: FSSIOCSET50 and FSSIOCGET50 are not (yet) handled.

(simonb)

2021-01-14 07:42:31 UTC MAIN commitmail json YAML

lint: add type details to message for enum type mismatch

Before December 2020, it was cumbersome to add type information to a
message since the caller had to explicitly allocate buffers for the type
names.  That's probably the reason why this crucial detail had been left
out of the warning.

(rillig)

2021-01-14 07:34:48 UTC MAIN commitmail json YAML

lint: fix enum type in the lexical analysis part

Detected by Clang, reported by riastradh:

> scan.l:144:29: error: implicit conversion from enumeration type
>  'tspec_t' to different enumeration type 'op_t'
> return operator(T_ASTERISK, NOTSPEC);
>        ~~~~~~~~            ^~~~~~~

and by lint as well, with a less detailed and less helpful message:

> scan.l(144): warning: enum type mismatch, arg #2 [156]

Since scan.c is generated from scan.l, it is not included in the default
"make lint" though.

The value of these two constants is the same, furthermore that value is
never actually used in the code, therefore no functional change.

(rillig)

2021-01-14 05:47:35 UTC MAIN commitmail json YAML

Add "TX " to "Queue No Descriptor Available" to make it more understandable.

(msaitoh)

2021-01-14 04:30:40 UTC MAIN commitmail json YAML

Unmount and unconfigure in the reverse order that they were done.  Fixes
problem with leaving a dangling snapshot configured.

(simonb)

2021-01-14 02:51:52 UTC MAIN commitmail json YAML

Handle rev 1.62 of kern/sys_lwp.c
  make _lwp_park return the remaining time to sleep in the "ts" argument
  if it is a relative timestamp, as discussed in tech-kern.
for compat32.  Thanks skrll@ for some cleanup tips.

(simonb)

2021-01-14 02:43:04 UTC MAIN commitmail json YAML

Use netbsd32_* types instead of relying on __packed in the vnd ioctl
structures.  __packed didn't work on archs where 64-bit types were
64-bit aligned with a 32-bit ABI (eg MIPS n32).

OK mrg@

(simonb)

2021-01-13 23:54:21 UTC MAIN commitmail json YAML

/dev/random: Fix nonblocking read.

The flag passed to cdev_read is IO_NDELAY, not FNONBLOCK/O_NONBLOCK,
and although the latter two coincide, IO_NDELAY has a different
value.

(riastradh)

2021-01-13 23:53:23 UTC MAIN commitmail json YAML

entropy: Use a separate condvar for rndsource list lock.

Otherwise, two processes both waiting for entropy will dance around
waking each other up (by releasing the rndsource list lock) and going
back to sleep (waiting for entropy).

Witnessed on the armv7 testbed when /etc/security presumably ran
twice over a >day-long test, until the metaphorical plug got pulled:

net/if_ipsec/t_ipsec_natt (509/888): 2 test cases
    ipsecif_natt_transport_null: [ 37123.2631856] entropy: pid 1005 (dd) blocking due to lack of entropy
[256.523317s] Failed: atf-check failed; see the output of the test for details
    ipsecif_natt_transport_rijndaelcbc: [274.370791s] Failed: atf-check failed; see the output of the test for details
[532.486697s]
...
    puffs_lstat_symlink: [ 123442.1606517] entropy: pid 9499 (dd) blocking due to lack of entropy
[ 123442.1835067] entropy: pid 1005 (dd) blocking due to lack of entropy
[ 123442.1944600] entropy: pid 9499 (dd) blocking due to lack of entropy
[ 123442.1944600] entropy: pid 1005 (dd) blocking due to lack of entropy
...

(riastradh)

2021-01-13 19:46:49 UTC MAIN commitmail json YAML

Fix for virtios viomb memory balloon driver. The inflate_done() and
deflate_done() issued a wrong extent to bus_dmamap_sync() giving rise to
panics on aarch64s mmio backend.

(reinoud)

2021-01-13 17:01:31 UTC MAIN commitmail json YAML

2021-01-13 16:42:17 UTC MAIN commitmail json YAML

in pmap_writetext(), restore the context also when we return early.

(chs)

2021-01-13 15:51:49 UTC MAIN commitmail json YAML

If an option is not found in the standard table, log it and don't try to
dereference it. This prevents crashes from XenServer VM that PXE boots and
includes option 175 in the DHCP request. Reported by Stephen Borrill.

(christos)

2021-01-13 07:36:56 UTC MAIN commitmail json YAML

2021-01-13 07:34:37 UTC MAIN commitmail json YAML

Improve english in a comment

(skrll)

2021-01-13 06:44:55 UTC MAIN commitmail json YAML

skip sigbus_adraln on MIPS

(skrll)

2021-01-13 06:39:47 UTC MAIN commitmail json YAML

Don't advertise AUDIO_PROP_CAPTURE - no capture method is provided

[  1.0000000] audio0 at vraiu0: missing capture method

(skrll)

2021-01-13 05:21:34 UTC MAIN commitmail json YAML

entropy(7): Add missing URL to reference.

(riastradh)

2021-01-13 02:20:15 UTC MAIN commitmail json YAML

threadpool(9): Tidy up thread naming.

- `dispatcher', not `overseer' -- much more appropriate metaphor.
- Just omit `/-1' from unbound thread names.
- Just omit `@-1' from dynamic-priority (PRI_NONE) thread names.

(riastradh)

2021-01-13 02:19:09 UTC MAIN commitmail json YAML

threadpool(9): Make threadpool_percpu_ref_remote non-sleepable.

Needed for threadpool-based workqueue_enqueue to run in interrupt
context.

(riastradh)

2021-01-12 21:48:10 UTC MAIN commitmail json YAML

lint: update usage for lint1 and lint2

(Forgotten in the previous commit.)

(rillig)

2021-01-12 20:42:01 UTC MAIN commitmail json YAML

lint: add new check for strict bool mode

In strict bool mode, bool is considered incompatible with all other
scalar types, just as in Java, C#, Pascal.

The controlling expressions in if statements, while loops, for loops and
the '?:' operator must be of type bool.  The logical operators work on
bool instead of int, the bitwise operators accept both integer and bool.
The arithmetic operators don't accept bool.

Since <stdbool.h> implements bool using C preprocessor macros instead of
predefining the identifiers "true" and "false", the integer constants 0
and 1 may be used in all contexts that require a bool expression.
Except from these, no implicit conversion between bool and scalar types
is allowed.

See usr.bin/tests/xlint/lint1/d_c99_bool_strict.c for more details.

The command line option -T has been chosen because all obvious choices
(-b or -B for bool, -s or -S for strict) are already in use.  The -T may
stand for "types are checked strictly".

The default behavior of lint doesn't change.  The strict bool check is
purely optional.

An example program for strict bool mode is usr.bin/make, which has been
using explicit comparisons such as p != NULL, ch != '\0' or n > 0 in
most places for a long time now, even before the refactoring in 2020.

(rillig)

2021-01-12 19:36:39 UTC MAIN commitmail json YAML

Typo in comment

(skrll)

2021-01-12 14:21:18 UTC MAIN commitmail json YAML

Don't use arc4random for the tools build on NetBSD either.
compat_defs.h explicitly forces _POSIX_SOURCE and this hides the
prototype in stdlib.h.

(joerg)

2021-01-12 08:03:19 UTC MAIN commitmail json YAML

Turn on DIAGNOSTIC to help track down problem in hpcmips test runs

(skrll)

2021-01-12 05:08:50 UTC MAIN commitmail json YAML

Fix PR kern/55920 .  Add pci_msi_count() and pci_msix_count() description.

(knakahara)

2021-01-11 22:02:29 UTC MAIN commitmail json YAML

2021-01-11 22:01:15 UTC MAIN commitmail json YAML

Fix spelling of preferred in comments.  While here improve grammar in
one of the comments.

(skrll)

2021-01-11 21:58:31 UTC MAIN commitmail json YAML

2021-01-11 21:51:20 UTC MAIN commitmail json YAML

Correct the spelling of preferred.

(skrll)

2021-01-11 21:45:22 UTC MAIN commitmail json YAML

Make this compile without -DINET6 (Kurt Schreiner)

(christos)

2021-01-11 20:31:34 UTC MAIN commitmail json YAML

Only try to create up-to NAME_MAX filenames.
XXX: this should be moved to stdio/t_mktemp.c where the rest of the tests
are and the code lives.

(christos)

2021-01-11 20:04:01 UTC MAIN commitmail json YAML

lint: split typeok into several functions

(rillig)

2021-01-11 19:29:49 UTC MAIN commitmail json YAML

2021-01-11 17:18:51 UTC MAIN commitmail json YAML

Trailing whitespace

(skrll)

2021-01-11 17:12:13 UTC MAIN commitmail json YAML

2021-01-11 17:00:19 UTC MAIN commitmail json YAML

Tidy up more error handling confusion

(skrll)

2021-01-11 16:48:35 UTC MAIN commitmail json YAML

2021-01-11 16:48:03 UTC MAIN commitmail json YAML

Trailing whitespace

(skrll)

2021-01-11 07:49:05 UTC MAIN commitmail json YAML

For "ps/a" print all of p_comm instead of just the first 10 chars, add a
space after PID, left justify the command name.

(simonb)

2021-01-11 07:17:49 UTC MAIN commitmail json YAML

PR/55715: pmax testbed panics with "assertion "asid == curcpu()->ci_pmap_asid_cur" failed"

It's GXemul that has the bug! Unfortunately, there's no way (currently) to
detect if we're running under GXemul emulation, so disable for all mips
for now.  Hopefully, GXemul will get fixed soon.

(skrll)

2021-01-11 06:12:43 UTC MAIN commitmail json YAML

in pgt_page_alloc(), wait and retry the page allocation if PR_WAITOK.
fixes PR 55895.

(chs)

2021-01-11 02:18:40 UTC MAIN commitmail json YAML

entropy: Downgrade consolidation warning from printf to LOG_DEBUG.

Candidate fix for PR kern/55458.  This message is rather technical,
and so is unlikely to be acted on by anyone not debugging the kernel
anyway.  Most likely, on any system where it is a real problem, there
will be another (less technical) entropy warning anyway.

(riastradh)

2021-01-11 00:28:28 UTC MAIN commitmail json YAML

lint: extend test for strict _Bool handling

There is no danger in allowing (flags & FLAG) as a controlling
expression, provided that it is immediately compared to zero, such as in
an if statement or as the operand of a logical operator.

(rillig)

2021-01-10 23:59:53 UTC MAIN commitmail json YAML

make(1): make a few more bool expressions more precise

The previous version of lint(1) from a few hours ago didn't catch all
occurrences.  And even the current one doesn't catch everything.
Function arguments and return types still need some work.  The "return
quietly" from shouldDieQuietly still implicitly converts from int to
_Bool.

No functional change.

(rillig)

2021-01-10 23:24:26 UTC MAIN commitmail json YAML

Various entropy integration improvements.

- New /etc/security check for entropy in daily security report.

- New /etc/rc.d/entropy script runs (after random_seed and rndctl) to
  check for entropy at boot -- in rc.conf, you can:

  . set `entropy=check' to halt multiuser boot and enter single-user
    mode if not enough entropy

  . set `entropy=wait' to make multiuser boot wait until enough entropy

  Default is to always boot without waiting -- and rely on other
  channels like security report to alert the operator if there's a
  problem.

- New man page entropy(7) discussing the higher-level concepts and
  system integration with cross-references.

- New paragraph in afterboot(8) about entropy citing entropy(7) for
  more details.

This change addresses many of the issues discussed in security/55659.
This is a first draft; happy to take improvements to the man pages and
scripted messages to improve clarity.

I considered changing motd to include an entropy warning with a
reference to the entropy(7) man page, but it's a little trickier:
- Not sure it's appropriate for all users to see at login rather than
  users who have power to affect the entropy estimate (maybe it is,
  just haven't decided).
- We only have a mechanism for changing once at boot; the message would
  remain until next boot even if an operator adds enough entropy.
- The mechanism isn't really conducive to making a message appear
  conditionally from boot to boot.

(riastradh)

2021-01-10 21:45:50 UTC MAIN commitmail json YAML

lint: add enum flags to the test about strict boolean mode

(rillig)

2021-01-10 21:26:12 UTC MAIN commitmail json YAML

lint: allow custom flags to be specified in all unit tests

Previously, only the tests called msg_*.c could use this feature.  Since
it is useful for other tests as well, enable it everywhere.

(rillig)

2021-01-10 21:20:47 UTC MAIN commitmail json YAML

make(1): consistently use boolean expressions in conditions

Most of the make code already followed the style of explicitly writing
(ptr != NULL) instead of the shorter (ptr) in conditions.

The remaining 50 instances have been found by an experimental,
unpublished check in lint(1) that treats bool expressions as
incompatible to any other scalar type, just as in Java, C#, Pascal and
several other languages.

The only unsafe operation on Boolean that is left over is (flags &
FLAG), for an enum implementing a bit set.  If Boolean is an ordinary
integer type (the default), some high bits may get lost.  But if Boolean
is the same as _Bool (by compiling with -DUSE_C99_BOOLEAN), C99 6.3.1.2
defines that a conversion from any scalar to the type _Bool acts as a
comparison to 0, which cannot lose any bits.

(rillig)

2021-01-10 20:46:14 UTC MAIN commitmail json YAML

PR/55715: pmax testbed panics with "assertion "asid == curcpu()->ci_pmap_asid_cur" failed"

disable the sigbus_adraln test on qemu for now

(skrll)

2021-01-10 19:26:32 UTC MAIN commitmail json YAML

rc.subr(8): Fix markup -- use .It to set off a new item.

(riastradh)

2021-01-10 19:20:16 UTC MAIN commitmail json YAML

Disable nouveau for now. It can cause long pauses at boot and sometimes
fails to initialize the display at all.

(jmcneill)

2021-01-10 18:22:52 UTC MAIN commitmail json YAML

lint: split check_global_variable into several functions

This reduces the indentation and allows the messages in the comments to
contain the complete text instead of only an abbreviated prefix.

No functional change.

(rillig)

2021-01-10 18:13:43 UTC MAIN commitmail json YAML

2021-01-10 18:06:39 UTC MAIN commitmail json YAML

2021-01-10 17:43:46 UTC MAIN commitmail json YAML

lint: add test for treating _Bool as non-scalar type

This strict mode is not yet implemented.  The plan is to use it for
usr.bin/make, to get rid of the many possible variants of defining the
Boolean type in make.h.  These variants did find some bugs, but not
reliably so.  Using static analysis seems more promising for this.

In an early stage of developing this test, lint1 crashed in the enum
definition in line 213, where the node for the '?:' had been NULL.  This
can happen in other situations as well, such as with syntax errors, but
these should be rare, as lint is usually only run if the compiler has
accepted the source code.  Still, there should not be any assertion
failures while running lint1.

(rillig)

2021-01-10 15:50:16 UTC MAIN commitmail json YAML

Add whitespace after comma

(ryoon)

2021-01-10 14:12:48 UTC MAIN commitmail json YAML

lint: remove redundant parentheses around return value

(rillig)

2021-01-10 14:09:57 UTC MAIN commitmail json YAML

lint: change return type of eqptrtype to bool

(rillig)

2021-01-10 14:07:34 UTC MAIN commitmail json YAML

2021-01-10 13:54:13 UTC MAIN commitmail json YAML

lint: use message 232 for unused label in function

This message had been defined but not used before.

(rillig)

2021-01-10 13:44:57 UTC MAIN commitmail json YAML

Explicitly cast offset calculation, size_t may be smaller than off_t.

(martin)

2021-01-10 13:17:44 UTC MAIN commitmail json YAML

Fix a typo in debug message

(ryoon)

2021-01-10 13:17:24 UTC MAIN commitmail json YAML

lint: explain missing error for _Bool constant expressions

(rillig)

2021-01-10 12:46:38 UTC MAIN commitmail json YAML

2021-01-10 12:38:41 UTC MAIN commitmail json YAML

2021-01-10 12:34:56 UTC MAIN commitmail json YAML

2021-01-10 12:29:46 UTC MAIN commitmail json YAML

lint: add test for converting non-constant expressions to _Bool

(rillig)

2021-01-10 12:05:07 UTC MAIN commitmail json YAML

lint: automate adding a test for lint1

(rillig)

2021-01-10 11:24:43 UTC MAIN commitmail json YAML

2021-01-10 11:17:53 UTC MAIN commitmail json YAML

2021-01-10 00:58:56 UTC MAIN commitmail json YAML

Print rd(4) capacity and geometry info as sd(4) and wd(4) do.

Before:
rd0 at hpibbus1 slave 0 punit 0: 7937H
rd0: 698 cylinders, 13 heads, 1116102 blocks, 512 bytes/block

After:
rd0 at hpibbus1 slave 0 punit 0: 7937H
rd0: 544 MB, 698 cyl, 13 head, 123 sec, 512 bytes/block x 1116102 blocks

(tsutsui)

2021-01-10 00:12:50 UTC MAIN commitmail json YAML

lint: remove redundant braces in is_confusing_precedence

This nicely aligns the different branches, in which "l" and "r" are
swapped.

No functional change.

(rillig)

2021-01-10 00:05:46 UTC MAIN commitmail json YAML

lint: rename type classification macros

The previous names tspec_is_int and tspec_is_uint were confusing because
there are actually tspec_t constants called INT and UINT, these
classification macros return true for other integer types as well,
though.

While here, remove the prefix "tspec_" from these macros.  It wasn't as
helpful as intended, in many cases it was obviously redundant, when it
was called as tspec_is_integer(tn->tn_type->t_tspec).

No functional change.

(rillig)

2021-01-09 23:54:26 UTC MAIN commitmail json YAML

Add magic incantation to configure an image for mount_udf(8).

(wiz)

2021-01-09 23:18:19 UTC MAIN commitmail json YAML

lint: push down complexity from typeok to typeok_shr

Contrary to the comment in typeok, the types of the expressions before
promotions and conversions are not needed for SHL, SHLASS and SHRASS.
Move that code over to typeok_shr, the only place where it is actually
used.  This removes another 3 variables from typeok.

(rillig)

2021-01-09 23:02:51 UTC MAIN commitmail json YAML

lint: move pointer subtypes from typeok to the sub-functions

The code in typeok is already complicated enough.  Only few of the
checks actually examine the subtype of the pointer, the others don't
need to look at it.  Therefore don't initialize the variables lstp
(left-hand side subtype) and rstp unless they are actually needed.

This reduces the number of variables in typeok and the number of
parameters to the sub-functions.

(rillig)

2021-01-09 22:55:36 UTC MAIN commitmail json YAML

lint: add test for 116 "illegal pointer subtraction"

(rillig)

2021-01-09 22:19:11 UTC MAIN commitmail json YAML

lint: make the table containing the operator properties more readable

The C preprocessor does not require its arguments to be expressions, an
empty string is valid as well.  This allows to replace the 0 in the
operator properties table with a space, making the 1 stick out.

Since the table is quite long, divide it into sections and add section
headers.

No change in the generated code.

(rillig)

2021-01-09 21:37:44 UTC MAIN commitmail json YAML

lint: rename ops.c to oper.c

The file ops.c had previously been autogenerated.  This meant that in a
NetBSD build, it was generated in OBJDIR, and a build that had just
updated src/usr.bin would fail.  For a build that last ran on
2020-12-01, and again today, it looks like this:

#      link  lint1/lint1
cc ... -o lint1 cgram.lo ... ops.lo ... tyname.lo
/usr/bin/ld: ops.lo: in function `initmtab':
ops.c:(.text+0x63): undefined reference to `STRUCT_ASSIGN'

This is caused by ops.c existing in OBJDIR, so the new version in
NETBSDSRCDIR is not looked at.  To prevent this, use oper.c instead as
the filename, which has not been used before.

https://mail-index.netbsd.org/source-changes-d/2021/01/09/msg013096.html

(rillig)

2021-01-09 20:51:08 UTC MAIN commitmail json YAML

2021-01-09 19:31:08 UTC netbsd-9 commitmail json YAML

2021-01-09 19:30:14 UTC netbsd-9 commitmail json YAML

Pull up following revision(s) (requested by tsutsui in ticket #1184):

sbin/fsck/partutil.c: revision 1.17

initialize disk_dict to NULL.

otherwise, if DIOCGDISKINFO returns an error != ENXIO getdiskinfo() later
tries to prop_object_release() stack garbage.

found by rumpctrl tests using clang-7.

(martin)

2021-01-09 19:13:17 UTC MAIN commitmail json YAML

lint: change return type of typeok to bool

No functional change.

(rillig)

2021-01-09 19:07:07 UTC MAIN commitmail json YAML

lint: split typeok into several smaller functions

This reduces the number of local variables from 16 to around 5, in most
of the smaller functions.

No functional change.

(rillig)

2021-01-09 18:26:03 UTC MAIN commitmail json YAML

preserve errno because we are doing system calls between error printing
and error setting.

(christos)

2021-01-09 18:22:43 UTC MAIN commitmail json YAML

restore perror -> warn (reported by Havard Eidnes)

(christos)

2021-01-09 18:21:08 UTC MAIN commitmail json YAML

lint: extract typeok_amper from typeok

No functional change.

(rillig)

2021-01-09 18:15:14 UTC MAIN commitmail json YAML

lint: extract typeok_incdec from typeok

No functional change.

(rillig)

2021-01-09 17:36:10 UTC MAIN commitmail json YAML

lint: reorder table of operator properties

The 4 "requires" properties are now listed together, in descending
strictness.

(rillig)

2021-01-09 17:21:33 UTC MAIN commitmail json YAML

2021-01-09 17:02:19 UTC MAIN commitmail json YAML

lint: add test for message 108, which currently crashes

(rillig)

2021-01-09 16:44:35 UTC MAIN commitmail json YAML

2021-01-09 16:41:09 UTC MAIN commitmail json YAML

2021-01-09 16:40:01 UTC MAIN commitmail json YAML

2021-01-09 16:39:29 UTC MAIN commitmail json YAML

2021-01-09 16:25:19 UTC MAIN commitmail json YAML

Also replace calls to dirname.

(mlelstv)

2021-01-09 16:06:09 UTC MAIN commitmail json YAML

2021-01-09 15:32:06 UTC MAIN commitmail json YAML

2021-01-09 15:16:28 UTC MAIN commitmail json YAML

PR/55916: William Ahern: cmp -s + regular files + skipping is broken
Move test after length is adjusted

(christos)

2021-01-09 15:07:42 UTC MAIN commitmail json YAML

Avoid mismatched memory attributes for kernel and page table memory.

The initial page table code enters mappings first through an identity
mapped normal-NC mapping. Then later on, additional mappings are added
through a KVA-mapped normal-WB mapping. There is a warning about this
in the Armv8 ARM:

  Bytes written without the Write-Back cacheable attribute within the
  same Write-Back granule as bytes written with the Write-Back cacheable
  attribute might have their values reverted to the old values as a result
  of cache Write-Back.

Change the identity mapping attributes to match the KVA-mapping. This
fixes an issue where the kernel often doesn't start under ESXi-Arm Fling.

(jmcneill)

2021-01-09 14:37:16 UTC MAIN commitmail json YAML

2021-01-09 14:33:53 UTC MAIN commitmail json YAML

lint: allow tests to specify additional flags

Several of the tests only need to add the -p flag.  Mentioning the
(current) default flags in each of these tests is redundant.  Therefore,
allow them to specify "lint1-extra-flags: -p" instead of the current
"lint1-flags: -g -S -w -p".

(rillig)

2021-01-09 14:10:15 UTC MAIN commitmail json YAML

lint: make target platform independent of host platform

If lint is run on a platform that has CHAR_BIT == 10, this doesn't
magically make an ILP32 platform have 40 bits per uint32_t.

At the moment, all of the supported platforms are either ILP32 or
I32LP64 anyway, and all of them have CHAR_BIT == 8 == CHAR_SIZE,
so nothing changes practically.

(rillig)

2021-01-09 14:00:05 UTC MAIN commitmail json YAML

Remove need for awk/sed/readlink tools.

(mlelstv)

2021-01-09 13:58:45 UTC MAIN commitmail json YAML

2021-01-09 13:42:25 UTC MAIN commitmail json YAML

Fix a potential issue in pmapboot_enter_range and pmapboot_enter where
if the va and size are not page aligned, there is a possibility of the
last page not being taken into consideration.

(jmcneill)

2021-01-09 13:19:27 UTC MAIN commitmail json YAML

Flush from kernel start, not the entry point.

(jmcneill)

2021-01-09 13:15:15 UTC MAIN commitmail json YAML

2021-01-09 13:12:13 UTC MAIN commitmail json YAML

2021-01-09 03:28:47 UTC MAIN commitmail json YAML

lint: align grammar rules with C99

(rillig)

2021-01-09 03:08:54 UTC MAIN commitmail json YAML

lint: expand abbreviations in grammar rules

stmnt -> statement
comp -> compound

The abbreviation "stmnt" was non-standard, and "comp" was ambiguous
since it is used for "comparison" as well.

(rillig)

2021-01-09 02:40:44 UTC MAIN commitmail json YAML

2021-01-09 02:38:27 UTC MAIN commitmail json YAML

lint: rename T_MULT to T_ASTERISK

In the early phase of lexical analysis, the '*' does not mean
multiplication, therefore its name should not suggest that.  It is only
an asterisk, and depending on the surrounding context, it will only
later turn into a pointer dereference or a multiplication.

The call operator(T_MULT, MULT) was misleading since the MULT was not
used at all.

(rillig)

2021-01-08 21:46:50 UTC MAIN commitmail json YAML

Ensure PrintOnError always reports 'stopped in' on first call.

We may still suppress the rest of the noise if shouldDieQuietly
says to, but the 'stopped in' output is too important to lose.
Avoid repeating it though in the same process.

For the case of aborting due to failure detected elsewhere,
exit 6 so we have a clue.

PR: 55578
Reviewed by:

(sjg)

2021-01-08 21:25:03 UTC MAIN commitmail json YAML

2021-01-08 15:16:04 UTC MAIN commitmail json YAML

- Don't allocate memory dynamically on the stack (for SSP)
- Don't return errno as exit code
- Fold long lines

(christos)

2021-01-08 13:03:54 UTC netbsd-8 commitmail json YAML

2021-01-08 13:02:57 UTC netbsd-8 commitmail json YAML

Pull up following revision(s) (requested by simonb in ticket #1646):

external/bsd/ipf/Makefile.inc: revision 1.6
compat/exec.mk: revision 1.5

Use the compat machinery to build "native" IPF binaries as ipfilter
doesn't use compat32 64-bit alignment/size safe structures.

Fixes IPF on at least mips64.

(martin)

2021-01-08 13:01:54 UTC netbsd-9 commitmail json YAML

2021-01-08 13:00:50 UTC netbsd-9 commitmail json YAML

Pull up following revision(s) (requested by simonb in ticket #1183):

external/bsd/ipf/Makefile.inc: revision 1.6
compat/exec.mk: revision 1.5

Use the compat machinery to build "native" IPF binaries as ipfilter
doesn't use compat32 64-bit alignment/size safe structures.

Fixes IPF on at least mips64.

(martin)

2021-01-08 09:41:24 UTC MAIN commitmail json YAML

Rename man-util-* to comp-c-*

(uki)

2021-01-08 04:36:45 UTC MAIN commitmail json YAML

Set wantToken when none available.

PR: 53285
Reviewed by: gson

(sjg)

2021-01-08 02:11:45 UTC MAIN commitmail json YAML

lint: fix function as controlling expression (since 2020-12-31)

It's perfectly valid to directly use a function name as the controlling
expression of an if statement.  That function name is converted
implicitly to a pointer to that function, and that is a scalar value
then.

Spotted by christos in lib/libpthread/pthread.c:634.

(rillig)

2021-01-08 01:40:03 UTC MAIN commitmail json YAML

lint: demonstrate wrong message 204 (since 2020-12-31)

In func.c 1.39 from 2020-12-31 18:51:28, the check that controlling
expressions are indeed scalar was extended from while and for loops to
if statements as well.  It just seemed to have been an oversight.

This revealed a bug in lint, which didn't accept the following valid
code snippet from lib/libpthread/pthread.c:634:

void _malloc_thread_cleanup(void) __weak;
...
if (_malloc_thread_cleanup)
_malloc_thread_cleanup();

Testing a function (instead of a function pointer) for truthiness is
probably rare since most functions are defined unconditionally.  For
weak functions it comes in handy though.

Clang-Tidy suggests to prefix the function with '&' to silence its
warning.  Doing that revealed a non-obvious behavior in build_ampersand,
which does not add the AMPER node to the expression even though it is
clearly mentioned in the code.  That is left for further research.

Once the original bug is fixed, it probably doesn't matter whether the
AMPER is discarded or retained since check_controlling_expression would
add it back.  There's probably a reason though to sometimes discard the
AMPER and sometimes retain it.

(rillig)

2021-01-08 01:17:55 UTC MAIN commitmail json YAML

bc(1): Consistently use "parentheses" in plural.

(uwe)

2021-01-08 01:17:03 UTC MAIN commitmail json YAML

bc(1): Prettify PostScript output some more.

Don't set BNF in all bold .Ic, instead use .Ar for "expr" and "var" so
that only the literal stuff that is being defined is bold.  Arrange
for subscripts to actually be subscripted in PostScript.  Make sure
meta-syntactic [] are set differently than literal (). Etc...

(uwe)

2021-01-08 00:13:21 UTC MAIN commitmail json YAML

shut up a clang warning about snprintf() called with a variable as format
string
NFCI

(macallan)

2021-01-07 23:57:25 UTC MAIN commitmail json YAML

bc(1): Replace one last missed \f with semantic markup.

(uwe)