Commit Graph

1906 Commits

Author SHA1 Message Date
rin
b203ba4088 Make crypto/rijindael optional again as cprng_strong does no longer
depend on it. Dependency is explicitly declared in files.foo if a
component requires it.
2020-04-22 09:15:39 +00:00
maxv
ce985f886b Introduce POOL_NOCACHE, simple option to cancel pool_caches and go directly
to the pool layer. It is taken out of POOL_QUARANTINE.

Advertise POOL_NOCACHE for kMSan rather than POOL_QUARANTINE. With kMSan
we are only interested in the no-caching effect, not the quarantine. This
reduces memory pressure on kMSan kernels.
2020-04-15 17:16:22 +00:00
christos
d8e96a2d4f Infrastructure for putting kernel+modules in /netbsd/kernel and
/netbsd/modules respectively instead of /netbsd and
/stand/<arch>/<version>/modules.  This is only supported for x86,
and is turned off by default. To try it, add KERNEL_DIR=yes in your
/mk.conf and install a system from that build.
2020-04-04 19:50:53 +00:00
jdolecek
9cd2b890e6 remove also files.netsmb from here 2020-04-04 19:02:53 +00:00
jdolecek
1e03bcd0cf remove SMBFS and nsmb(4) - kernel part
it's unmaintained and supports only obsolete SMB1
2020-04-04 15:43:21 +00:00
nisimura
b8e1f61fdb dme needs mii 2020-03-31 03:42:10 +00:00
christos
4a77b1f16d undo previous since config has been fixed 2020-03-08 00:18:41 +00:00
thorpej
dfd0643937 Fix MIPS builds by working around an apparent bug in config(8)'s elif
handling.
2020-03-07 18:08:47 +00:00
mrg
94bbc63c59 XXX:
turn off -Wunused-but-set-variable for mips' linux_machdep.c and GCC 8.
2020-03-07 00:53:24 +00:00
pgoyette
6191ffa12e Also exclude EXEC_AOUT stuff for aarch64
XXX Pullup-9 and -8
2020-03-05 21:08:36 +00:00
pgoyette
137fd2098e Fix comment - thanks Ryo Shimizu 2020-03-05 13:11:30 +00:00
pgoyette
e1bf7ea279 mips64 has compat_netbsd32 but cannot have exec_aout; all other users
of compat_netbsd32 need exec_aout

Addresses PR kern/55037.

XXX pullup-9
2020-03-04 02:20:56 +00:00
jmcneill
75b925d5cf Add support for Broadcom GENET v5 ethernet controller as found on the
Raspberry Pi 4 (BCM2711).
2020-02-22 00:28:35 +00:00
maxv
081da2e4c3 Retire KLEAK.
KLEAK was a nice feature and served its purpose; it allowed us to detect
dozens of info leaks on the kernel->userland boundary, and thanks to it we
tackled a good part of the infoleak problem 1.5 years ago.

Nowadays however, we have kMSan, which can detect uninitialized memory in
the kernel. kMSan supersedes KLEAK: it can detect what KLEAK was able to
detect, but in addition, (1) it operates in all of the kernel and not just
the kernel->userland boundary, (2) it requires no user interaction, and (3)
it is deterministic and not statistical.

That makes kMSan the feature of choice to detect info leaks nowadays;
people interested in detecting info leaks should boot a kMSan kernel and
just wait for the magic to happen.

KLEAK was a good ride, and a fun project, but now is time for it to go.

Discussed with several people, including Thomas Barabosch.
2020-02-08 07:07:06 +00:00
kre
53a60790fd urio has gone. Comment it out (remaining visible to hold the number) 2020-02-03 13:28:11 +00:00
pgoyette
0e9ecb4e89 COMPAT_43 requires COMPAT_60 2020-01-20 22:18:39 +00:00
thorpej
4541d6828b Remove FDDI support. 2020-01-20 18:38:17 +00:00
riastradh
08a157de6e Remove filemon(4).
Discussed on tech-kern:
https://mail-index.NetBSD.org/tech-kern/2020/01/13/msg025938.html

This was never (intentionally) enabled by default, and the design has
some shortcomings.  You can get mostly the same results with ktrace,
as in usr.bin/make/filemon/filemon_ktrace.c which is now used instead
of filemon for make's meta mode.

