Commit Graph

274195 Commits

Author SHA1 Message Date
ad f61617cee7 exit1(): remove from the radix tree before setting zombie status, as
radix_tree_remove_node() can block on locks when freeing.

Reported-by: syzbot+02bf066c30f812b14f25@syzkaller.appspotmail.com
2020-02-22 21:07:46 +00:00
thorpej 8660be34c8 Fix a couple of printf formats in debug messages. 2020-02-22 20:29:15 +00:00
maxv a79b186911 add relaxed atomics, ok ad@ riastradh@ 2020-02-22 20:12:40 +00:00
maxv 467e3b98ec Be less strict: when copyinstr() returns ENAMETOOLONG, it does initialize
the buffer, so mark it as such.
2020-02-22 20:08:39 +00:00
pgoyette ea561c44e3 Update the t_modctl test to ensure that static evcnts are added.
While here, remove the explicit call to sysctl_setup() routine,
since the module infrastructure already invokes such routines
automatically.
2020-02-22 19:54:34 +00:00
pgoyette 69626800fd Teach module infrastructure to attach any static evcnts that might be
defined in a module, similar to the automatic invocation of sysctl(9)
setup functions.  As requested by riastradh@
2020-02-22 19:51:57 +00:00
chs 5d4d9a2027 remove some unnecessary includes of internal UVM headers. 2020-02-22 19:49:11 +00:00
chs d80ed5957c do not wait for memory in pgo_fault methods, just return ENOMEM
and let the uvm_fault code wait if it is appropriate.
2020-02-22 19:46:48 +00:00
kamil 1706a0e6e8 Disable t_ptrace_wait* tests for MKSANITIZER/MKLIBCSANITIZER
A subset of tests is not compatible with the sanitizers.
2020-02-22 19:44:07 +00:00
jmcneill 5f76fbf667 build fix 2020-02-22 19:37:31 +00:00
sevan 6f6ff1436b Add Ivan Sutherland's birthday 2020-02-22 19:25:25 +00:00
sevan 36d50de63d Add Bert Sutherland
https://twitter.com/ComputerHistory/status/1230200277141250050
2020-02-22 19:23:09 +00:00
sevan 2f0786204f Add Larry Tesler
https://www.nytimes.com/2020/02/20/technology/lawrence-tesler-dead.html
2020-02-22 19:21:40 +00:00
kamil 3735bb21e5 Update t_siginfo.c build rules
Add logic for MKSANITIZER/MKLIBCSANITIZER checks.
2020-02-22 19:14:57 +00:00
kamil f40ba85057 Disable the t_siginfo test under MKSANITIZER / MKLIBCSANITIZER
Signal crash events are incompatible with sanitizers.
2020-02-22 19:09:51 +00:00
sevan 8744e0a0e1 Andrew Weatherall's tattoo and a track on A Pox On The Pioneers album.
https://pbs.twimg.com/media/ERAuddhU4AAFv3w?format=jpg&name=orig
Story:
https://www.dummymag.com/features/andrew-weatherall-interview-it-s-bollocks-it-s-discos-tell-me-tales-of-the/
2020-02-22 19:03:04 +00:00
jmcneill 1f864f34af Add brgphy 2020-02-22 18:57:50 +00:00
jmcneill eb15acbd6a Match BCM54213PE 2020-02-22 18:57:31 +00:00
jmcneill 0210926b50 regen 2020-02-22 18:57:09 +00:00
jmcneill 65d0cc155b Add BCM54213PE 2020-02-22 18:56:57 +00:00
thorpej fd6e085f9e Make it clear that the pfn argument to alpha_init() is no longer used. 2020-02-22 17:33:42 +00:00
fox 819b6be2db common/lib/libc/stdlib: Fix possible signed integer overflow.
common/lib/libc/stdlib/random.c:482:6 can result in signed integer overflow.

This bug was reported by UBSan runs.

The change has been tested using the following program to generate random numbers
in both the old and the new library and can be used to verify the correctness of the
library after the change.

#include <stdio.h>
#include <stdlib.h>

#define COUNT 1000 * 1000

int
main(void)
{
        int i;
        FILE *fp = fopen("numbers.txt", "w");

        srandom(0xdeadbeef);

        for(i = 0; i < COUNT; i++) {
                fprintf(fp, "%ld\n", random());
        }

        fclose(fp);

        return 0;
}

Reviewed by: riastradh@ , kamil@
2020-02-22 14:47:29 +00:00
pgoyette 9a34b1cfc9 Clarify that the -k option only provides the address of the module's
text segment.  The addresses of any other segments are not available.
2020-02-22 14:26:18 +00:00
kamil 6aee95b41f Avoid undefined behavior in the rand48(3) implementation
Instead of implicid promotion to signed int,
explicitly cast the arguments to unsigned int.

_rand48.c:53:27, signed integer overflow:
58989 * 58970 cannot be represented in type 'int'

_rand48.c:53:38, signed integer overflow:
-2093025904 + -1496809120 cannot be represented in type 'int'

_rand48.c:53:57, signed integer overflow:
57068 * 42787 cannot be represented in type 'int'

New and old code produce the same code as tested with:

#include <stdio.h>
#include <stdlib.h>

#define COUNT 1000 * 1000