If applications require higher performance than ktrace, or nesting
that ktrace doesn't support, we might consider adding something back
into the vfs system calls themselves, without hijacking the syscall
table.  (Might want a more reliable output format too, e.g. one that
can handle newlines in file names.)
2020-01-19 20:41:17 +00:00
thorpej
ed469c22d6 Remove Token Ring support. 2020-01-19 20:00:35 +00:00
thorpej
85654ec7a9 Remove HIPPI support and the esh(4) driver that uses it. There have not
been any users of HIPPI for some time, and it is unlikely to be resurrected.
2020-01-19 06:55:21 +00:00
ryoon
2d5999e461 Fix version numbers in comments 2020-01-18 07:54:26 +00:00
ad
9e93be3837 - options NAMECACHE_ENTER_REVERSE is no more.
- Partially sort the list of per-vnode namecache entries by using a TAILQ.
  Put the real name to the head, and put dot and dotdot to the tail so that
  cache_lookup_reverse() doesn't have to consider them.
2020-01-08 12:04:56 +00:00
mlelstv
31a0ef4a7d Welcome to 2020. 2020-01-01 06:14:29 +00:00
maxv
87107185b5 Revert the removal of filemon. 2019-12-23 06:45:36 +00:00
jakllsch
ad370c5c20 add Analogix DisplayPort core driver 2019-12-19 00:23:57 +00:00
maxv
e67f51b8f7 Retire filemon, discussed on tech-kern@. 2019-12-18 07:37:17 +00:00
riastradh
7ba101b07e Nuke crypto/arc4. Has not been used since 2003. Will not be missed. 2019-12-05 03:22:02 +00:00
maxv
10c5b02320 Add support for Kernel Memory Sanitizer (kMSan). It detects uninitialized
memory used by the kernel at run time, and just like kASan and kCSan, it
is an excellent feature. It has already detected 38 uninitialized variables
in the kernel during my testing, which I have since discreetly fixed.

We use two shadows:
 - "shad", to track uninitialized memory with a bit granularity (1:1).
   Each bit set to 1 in the shad corresponds to one uninitialized bit of
   real kernel memory.
 - "orig", to track the origin of the memory with a 4-byte granularity
   (1:1). Each uint32_t cell in the orig indicates the origin of the
   associated uint32_t of real kernel memory.

The memory consumption of these shadows is consequent, so at least 4GB of
RAM is recommended to run kMSan.

The compiler inserts calls to specific __msan_* functions on each memory
access, to manage both the shad and the orig and detect uninitialized
memory accesses that change the execution flow (like an "if" on an
uninitialized variable).

We mark as uninit several types of memory buffers (stack, pools, kmem,
malloc, uvm_km), and check each buffer passed to copyout, copyoutstr,
bwrite, if_transmit_lock and DMA operations, to detect uninitialized memory
that leaves the system. This allows us to detect kernel info leaks in a way
that is more efficient and also more user-friendly than KLEAK.

Contrary to kASan, kMSan requires comprehensive coverage, ie we cannot
tolerate having one non-instrumented function, because this could cause
false positives. kMSan cannot instrument ASM functions, so I converted
most of them to __asm__ inlines, which kMSan is able to instrument. Those
that remain receive special treatment.

Contrary to kASan again, kMSan uses a TLS, so we must context-switch this
TLS during interrupts. We use different contexts depending on the interrupt
level.

The orig tracks precisely the origin of a buffer. We use a special encoding
for the orig values, and pack together in each uint32_t cell of the orig:
 - a code designating the type of memory (Stack, Pool, etc), and
 - a compressed pointer, which points either (1) to a string containing
   the name of the variable associated with the cell, or (2) to an area
   in the kernel .text section which we resolve to a symbol name + offset.

This encoding allows us not to consume extra memory for associating
information with each cell, and produces a precise output, that can tell
for example the name of an uninitialized variable on the stack, the
function in which it was pushed on the stack, and the function where we
accessed this uninitialized variable.

kMSan is available with LLVM, but not with GCC.

The code is organized in a way that is similar to kASan and kCSan, so it
means that other architectures than amd64 can be supported.
2019-11-14 16:23:52 +00:00
msaitoh
18f068bbc4 Remove acorn26's upc(4) devices. 2019-11-11 04:04:29 +00:00
jmcneill
088b457010 Add support for internal DesignWare HDMI PHYs 2019-11-09 23:27:50 +00:00
maxv
b7edd3d132 Add Kernel Concurrency Sanitizer (kCSan) support. This sanitizer allows us
to detect race conditions at runtime. It is a variation of TSan that is
easy to implement and more suited to kernel internals, albeit theoretically
less precise than TSan's happens-before.

We do basically two things:

 - On every KCSAN_NACCESSES (=2000) memory accesses, we create a cell
   describing the access, and delay the calling CPU (10ms).

 - On all memory accesses, we verify if the memory we're reading/writing
   is referenced in a cell already.

The combination of the two means that, if for example cpu0 does a read that
is selected and cpu1 does a write at the same address, kCSan will fire,
because cpu1's write collides with cpu0's read cell.

The coverage of the instrumentation is the same as that of kASan. Also, the
code is organized in a way similar to kASan, so it is easy to add support
for more architectures than amd64. kCSan is compatible with KCOV.

Reviewed by Kamil.
2019-11-05 20:19:17 +00:00
ozaki-r
b2358a5409 Implement a front-end driver of virtio-9p called vio9p
In conjunction with mount_9p, it enables a NetBSD system running as a VM guest
to mount an exported filesystem by the host via virtio-9p.  It exports a 9p
end-point of virtio-9p via a character device file for mount_9p.

Reviewed by yamaguchi@
2019-10-28 02:56:40 +00:00
mrg
90bf43e918 convert HAVE_GCC == 7 to HAVE_GCC >= 7. 2019-09-30 00:06:02 +00:00
christos
02cdd248ec Add a new member to struct vfsstat and grow the unused members
The new member is caled f_mntfromlabel and it is the dkw_wname
of the corresponding wedge. This is now used by df -W to display
the mountpoint name as NAME=
2019-09-22 22:59:37 +00:00
maxv
054c8b6dea Wrong major. 2019-09-15 11:45:47 +00:00
maxv
250ccf12c0 Add vHCI, a driver which allows to send and receive USB packets directly
from userland via /dev/vhci. Using this, it becomes possible to test and
fuzz the USB stack and all the USB drivers without having the associated
hardware.

The vHCI device has four ports independently addressable.

For each xfer on each port, we create two packets: a setup packet (which
indicates mostly the type of request) and a data packet (which contains
the raw data). These packets are processed by read and write operations
on /dev/vhci: userland poll-reads it to fetch usb_device_request_t
structures, and dispatches the requests depending on bRequest and
bmRequestType.

A few ioctls are available:

	VHCI_IOC_GET_INFO   - Get the current status
	VHCI_IOC_SET_PORT   - Choose a vHCI port
	VHCI_IOC_USB_ATTACH - Attach a USB device on the current port
	VHCI_IOC_USB_DETACH - Detach the USB device on the current port

vHCI has already allowed me to automatically find several bugs in the USB
stack and its drivers.
2019-09-14 06:57:51 +00:00
riastradh
8e07b51739 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 (https://eprint.iacr.org/2018/349)
- 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...

XXX pullup-7
XXX pullup-8
XXX pullup-9
2019-09-02 20:09:29 +00:00
christos
23eed71e48 comment out CHFS to fix build issues 2019-06-17 17:06:39 +00:00
christos
14325cec89 Add more missing fs's 2019-06-17 03:34:01 +00:00
maxv
71e9a696c0 Add KASAN_PANIC, an option to turn KASAN warning into kernel panics,
requested by Siddharth. While here clarify a little.
2019-06-15 06:40:34 +00:00
sevan
93a3eadbe7 Add APPLE_UFS (disabled) 2019-05-21 16:56:10 +00:00
mlelstv
b1f23fc946 Add experimental userland interface to IPMI driver. Currently, transactions
(like sensor readout) are locked, so that a userland program may interfere with
envsys operation.

To use this you need a program like ipmitool built with OpenIPMI support.
2019-05-18 08:38:00 +00:00
ozaki-r
7fc219a5ee Implement an aggressive psref leak detector
It is yet another psref leak detector that enables to tell where a leak occurs
while a simpler version that is already committed just tells an occurrence of a
leak.

Investigating of psref leaks is hard because once a leak occurs a percpu list of
psref that tracks references can be corrupted.  A reference to a tracking object
is memorized in the list via an intermediate object (struct psref) that is
normally allocated on a stack of a thread.  Thus, the intermediate object can be
overwritten on a leak resulting in corruption of the list.

The tracker makes a shadow entry to an intermediate object and stores some hints
into it (currently it's a caller address of psref_acquire).  We can detect a
leak by checking the entries on certain points where any references should be
released such as the return point of syscalls and the end of each softint
handler.

The feature is expensive and enabled only if the kernel is built with
PSREF_DEBUG.

Proposed on tech-kern
2019-05-17 03:34:26 +00:00
sevan
035b462fcd Oops, disable FILECORE as intended.
heads up <leot> <wiz>
2019-05-06 11:59:46 +00:00
sevan
1850e1c560 Add ADOSFS & FILECORE (both disabled) 2019-05-06 01:43:09 +00:00
sevan
d8c01e6105 Add V7FS (disabled) 2019-05-06 01:20:42 +00:00
sevan
851e065a7d Add autofs pseudo device (disabled)
Add a description for existing pseudo devices
2019-05-06 01:11:42 +00:00
sevan
edda628cc6 Include EFS support.
Tested on amd64 & macppc
2019-05-06 00:33:17 +00:00
mlelstv
26894afa16 Now the real number for ipmi 2019-05-05 17:24:00 +00:00
mlelstv
a8f0d58e5b reservation for IPMI driver 2019-05-05 17:22:31 +00:00