int
main(void)
{
	FILE *fp;
        int i;

        fp = fopen("numbers.txt", "w+");
	if (!fp)
		abort();

        for(i = 0; i < COUNT; i++) {
                fprintf(fp, "%f\n", drand48());
                fprintf(fp, "%ld\n", lrand48());
                fprintf(fp, "%ld\n", mrand48());
        }

        fclose(fp);

        return 0;
}
2020-02-22 14:07:57 +00:00
pgoyette 79e45209ec Remove vestigial remnant of an earlier modification to the module
implementation.  There currently is no such thing as a module's
"alias".
2020-02-22 14:06:05 +00:00
jmcneill c992f78e6a Add support for hardware rx filters. 2020-02-22 13:41:40 +00:00
kamil 57225a2ce5 Reorder words to fix grammar
Noted by <leot>
2020-02-22 13:20:21 +00:00
kamil 756b86e872 rand48: Document that short integers are unsigned 2020-02-22 11:56:13 +00:00
roy 536a6b742b Revert unrelated changes to prior 2020-02-22 11:55:43 +00:00
roy 68c104dbdb rc.d/network: improve wording of waiting for DAD to finish 2020-02-22 11:52:45 +00:00
kamil 2bddf73745 Improve readability of __dorand48()
Break long lines into shorter instructions per line.

No Functional Change.
2020-02-22 11:24:47 +00:00
jmcneill 300584e77e Remove check for bestmode==-1 (shouldn't happen) 2020-02-22 10:30:37 +00:00
kamil 6ab39b6716 Avoid undefined behavior in left shift
crypt.c:772:11, left shift of 1363235140 by 1 places cannot be represented
in type 'int32_t' (aka 'int')
2020-02-22 10:29:17 +00:00
kamil 96be1c9965 Avoid undefined behavior in bit shift operations
crypt.c:839:40, left shift of negative value -1197182952
crypt.c:840:40, left shift of negative value -264997776
2020-02-22 10:22:32 +00:00
kamil e1278de2f9 Avoid NULL pointer arithmetics on environ
_env.c:260:9, pointer expression with base 0 overflowed to 0
_env.c:260:9, load of null pointer of type 'char *'
2020-02-22 10:05:12 +00:00
kamil b110dc906e Avoid unportable shift construct
boot.c:150:29, left shift of 255 by 24 places cannot be represented in type 'int'
boot.c:153:29, left shift of 255 by 24 places cannot be represented in type 'int'
2020-02-22 09:59:22 +00:00
skrll f7f69ae002 Define pinctrl-names for sdhci to fix it. From Harold Gutch and discussed
on port-arm.

http://mail-index.netbsd.org/port-arm/2020/02/13/msg006497.html
2020-02-22 09:54:27 +00:00
roy 5403a7a7c1 zfs: build a ramdisk on amd64 with enough to mount rpool/ROOT on /
Until we get ZFS integrated into our boot loader, this is the next best
thing. The idea is simple - have a small FFS partition with a kernel,
modules and this ramdisk. Once the ramdisk boots it will mount the FFS
partition read only, copy the needed ZFS modules to the ramdisk and then
unmount the partition. Then we import the ZFS root pool, mount the
ZFS root filesystem and then pivot to it.

Because the initial FFS partition is not mounted at this point, we
can mount it in /altroot so we can replace the kernel and modules with
newer ones so it's easily maintainable.

This ZFS boot strapper currently makes the following assumptions:
 * The device NAME=boot is the FFS with kernel, modules and this ramdisk.
 * The ZFS root pool and root filesystem are called rpool/ROOT.

A boot.cfg menu entry can then be added like so:
menu=Boot ZFS root:fs /ramdisk-zfsroot.fs;boot
2020-02-22 09:53:47 +00:00
maxv 11fc230787 pass the address of the field, instead of relying on it being the first
field of the structure, no functional change
2020-02-22 09:42:20 +00:00
jmcneill 2426b4c1e2 If the default GOP mode is unavailable, fallback to the first mode defined.
PR# port-amd64/55000
2020-02-22 09:34:26 +00:00
maxv a4bb61b904 pass the address of the field, instead of relying on it being the first
field of the structure, no functional change
2020-02-22 09:30:42 +00:00
maxv 99c26a8a3e pass the address of the field, instead of relying on it being the first
field of the structure, no functional change, ok kamil
2020-02-22 09:24:05 +00:00
maxv 0d945ea0ff Inline the block in the parent block, for clarity, and also to prevent a
false positive with kMSan.

Here, LLVM reorders the conditions and checks 'vattr' before 'error'. But
if 'error' is non-zero then 'vattr' is not initialized, and kMSan notices
the uninitialized memory read.
2020-02-22 08:58:39 +00:00
maxv 559c53d028 Zero out 'tv', to prevent uninitialized bytes in its padding from leaking
to userland. Found by kMSan.

Reported-by: syzbot+8134380511a82c8f5fd7@syzkaller.appspotmail.com
2020-02-22 08:39:33 +00:00
skrll adfb9b968c Fix previous for _ARM32_NEED_BUS_DMA_BOUNCE 2020-02-22 08:22:09 +00:00
isaki 4f60b558c3 Make calling get_props() lockless.
get_props() of all MD drivers now can be called without sc_lock.
2020-02-22 08:15:09 +00:00
isaki 6d13f8a36a On audio_[pr]mixer_halt(), it's better to reset parameters in intr_lock. 2020-02-22 08:03:19 +00:00
isaki 710d84f6ac Add KASSERTs. audio_[pr]mixer_start() need exlock. 2020-02-22 08:01:59 +00:00
isaki 3dc846c0d9 Move #if DIAGNOSTIC..#endif to correct place.
It should ignore stray interrupts regardless of DIAGNOSTIC.
2020-02-22 07:59:47 +00:00
isaki 379e7aeb32 hw_if->query_format is already mandatory method. Drop null checks. 2020-02-22 07:09:18 +00:00