The NetBSD Project

CVS log for src/sys/kern/files.kern

[BACK] Up to [cvs.NetBSD.org] / src / sys / kern

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.60 / (download) - annotate - [select for diffs], Fri Jul 28 18:19:01 2023 UTC (8 months, 2 weeks ago) by christos
Branch: MAIN
CVS Tags: thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation, HEAD
Changes since 1.59: +2 -1 lines
Diff to previous 1.59 (colored)

Add epoll(2) from Theodore Preduta as part of GSoC 2023

Revision 1.59 / (download) - annotate - [select for diffs], Mon Jul 10 06:42:33 2023 UTC (9 months ago) by mrg
Branch: MAIN
Changes since 1.58: +2 -1 lines
Diff to previous 1.58 (colored)

add missing sys_memfd.c.

Revision 1.58 / (download) - annotate - [select for diffs], Fri Jul 7 12:34:50 2023 UTC (9 months, 1 week ago) by riastradh
Branch: MAIN
Changes since 1.57: +4 -1 lines
Diff to previous 1.57 (colored)

heartbeat(9): New mechanism to check progress of kernel.

This uses hard interrupts to check progress of low-priority soft
interrupts, and one CPU to check progress of another CPU.

If no progress has been made after a configurable number of seconds
(kern.heartbeat.max_period, default 15), then the system panics --
preferably on the CPU that is stuck so we get a stack trace in dmesg
of where it was stuck, but if the stuckness was detected by another
CPU and the stuck CPU doesn't acknowledge the request to panic within
one second, the detecting CPU panics instead.

This doesn't supplant hardware watchdog timers.  It is possible for
hard interrupts to be stuck on all CPUs for some reason too; in that
case heartbeat(9) has no opportunity to complete.

Downside: heartbeat(9) relies on hardclock to run at a reasonably
consistent rate, which might cause trouble for the glorious tickless
future.  However, it could be adapted to take a parameter for an
approximate number of units that have elapsed since the last call on
the current CPU, rather than treating that as a constant 1.

XXX kernel revbump -- changes struct cpu_info layout

Revision 1.57 / (download) - annotate - [select for diffs], Sun Sep 19 15:51:27 2021 UTC (2 years, 6 months ago) by thorpej
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10-0-RELEASE, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10, bouyer-sunxi-drm-base, bouyer-sunxi-drm
Changes since 1.56: +3 -1 lines
Diff to previous 1.56 (colored)

Add native implementations of eventfd(2) and timerfd(2), compatible with
the Linux interfaces of the same name.

Revision 1.54.4.1 / (download) - annotate - [select for diffs], Thu Jun 17 04:46:33 2021 UTC (2 years, 9 months ago) by thorpej
Branch: thorpej-i2c-spi-conf
Changes since 1.54: +2 -1 lines
Diff to previous 1.54 (colored) next main 1.55 (colored)

Sync w/ HEAD.

Revision 1.54.6.1 / (download) - annotate - [select for diffs], Mon May 31 22:15:20 2021 UTC (2 years, 10 months ago) by cjep
Branch: cjep_staticlib_x
Changes since 1.54: +2 -1 lines
Diff to previous 1.54 (colored) next main 1.55 (colored)

sync with head

Revision 1.56 / (download) - annotate - [select for diffs], Tue May 18 05:16:09 2021 UTC (2 years, 10 months ago) by mrg
Branch: MAIN
CVS Tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-futex2-base, thorpej-futex2, thorpej-cfargs2-base, thorpej-cfargs2, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1
Changes since 1.55: +2 -2 lines
Diff to previous 1.55 (colored)

s/defopt/defflag/.  2021 called to remind me it's still 2021.

Revision 1.55 / (download) - annotate - [select for diffs], Mon May 17 08:50:36 2021 UTC (2 years, 10 months ago) by mrg
Branch: MAIN
Changes since 1.54: +2 -1 lines
Diff to previous 1.54 (colored)

move bi-endian disklabel support from the kernel and libsa into libkern.

- dkcksum() and dkcksum_sized() move from subr_disk.c and from
  libsa into libkern/dkcksum.c (which is missing _sized() version),
  using the version from usr.sbin/disklabel.

- swap_disklabel() moves from subr_disk_mbr.c into libkern, now called
  disklabel_swap().  (the sh3 version should be updated to use this.)

- DISKLABEL_EI becomes a first-class option with opt_disklabel.h.

- add libkern.h to libsa/disklabel.c.

this enables future work for bi-endian libsa/ufs.c (relevant for ffsv1,
ffsv2, lfsv1, and lfsv2), as well as making it possible for ports not
using subr_disk_mbr.c to include bi-endian disklabel support (which,
afaict, includes any disk on mbr-supporting platforms that do not have
an mbr as well as disklabel.)

builds successsfully on: alpha, i386, amd64, sun2, sun3, evbarm64,
evbarm64-eb, sparc, and sparc64.  tested in anita on i386 and sparc,
testing in hardware on evbarm64*.

Revision 1.53.2.3 / (download) - annotate - [select for diffs], Mon Dec 14 16:53:36 2020 UTC (3 years, 3 months ago) by thorpej
Branch: thorpej-futex
Changes since 1.53.2.2: +2 -1 lines
Diff to previous 1.53.2.2 (colored) next main 1.54 (colored)

Native implementation of the Linux timerfd API.

Revision 1.53.2.2 / (download) - annotate - [select for diffs], Mon Dec 14 16:00:51 2020 UTC (3 years, 3 months ago) by thorpej
Branch: thorpej-futex
Changes since 1.53.2.1: +2 -1 lines
Diff to previous 1.53.2.1 (colored)

Native implementation of the Linux eventfd(2) API.

Revision 1.53.2.1 / (download) - annotate - [select for diffs], Mon Dec 14 14:38:13 2020 UTC (3 years, 3 months ago) by thorpej
Branch: thorpej-futex
Changes since 1.53: +2 -2 lines
Diff to previous 1.53 (colored)

Sync w/ HEAD.

Revision 1.54 / (download) - annotate - [select for diffs], Sun Nov 1 18:51:02 2020 UTC (3 years, 5 months ago) by pgoyette
Branch: MAIN
CVS Tags: thorpej-futex-base, thorpej-cfargs-base, thorpej-cfargs, cjep_staticlib_x-base
Branch point for: thorpej-i2c-spi-conf, cjep_staticlib_x
Changes since 1.53: +2 -2 lines
Diff to previous 1.53 (colored)

Separate the compat_netbsd32_coredump from the compat_netbsd32 and
coredump modules, into its own module.

Welcome to 7.99.75 !!!

Revision 1.53 / (download) - annotate - [select for diffs], Mon Oct 19 19:33:02 2020 UTC (3 years, 5 months ago) by christos
Branch: MAIN
Branch point for: thorpej-futex
Changes since 1.52: +3 -3 lines
Diff to previous 1.52 (colored)

Arrange so that no options COREDUMP and no options PTRACE work together.
Thanks to Paul Goyette for testing.

Revision 1.52 / (download) - annotate - [select for diffs], Mon Sep 7 03:50:41 2020 UTC (3 years, 7 months ago) by thorpej
Branch: MAIN
Changes since 1.51: +3 -1 lines
Diff to previous 1.51 (colored)

Add the ability to set an alternate cnmagic in the kernel config
file, e.g.:

options    CNMAGIC="\"+++++\""

Revision 1.51 / (download) - annotate - [select for diffs], Fri Aug 14 00:53:16 2020 UTC (3 years, 8 months ago) by riastradh
Branch: MAIN
Changes since 1.50: +2 -1 lines
Diff to previous 1.50 (colored)

New system call getrandom() compatible with Linux and others.

Three ways to call:

getrandom(p, n, 0)              Blocks at boot until full entropy.
                                Returns up to n bytes at p; guarantees
                                up to 256 bytes even if interrupted
                                after blocking.  getrandom(0,0,0)
                                serves as an entropy barrier: return
                                only after system has full entropy.

getrandom(p, n, GRND_INSECURE)  Never blocks.  Guarantees up to 256
                                bytes even if interrupted.  Equivalent
                                to /dev/urandom.  Safe only after
                                successful getrandom(...,0),
                                getrandom(...,GRND_RANDOM), or read
                                from /dev/random.

getrandom(p, n, GRND_RANDOM)    May block at any time.  Returns up to n
                                bytes at p, but no guarantees about how
                                many -- may return as short as 1 byte.
                                Equivalent to /dev/random.  Legacy.
                                Provided only for source compatibility
                                with Linux.

Can also use flags|GRND_NONBLOCK to fail with EWOULDBLOCK/EAGAIN
without producing any output instead of blocking.

- The combination GRND_INSECURE|GRND_NONBLOCK is the same as
  GRND_INSECURE, since GRND_INSECURE never blocks anyway.

- The combinations GRND_INSECURE|GRND_RANDOM and
  GRND_INSECURE|GRND_RANDOM|GRND_NONBLOCK are nonsensical and fail
  with EINVAL.

As proposed on tech-userlevel, tech-crypto, tech-security, and
tech-kern, and subsequently adopted by core (minus the getentropy part
of the proposal, because other operating systems and participants in
the discussion couldn't come to an agreement about getentropy and
blocking semantics):

https://mail-index.netbsd.org/tech-userlevel/2020/05/02/msg012333.html

Revision 1.50 / (download) - annotate - [select for diffs], Tue Jul 28 20:15:07 2020 UTC (3 years, 8 months ago) by riastradh
Branch: MAIN
Changes since 1.49: +2 -2 lines
Diff to previous 1.49 (colored)

Rewrite cprng_fast in terms of new ChaCha API.

Revision 1.49 / (download) - annotate - [select for diffs], Sun Jun 7 09:45:19 2020 UTC (3 years, 10 months ago) by maxv
Branch: MAIN
Changes since 1.48: +2 -1 lines
Diff to previous 1.48 (colored)

Add fault(4).

Revision 1.48 / (download) - annotate - [select for diffs], Sat May 16 18:31:50 2020 UTC (3 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.47: +4 -1 lines
Diff to previous 1.47 (colored)

Add ACL support for FFS. From FreeBSD.

Revision 1.47 / (download) - annotate - [select for diffs], Thu Apr 30 03:28:18 2020 UTC (3 years, 11 months ago) by riastradh
Branch: MAIN
Changes since 1.46: +2 -4 lines
Diff to previous 1.46 (colored)

Rewrite entropy subsystem.

Primary goals:

1. Use cryptography primitives designed and vetted by cryptographers.
2. Be honest about entropy estimation.
3. Propagate full entropy as soon as possible.
4. Simplify the APIs.
5. Reduce overhead of rnd_add_data and cprng_strong.
6. Reduce side channels of HWRNG data and human input sources.
7. Improve visibility of operation with sysctl and event counters.

Caveat: rngtest is no longer used generically for RND_TYPE_RNG
rndsources.  Hardware RNG devices should have hardware-specific
health tests.  For example, checking for two repeated 256-bit outputs
works to detect AMD's 2019 RDRAND bug.  Not all hardware RNGs are
necessarily designed to produce exactly uniform output.

ENTROPY POOL

- A Keccak sponge, with test vectors, replaces the old LFSR/SHA-1
  kludge as the cryptographic primitive.

- `Entropy depletion' is available for testing purposes with a sysctl
  knob kern.entropy.depletion; otherwise it is disabled, and once the
  system reaches full entropy it is assumed to stay there as far as
  modern cryptography is concerned.

- No `entropy estimation' based on sample values.  Such `entropy
  estimation' is a contradiction in terms, dishonest to users, and a
  potential source of side channels.  It is the responsibility of the
  driver author to study the entropy of the process that generates
  the samples.

- Per-CPU gathering pools avoid contention on a global queue.

- Entropy is occasionally consolidated into global pool -- as soon as
  it's ready, if we've never reached full entropy, and with a rate
  limit afterward.  Operators can force consolidation now by running
  sysctl -w kern.entropy.consolidate=1.

- rndsink(9) API has been replaced by an epoch counter which changes
  whenever entropy is consolidated into the global pool.
  . Usage: Cache entropy_epoch() when you seed.  If entropy_epoch()
    has changed when you're about to use whatever you seeded, reseed.
  . Epoch is never zero, so initialize cache to 0 if you want to reseed
    on first use.
  . Epoch is -1 iff we have never reached full entropy -- in other
    words, the old rnd_initial_entropy is (entropy_epoch() != -1) --
    but it is better if you check for changes rather than for -1, so
    that if the system estimated its own entropy incorrectly, entropy
    consolidation has the opportunity to prevent future compromise.

- Sysctls and event counters provide operator visibility into what's
  happening:
  . kern.entropy.needed - bits of entropy short of full entropy
  . kern.entropy.pending - bits known to be pending in per-CPU pools,
    can be consolidated with sysctl -w kern.entropy.consolidate=1
  . kern.entropy.epoch - number of times consolidation has happened,
    never 0, and -1 iff we have never reached full entropy

CPRNG_STRONG

- A cprng_strong instance is now a collection of per-CPU NIST
  Hash_DRBGs.  There are only two in the system: user_cprng for
  /dev/urandom and sysctl kern.?random, and kern_cprng for kernel
  users which may need to operate in interrupt context up to IPL_VM.

  (Calling cprng_strong in interrupt context does not strike me as a
  particularly good idea, so I added an event counter to see whether
  anything actually does.)

- Event counters provide operator visibility into when reseeding
  happens.

INTEL RDRAND/RDSEED, VIA C3 RNG (CPU_RNG)

- Unwired for now; will be rewired in a subsequent commit.

Revision 1.46 / (download) - annotate - [select for diffs], Sun Apr 26 18:53:33 2020 UTC (3 years, 11 months ago) by thorpej
Branch: MAIN
Changes since 1.45: +2 -1 lines
Diff to previous 1.45 (colored)

Add a NetBSD native futex implementation, mostly written by riastradh@.
Map the COMPAT_LINUX futex calls to the native ones.

Revision 1.44.4.1 / (download) - annotate - [select for diffs], Sat Apr 25 11:24:05 2020 UTC (3 years, 11 months ago) by bouyer
Branch: bouyer-xenpvh
Changes since 1.44: +2 -2 lines
Diff to previous 1.44 (colored) next main 1.45 (colored)

Sync with bouyer-xenpvh-base2 (HEAD)

Revision 1.45 / (download) - annotate - [select for diffs], Wed Apr 22 09:18:42 2020 UTC (3 years, 11 months ago) by rin
Branch: MAIN
CVS Tags: bouyer-xenpvh-base2
Changes since 1.44: +2 -2 lines
Diff to previous 1.44 (colored)

At the moment, we need kern/uipc_mbufdebug.c only if DDB is enabled.

Revision 1.16.4.4 / (download) - annotate - [select for diffs], Mon Apr 13 08:05:03 2020 UTC (4 years ago) by martin
Branch: phil-wifi
Changes since 1.16.4.3: +3 -3 lines
Diff to previous 1.16.4.3 (colored) to branchpoint 1.16 (colored) next main 1.17 (colored)

Mostly merge changes from HEAD upto 20200411

Revision 1.16.4.3 / (download) - annotate - [select for diffs], Wed Apr 8 14:08:51 2020 UTC (4 years ago) by martin
Branch: phil-wifi
Changes since 1.16.4.2: +6 -4 lines
Diff to previous 1.16.4.2 (colored) to branchpoint 1.16 (colored)

Merge changes from current as of 20200406

Revision 1.34.4.2 / (download) - annotate - [select for diffs], Tue Mar 3 18:51:03 2020 UTC (4 years, 1 month ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE
Changes since 1.34.4.1: +2 -2 lines
Diff to previous 1.34.4.1 (colored) to branchpoint 1.34 (colored) next main 1.35 (colored)

Pull up following revision(s) (requested by rin in ticket #754):

	sys/kern/files.kern: revision 1.44

Include kern_crashme.c in non-DEBUG kernels.
This is useful for simulating crashes in production to test failover.

Revision 1.44 / (download) - annotate - [select for diffs], Mon Mar 2 16:00:54 2020 UTC (4 years, 1 month ago) by riastradh
Branch: MAIN
CVS Tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, is-mlppp-base, is-mlppp, bouyer-xenpvh-base1, bouyer-xenpvh-base
Branch point for: bouyer-xenpvh
Changes since 1.43: +2 -2 lines
Diff to previous 1.43 (colored)

Include kern_crashme.c in non-DEBUG kernels.

This is useful for simulating crashes in production to test failover.

Revision 1.42.2.1 / (download) - annotate - [select for diffs], Sat Feb 29 20:21:02 2020 UTC (4 years, 1 month ago) by ad
Branch: ad-namecache
Changes since 1.42: +1 -2 lines
Diff to previous 1.42 (colored) next main 1.43 (colored)

Sync with head.

Revision 1.43 / (download) - annotate - [select for diffs], Sat Feb 8 07:07:07 2020 UTC (4 years, 2 months ago) by maxv
Branch: MAIN
CVS Tags: ad-namecache-base3
Changes since 1.42: +1 -2 lines
Diff to previous 1.42 (colored)

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.

Revision 1.15.2.1 / (download) - annotate - [select for diffs], Tue Jan 21 16:59:57 2020 UTC (4 years, 2 months ago) by martin
Branch: netbsd-8
CVS Tags: netbsd-8-2-RELEASE
Changes since 1.15: +3 -2 lines
Diff to previous 1.15 (colored) next main 1.16 (colored)

Apply patch, requested by pgoyette in ticket #1486:

PR kern/54874: fix load failure of the exec_aout kernel module.

Revision 1.34.4.1 / (download) - annotate - [select for diffs], Tue Jan 21 15:33:33 2020 UTC (4 years, 2 months ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-0-RELEASE, netbsd-9-0-RC2
Changes since 1.34: +3 -2 lines
Diff to previous 1.34 (colored)

Apply patch, requested by pgoyette in ticket #633:

PR kern/54874: fix load failure of the exec_aout kernel module.

Revision 1.42 / (download) - annotate - [select for diffs], Sat Jan 4 03:46:19 2020 UTC (4 years, 3 months ago) by kamil
Branch: MAIN
CVS Tags: ad-namecache-base2, ad-namecache-base1, ad-namecache-base
Branch point for: ad-namecache
Changes since 1.41: +2 -2 lines
Diff to previous 1.41 (colored)

Rename sys_ptrace_lwpstatus.c to sys_process_lwpstatus.c

Keep the names of functions internally as ptrace intact as this code
is shared with core_elf32.c that already reaches ptrace(2) specifc symbols.

No functional change intended.

Revision 1.41 / (download) - annotate - [select for diffs], Thu Dec 26 08:52:38 2019 UTC (4 years, 3 months ago) by kamil
Branch: MAIN
Changes since 1.40: +2 -1 lines
Diff to previous 1.40 (colored)

Put ptrace_read_lwpstatus() and process_read_lwpstatus() to a new file

Fixes "no PTRACE" kernel build, in particular zaurus kernel=INSTALL_C700.

Revision 1.40 / (download) - annotate - [select for diffs], Fri Dec 20 21:20:09 2019 UTC (4 years, 3 months ago) by ad
Branch: MAIN
Changes since 1.39: +2 -1 lines
Diff to previous 1.39 (colored)

Split subr_cpu.c out of kern_cpu.c, to contain routines shared with rump.

Revision 1.39 / (download) - annotate - [select for diffs], Thu Dec 12 22:55:20 2019 UTC (4 years, 4 months ago) by pgoyette
Branch: MAIN
Changes since 1.38: +2 -1 lines
Diff to previous 1.38 (colored)

Eliminate per-hook duplication of common code as suggested by
(and with major contributions from) riastradh@

Welcome to 9.99.23

Revision 1.38 / (download) - annotate - [select for diffs], Wed Nov 20 19:37:53 2019 UTC (4 years, 4 months ago) by pgoyette
Branch: MAIN
Changes since 1.37: +2 -2 lines
Diff to previous 1.37 (colored)

Move all non-emulation-specific coredump code into the coredump module,
and remove all #ifdef COREDUMP conditional compilation.  Now, the
coredump module is completely separated from the emulation modules, and
they can all be independently loaded and unloaded.

Welcome to 9.99.18 !

Revision 1.37 / (download) - annotate - [select for diffs], Thu Nov 14 16:23:52 2019 UTC (4 years, 4 months ago) by maxv
Branch: MAIN
CVS Tags: phil-wifi-20191119
Changes since 1.36: +2 -1 lines
Diff to previous 1.36 (colored)

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.

Revision 1.36 / (download) - annotate - [select for diffs], Tue Nov 5 20:19:17 2019 UTC (4 years, 5 months ago) by maxv
Branch: MAIN
Changes since 1.35: +2 -1 lines
Diff to previous 1.35 (colored)

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.

Revision 1.35 / (download) - annotate - [select for diffs], Thu Aug 15 12:24:08 2019 UTC (4 years, 7 months ago) by maxv
Branch: MAIN
Changes since 1.34: +2 -4 lines
Diff to previous 1.34 (colored)

Unlink KMEM_GUARD leftovers.

Revision 1.16.4.2 / (download) - annotate - [select for diffs], Mon Jun 10 22:09:03 2019 UTC (4 years, 10 months ago) by christos
Branch: phil-wifi
Changes since 1.16.4.1: +22 -8 lines
Diff to previous 1.16.4.1 (colored) to branchpoint 1.16 (colored)

Sync with HEAD

Revision 1.34 / (download) - annotate - [select for diffs], Thu Apr 4 20:19:07 2019 UTC (5 years ago) by christos
Branch: MAIN
CVS Tags: phil-wifi-20190609, netbsd-9-base, netbsd-9-0-RC1, isaki-audio2-base, isaki-audio2
Branch point for: netbsd-9
Changes since 1.33: +2 -1 lines
Diff to previous 1.33 (colored)

move setdisklabel(9) into a separate file.

Revision 1.33 / (download) - annotate - [select for diffs], Sat Feb 23 03:10:06 2019 UTC (5 years, 1 month ago) by kamil
Branch: MAIN
Changes since 1.32: +2 -1 lines
Diff to previous 1.32 (colored)

Add KCOV - kernel code coverage tracing device

The KCOV driver implements collection of code coverage inside the kernel.
It can be enabled on a per process basis from userland, allowing the kernel
program counter to be collected during syscalls triggered by the same
process.

The device is oriented towards kernel fuzzers, in particular syzkaller.

Currently the only supported coverage type is -fsanitize-coverage=trace-pc.

The KCOV driver was initially developed in Linux. A driver based on the
same concept was then implemented in FreeBSD and OpenBSD.

Documentation is borrowed from OpenBSD and ATF tests from FreeBSD.

This patch has been prepared by Siddharth Muralee, improved by <maxv>
and polished by myself before importing into the mainline tree.

All ATF tests pass.

Revision 1.32 / (download) - annotate - [select for diffs], Wed Feb 13 18:04:35 2019 UTC (5 years, 2 months ago) by kamil
Branch: MAIN
Changes since 1.31: +2 -1 lines
Diff to previous 1.31 (colored)

Silent UB alignment issues in acpica under kUBSan

Pass -DACPI_MISALIGNMENT_NOT_SUPPORTED under kUBSan enabled. This option
is dedicated for alignment sensitive CPUs in acpica. It was originally
designed for Itanium CPUs, but nowadays it's wanted for aarch64 as well.

Define it in acpica code under kUBSan in order to pacify Undefined Behavior
reports on all ports (in particular x86). The number of reports is now
halved with this patch applied. The remaining alignment alarms in acpica
will be addressed in future.

Patch contributed by <Akul Pillai>

Revision 1.31 / (download) - annotate - [select for diffs], Sun Jan 27 02:08:43 2019 UTC (5 years, 2 months ago) by pgoyette
Branch: MAIN
Changes since 1.30: +3 -3 lines
Diff to previous 1.30 (colored)

Merge the [pgoyette-compat] branch

Revision 1.16.2.12 / (download) - annotate - [select for diffs], Fri Jan 18 08:50:57 2019 UTC (5 years, 2 months ago) by pgoyette
Branch: pgoyette-compat
CVS Tags: pgoyette-compat-merge-20190127
Changes since 1.16.2.11: +2 -1 lines
Diff to previous 1.16.2.11 (colored) to branchpoint 1.16 (colored) next main 1.17 (colored)

Synch with HEAD

Revision 1.30 / (download) - annotate - [select for diffs], Wed Jan 9 04:01:20 2019 UTC (5 years, 3 months ago) by mrg
Branch: MAIN
CVS Tags: pgoyette-compat-20190127, pgoyette-compat-20190118
Changes since 1.29: +2 -1 lines
Diff to previous 1.29 (colored)

crashme: a framework to test kernel faults.

so far, only a basic panic() and null deref nodes are added.
with options DEBUG, one can now use:

   # sysctl -w kern.crashme_enable=1

   # sysctl -w kern.crashme.panic=1
   # sysctl -w kern.crashme.null_deref=1

to trigger a crash.  crashme_enable must be set to 1 before any
of the nodes will be writeable.

supports dynamic additional/removal of crashme nodes.


(obsoletes kern.panic_now, which will be removed later.)

Revision 1.16.2.11 / (download) - annotate - [select for diffs], Wed Dec 26 14:02:03 2018 UTC (5 years, 3 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.16.2.10: +5 -1 lines
Diff to previous 1.16.2.10 (colored) to branchpoint 1.16 (colored)

Sync with HEAD, resolve a few conflicts

Revision 1.29 / (download) - annotate - [select for diffs], Mon Dec 24 16:58:54 2018 UTC (5 years, 3 months ago) by thorpej
Branch: MAIN
CVS Tags: pgoyette-compat-1226
Changes since 1.28: +2 -1 lines
Diff to previous 1.28 (colored)

Add threadpool(9), an abstraction that provides shared pools of kernel
threads running at specific priorities, with support for unbound pools
and per-cpu pools.

Written by riastradh@, and based on the May 2014 draft, with a few changes
by me:
- Working on the assumption that a relative few priorities will actually
  be used, reduce the memory footprint by using linked lists, rather than
  2 large (and mostly empty) tables.  The performance impact is essentially
  nil, since these lists are consulted only when pools are created (and
  destroyed, for DIAGNOSTIC checks), and the lists will have at most 225
  entries.
- Make threadpool job object, which the caller must allocate storage for,
  really opaque.
- Use typedefs for the threadpool types, to reduce the verbosity of the
  API somewhat.
- Fix a bunch of pool / worker thread / job object lifecycle bugs.

Also include an ATF unit test, written by me, that exercises the basics
of the API by loading a kernel module that exposes several sysctls that
allow the ATF test script to create and destroy threadpools, schedule a
basic job, and verify that it ran.

And thus NetBSD 8.99.29 has arrived.

Revision 1.28 / (download) - annotate - [select for diffs], Sun Dec 16 14:06:56 2018 UTC (5 years, 3 months ago) by rmind
Branch: MAIN
Changes since 1.27: +2 -1 lines
Diff to previous 1.27 (colored)

Import thmap -- a concurrent trie-hash map, combining the elements of
hashing and radix trie.  It supports lock-free lookups and concurrent
inserts/deletes.  It is designed to be optimal as a general purpose
*concurrent* associative array.

Upstream: https://github.com/rmind/thmap
Discussed on tech-kern@

Revision 1.27 / (download) - annotate - [select for diffs], Mon Dec 3 00:11:02 2018 UTC (5 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.26: +2 -1 lines
Diff to previous 1.26 (colored)

Expose addresses depending on the KASLR setting (from mrg@). Restores the
status quo of exposing kernel addresses if there is no KASLR.

Revision 1.26 / (download) - annotate - [select for diffs], Sun Dec 2 21:00:13 2018 UTC (5 years, 4 months ago) by maxv
Branch: MAIN
Changes since 1.25: +2 -1 lines
Diff to previous 1.25 (colored)

Introduce KLEAK, a new feature that can detect kernel information leaks.

It works by tainting memory sources with marker values, letting the data
travel through the kernel, and scanning the kernel<->user frontier for
these marker values. Combined with compiler instrumentation and rotation
of the markers, it is able to yield relevant results with little effort.

We taint the pools and the stack, and scan copyout/copyoutstr. KLEAK is
supported on amd64 only for now, but it is not complicated to add more
architectures (just a matter of having the address of .text, and a stack
unwinder).

A userland tool is provided, that allows to execute a command in rounds
and monitor the leaks generated all the while.

KLEAK already detected directly 12 kernel info leaks, and prompted changes
that in total fixed 25+ leaks.

Based on an idea developed jointly with Thomas Barabosch (of Fraunhofer
FKIE).

Revision 1.16.2.10 / (download) - annotate - [select for diffs], Mon Nov 26 01:52:50 2018 UTC (5 years, 4 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.16.2.9: +2 -2 lines
Diff to previous 1.16.2.9 (colored) to branchpoint 1.16 (colored)

Sync with HEAD, resolve a couple of conflicts

Revision 1.25 / (download) - annotate - [select for diffs], Thu Nov 15 09:38:57 2018 UTC (5 years, 4 months ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-compat-1126
Changes since 1.24: +1 -2 lines
Diff to previous 1.24 (colored)

Merge uipc_mbuf2.c into uipc_mbuf.c. Reorder the latter a little to gather
similar functions. No functional change.

Revision 1.24 / (download) - annotate - [select for diffs], Wed Oct 31 06:26:26 2018 UTC (5 years, 5 months ago) by maxv
Branch: MAIN
Changes since 1.23: +2 -1 lines
Diff to previous 1.23 (colored)

Move the MI parts of KASAN into kern/subr_asan.c. This file includes
machine/asan.h, which contains the MD functions. We use an include rather
than a plain C file, because we want GCC to optimize/inline some functions
into one single block.

The amd64 MD parts of KASAN are moved accordingly.

The naming convention we use is:

	kasan_*
		a generic kasan object, declared in subr_asan.c
	kasan_md_*
		an MD kasan object, declared in machine/asan.h, and used
		in subr_asan.c
	__md_*
		an MD object, declared in machine/asan.h, and not used
		outside

Overall this makes it easier to add KASAN support on more architectures.

Discussed with several people.

Revision 1.16.2.9 / (download) - annotate - [select for diffs], Sun Sep 30 01:45:55 2018 UTC (5 years, 6 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.16.2.8: +3 -2 lines
Diff to previous 1.16.2.8 (colored) to branchpoint 1.16 (colored)

Ssync with HEAD

Revision 1.23 / (download) - annotate - [select for diffs], Fri Sep 14 01:55:19 2018 UTC (5 years, 7 months ago) by mrg
Branch: MAIN
CVS Tags: pgoyette-compat-1020, pgoyette-compat-0930
Changes since 1.22: +3 -2 lines
Diff to previous 1.22 (colored)

retire kern_xxx.c.  long live kern_xxx.c.

split it into kern_reboot.c and kern_scdebug.c.  while here,
add my copyright to kern_scdebug.c as it was largely rewritten
for kernhist support.

Revision 1.16.2.8 / (download) - annotate - [select for diffs], Thu Sep 6 06:56:41 2018 UTC (5 years, 7 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.16.2.7: +7 -3 lines
Diff to previous 1.16.2.7 (colored) to branchpoint 1.16 (colored)

Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)

Revision 1.22 / (download) - annotate - [select for diffs], Mon Aug 20 11:35:28 2018 UTC (5 years, 7 months ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-compat-0906
Changes since 1.21: +1 -3 lines
Diff to previous 1.21 (colored)

Retire KMEM_REDZONE and KMEM_POISON.

KMEM_REDZONE is not very efficient and cannot detect read overflows. KASAN
can, and will be used instead.

KMEM_POISON is enabled along with KMEM_GUARD, but it is redundant, since
the latter can detect read UAFs contrary to the former. In fact maybe
KMEM_GUARD should be retired too, because there are many cases where it
doesn't apply.

Simplifies the code.

Revision 1.21 / (download) - annotate - [select for diffs], Fri Aug 3 04:35:20 2018 UTC (5 years, 8 months ago) by kamil
Branch: MAIN
Changes since 1.20: +7 -1 lines
Diff to previous 1.20 (colored)

Register kUBSan in the GENERIC amd64 kernel config

Tested with GCC.

Revision 1.16.2.7 / (download) - annotate - [select for diffs], Thu Aug 2 05:34:09 2018 UTC (5 years, 8 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.16.2.6: +1 -3 lines
Diff to previous 1.16.2.6 (colored) to branchpoint 1.16 (colored)

Clean up from sync-with-HEAD

Revision 1.16.2.6 / (download) - annotate - [select for diffs], Sat Jul 28 04:38:08 2018 UTC (5 years, 8 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.16.2.5: +5 -2 lines
Diff to previous 1.16.2.5 (colored) to branchpoint 1.16 (colored)

Sync with HEAD

Revision 1.20 / (download) - annotate - [select for diffs], Wed Jul 18 07:06:40 2018 UTC (5 years, 8 months ago) by msaitoh
Branch: MAIN
CVS Tags: pgoyette-compat-0728
Changes since 1.19: +2 -2 lines
Diff to previous 1.19 (colored)

- Fix compile error for kernel configuration file which has no any Ethernet
  device driver.
- Add missing default label.
- Fix NetBSD RCS Id.

Revision 1.19 / (download) - annotate - [select for diffs], Tue Jul 17 05:52:07 2018 UTC (5 years, 8 months ago) by msaitoh
Branch: MAIN
Changes since 1.18: +2 -1 lines
Diff to previous 1.18 (colored)

 Add /d(dump) and /v(verbose) modifiers to DDB's "show mbuf" command. Mainly
written by Hiroki SUENAGA. Currently, /v supports Ethernet, PPP, PPPoE, ARP,
IPv4, ICMP, IPv6, ICMPv6, TCP and UDP.

Revision 1.16.4.1 / (download) - annotate - [select for diffs], Thu Jul 12 16:35:34 2018 UTC (5 years, 9 months ago) by phil
Branch: phil-wifi
Changes since 1.16: +2 -1 lines
Diff to previous 1.16 (colored)

State save.  New kernel config for this brach only.  TESTWIFI does
produce a kernel.  It is not working.  athn files not compiling yet
and commented out of the TESTWIFI kernel, which only has urtwn 802.11
driver enabled.  ieee80211_alq.c and ieee80211_ddb.c not compiling yet.

Revision 1.18 / (download) - annotate - [select for diffs], Thu Jul 12 10:46:48 2018 UTC (5 years, 9 months ago) by maxv
Branch: MAIN
Changes since 1.17: +1 -2 lines
Diff to previous 1.17 (colored)

Remove the kernel PMC code. Sent yesterday on tech-kern@.

This change:

 * Removes "options PERFCTRS", the associated includes, and the associated
   ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is
   good.

 * Removes the PMC code of ARM XSCALE.

 * Removes all the pmc.h files. They were all empty, except for ARM XSCALE.

 * Reorders the x86 PMC code not to rely on the legacy pmc.h file. The
   definitions are put in sysarch.h.

 * Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control
   and sys_pmc_get_info syscalls. They are marked as OBSOL in kern,
   netbsd32 and rump.

 * Removes the pmc_evid_t and pmc_ctr_t types.

 * Removes all the associated man pages. The sets are marked as obsolete.

Revision 1.17 / (download) - annotate - [select for diffs], Sat Jun 30 00:37:38 2018 UTC (5 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.16: +2 -1 lines
Diff to previous 1.16 (colored)

defflag {SETUID,FD}SCRIPTS

Revision 1.16.2.5 / (download) - annotate - [select for diffs], Tue Mar 20 08:11:25 2018 UTC (6 years ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.16.2.4: +2 -1 lines
Diff to previous 1.16.2.4 (colored) to branchpoint 1.16 (colored)

Initial implementation of sys/kern/kern_stup.c as discussed on tech-kern

For now, we only handle the dev/ccd and NTP needs;  more to follow.

Revision 1.16.2.4 / (download) - annotate - [select for diffs], Wed Mar 7 09:33:26 2018 UTC (6 years, 1 month ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.16.2.3: +2 -1 lines
Diff to previous 1.16.2.3 (colored) to branchpoint 1.16 (colored)

Move the emul_find_root() and emul_find_interp() to a new file
subr_emul.c

The previous location was in exec_elf.c but that can get built
multiple times for a single kernel, so we could end up with
duplicate symbols.

Thanks to ,rg@ for the heads-up.

Revision 1.16.2.3 / (download) - annotate - [select for diffs], Tue Mar 6 10:37:41 2018 UTC (6 years, 1 month ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.16.2.2: +1 -2 lines
Diff to previous 1.16.2.2 (colored) to branchpoint 1.16 (colored)

Move necessary routines out of compat_util.c and into exec_elf.c

Once again, compat_util.c is only for modules, so move it back into
compat/common/files.common and out of kern/files.kern

Revision 1.16.2.2 / (download) - annotate - [select for diffs], Tue Mar 6 09:43:06 2018 UTC (6 years, 1 month ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.16.2.1: +2 -2 lines
Diff to previous 1.16.2.1 (colored) to branchpoint 1.16 (colored)

Routine emulexec() in kern_exec.c needs emul_find_root().  Since
kern_exec.c is included in every kernel, so compat_util.c needs to
be included, too.

Revision 1.16.2.1 / (download) - annotate - [select for diffs], Tue Mar 6 05:44:37 2018 UTC (6 years, 1 month ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.16: +2 -3 lines
Diff to previous 1.16 (colored)

Don't include the compat_mod.c here

Revision 1.16 / (download) - annotate - [select for diffs], Sat Dec 16 10:15:12 2017 UTC (6 years, 3 months ago) by maxv
Branch: MAIN
CVS Tags: phil-wifi-base, pgoyette-compat-base, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315
Branch point for: phil-wifi, pgoyette-compat
Changes since 1.15: +2 -1 lines
Diff to previous 1.15 (colored)

compat_util.c must be compiled by default in the kernel. It is needed by
generic non-compat code, so it must not depend on anything (libcompat or
whatever option we choose to associate it to).

Revision 1.15.8.2 / (download) - annotate - [select for diffs], Sun Dec 3 11:38:44 2017 UTC (6 years, 4 months ago) by jdolecek
Branch: tls-maxphys
Changes since 1.15.8.1: +218 -0 lines
Diff to previous 1.15.8.1 (colored) to branchpoint 1.15 (colored) next main 1.16 (colored)

update from HEAD

Revision 1.2.2.8 / (download) - annotate - [select for diffs], Mon Aug 28 17:53:07 2017 UTC (6 years, 7 months ago) by skrll
Branch: nick-nhusb
Changes since 1.2.2.7: +7 -1 lines
Diff to previous 1.2.2.7 (colored) to branchpoint 1.2 (colored) next main 1.3 (colored)

Sync with HEAD

Revision 1.15.8.1, Fri May 19 00:01:33 2017 UTC (6 years, 10 months ago) by jdolecek
Branch: tls-maxphys
Changes since 1.15: +0 -218 lines
FILE REMOVED

file files.kern was added on branch tls-maxphys on 2017-12-03 11:38:44 +0000

Revision 1.15 / (download) - annotate - [select for diffs], Fri May 19 00:01:33 2017 UTC (6 years, 10 months ago) by pgoyette
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202, perseant-stdc-iso10646-base, perseant-stdc-iso10646, nick-nhusb-base-20170825, netbsd-8-base, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, matt-nb8-mediatek-base, matt-nb8-mediatek
Branch point for: tls-maxphys, netbsd-8
Changes since 1.14: +2 -1 lines
Diff to previous 1.14 (colored)

Introduce new localcount(9) reference-count primitives.

Revision 1.14.2.1 / (download) - annotate - [select for diffs], Thu Apr 27 05:36:37 2017 UTC (6 years, 11 months ago) by pgoyette
Branch: prg-localcount2
Changes since 1.14: +2 -1 lines
Diff to previous 1.14 (colored) next main 1.15 (colored)

Restore all work from the former pgoyette-localcount branch (which is
now abandoned doe to cvs merge botch).

The branch now builds, and installs via anita.  There are still some
problems (cgd is non-functional and all atf tests time-out) but they
will get resolved soon.

Revision 1.11.2.3 / (download) - annotate - [select for diffs], Wed Apr 26 02:53:26 2017 UTC (6 years, 11 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.11.2.2: +6 -1 lines
Diff to previous 1.11.2.2 (colored) to branchpoint 1.11 (colored) next main 1.12 (colored)

Sync with HEAD

Revision 1.13.2.1 / (download) - annotate - [select for diffs], Fri Apr 21 16:54:02 2017 UTC (6 years, 11 months ago) by bouyer
Branch: bouyer-socketcan
Changes since 1.13: +6 -1 lines
Diff to previous 1.13 (colored) next main 1.14 (colored)

Sync with HEAD

Revision 1.14 / (download) - annotate - [select for diffs], Wed Apr 12 20:05:54 2017 UTC (7 years ago) by christos
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, pgoyette-localcount-20170426, bouyer-socketcan-base1
Branch point for: prg-localcount2
Changes since 1.13: +6 -1 lines
Diff to previous 1.13 (colored)

use opt_kmem.h for the KMEM_ variables.

Revision 1.2.2.7 / (download) - annotate - [select for diffs], Mon Dec 5 10:55:26 2016 UTC (7 years, 4 months ago) by skrll
Branch: nick-nhusb
Changes since 1.2.2.6: +4 -2 lines
Diff to previous 1.2.2.6 (colored) to branchpoint 1.2 (colored)

Sync with HEAD

Revision 1.11.2.2 / (download) - annotate - [select for diffs], Fri Nov 4 14:49:17 2016 UTC (7 years, 5 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.11.2.1: +8 -3 lines
Diff to previous 1.11.2.1 (colored) to branchpoint 1.11 (colored)

Sync with HEAD

Revision 1.13 / (download) - annotate - [select for diffs], Wed Nov 2 00:11:59 2016 UTC (7 years, 5 months ago) by pgoyette
Branch: MAIN
CVS Tags: pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, nick-nhusb-base-20170204, nick-nhusb-base-20161204, jdolecek-ncq-base, jdolecek-ncq, bouyer-socketcan-base
Branch point for: bouyer-socketcan
Changes since 1.12: +4 -2 lines
Diff to previous 1.12 (colored)

* Split sys/kern/sys_process.c into three parts:
        1 - ptrace(2) syscall for native emulation
        2 - common ptrace(2) syscall code (shared with compat_netbsd32)
        3 - support routines that are shared with PROCFS and/or KTRACE

* Add module glue for #1 and #2.  Both modules will be built-in to the
  kernel if "options PTRACE" is included in the config file (this is
  the default, defined in sys/conf/std).

* Mark the ptrace(2) syscall as modular in syscalls.master (generated
  files will be committed shortly).

* Conditionalize all remaining portions of PTRACE code on a new kernel
  option PTRACE_HOOKS.

XXX Instead of PROCFS depending on 'options PTRACE', we should probably
    just add a procfs attribute to the sys/kern/sys_process.c file's
    entry in files.kern, and add PROCFS to the "#if defineds" for
    process_domem().  It's really confusing to have two different ways
    of requiring this file.

Revision 1.2.2.6 / (download) - annotate - [select for diffs], Wed Oct 5 20:56:02 2016 UTC (7 years, 6 months ago) by skrll
Branch: nick-nhusb
Changes since 1.2.2.5: +5 -2 lines
Diff to previous 1.2.2.5 (colored) to branchpoint 1.2 (colored)

Sync with HEAD

Revision 1.12 / (download) - annotate - [select for diffs], Fri Sep 16 03:10:45 2016 UTC (7 years, 6 months ago) by pgoyette
Branch: MAIN
CVS Tags: nick-nhusb-base-20161004
Changes since 1.11: +5 -2 lines
Diff to previous 1.11 (colored)

Move kern_ctf.c into the dtrace_fbt module (the only place it is used)
rather than including in kernels with KDTRACE_HOOKS defined.  Update
the dtrace_fbt module to depend on the zlib module.

Bump kernel version to avoid module mismatch.

Welcome to 7.99.38 !

Revision 1.11.2.1 / (download) - annotate - [select for diffs], Fri Jul 15 02:29:19 2016 UTC (7 years, 9 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.11: +2 -1 lines
Diff to previous 1.11 (colored)

Initial import of localcount(9) as proposed by riastradh@

This version compiles, but nothing uses it, yet.

Revision 1.2.2.5 / (download) - annotate - [select for diffs], Fri Apr 22 15:44:16 2016 UTC (7 years, 11 months ago) by skrll
Branch: nick-nhusb
Changes since 1.2.2.4: +2 -1 lines
Diff to previous 1.2.2.4 (colored) to branchpoint 1.2 (colored)

Sync with HEAD

Revision 1.11 / (download) - annotate - [select for diffs], Sat Apr 9 06:21:16 2016 UTC (8 years ago) by riastradh
Branch: MAIN
CVS Tags: pgoyette-localcount-base, pgoyette-localcount-20160806, pgoyette-localcount-20160726, nick-nhusb-base-20160907, nick-nhusb-base-20160529, nick-nhusb-base-20160422, localcount-20160914
Branch point for: pgoyette-localcount
Changes since 1.10: +2 -1 lines
Diff to previous 1.10 (colored)

Add passive references, intermediate between pserialize and refcount.

Discussed on tech-kern:

https://mail-index.netbsd.org/tech-kern/2016/01/24/msg020069.html

API is still experimental and likely to change.  (Obvious changes:
either remove extra arguments everywhere, or shrink psref_target to a
single bit, at the expense of possibly valuable diagnostic checks.)
Should do some real testing before we use this in anger!

Revision 1.2.2.4 / (download) - annotate - [select for diffs], Sun Dec 27 12:10:05 2015 UTC (8 years, 3 months ago) by skrll
Branch: nick-nhusb
Changes since 1.2.2.3: +1 -3 lines
Diff to previous 1.2.2.3 (colored) to branchpoint 1.2 (colored)

Sync with HEAD (as of 26th Dec)

Revision 1.10 / (download) - annotate - [select for diffs], Thu Dec 3 02:51:00 2015 UTC (8 years, 4 months ago) by pgoyette
Branch: MAIN
CVS Tags: nick-nhusb-base-20160319, nick-nhusb-base-20151226
Changes since 1.9: +1 -3 lines
Diff to previous 1.9 (colored)

Merge the compat_sysv module into the sysv_ipc module - it should
never have been a separate module in the first place (my bad).

Adjust dependencies as appropriate.

Revision 1.2.2.3 / (download) - annotate - [select for diffs], Tue Sep 22 12:06:07 2015 UTC (8 years, 6 months ago) by skrll
Branch: nick-nhusb
Changes since 1.2.2.2: +3 -25 lines
Diff to previous 1.2.2.2 (colored) to branchpoint 1.2 (colored)

Sync with HEAD

Revision 1.9 / (download) - annotate - [select for diffs], Thu Sep 3 01:09:38 2015 UTC (8 years, 7 months ago) by uebayasi
Branch: MAIN
CVS Tags: nick-nhusb-base-20150921
Changes since 1.8: +1 -0 lines
Diff to previous 1.8 (colored)

Build conf/param.c normally.

Revision 1.8 / (download) - annotate - [select for diffs], Fri Aug 21 02:18:18 2015 UTC (8 years, 7 months ago) by uebayasi
Branch: MAIN
Changes since 1.7: +1 -25 lines
Diff to previous 1.7 (colored)

Move dev/ definitions out of files.kern.

Revision 1.7 / (download) - annotate - [select for diffs], Mon Aug 17 06:16:03 2015 UTC (8 years, 7 months ago) by knakahara
Branch: MAIN
Changes since 1.6: +2 -1 lines
Diff to previous 1.6 (colored)

Add kernel code to support intrctl(8).

Revision 1.2.2.2 / (download) - annotate - [select for diffs], Sat Jun 6 14:40:21 2015 UTC (8 years, 10 months ago) by skrll
Branch: nick-nhusb
Changes since 1.2.2.1: +4 -4 lines
Diff to previous 1.2.2.1 (colored) to branchpoint 1.2 (colored)

Sync with HEAD

Revision 1.6 / (download) - annotate - [select for diffs], Sun May 10 07:41:15 2015 UTC (8 years, 11 months ago) by pgoyette
Branch: MAIN
CVS Tags: nick-nhusb-base-20150606
Changes since 1.5: +3 -1 lines
Diff to previous 1.5 (colored)

Split the SYSV* compat code out into a separate compat_sysv module.

For monolithic kernels, both modules will be compiled as "built-ins",
while modular environments will be able to load the SYSVSEM, SYSVSHM,
and SYSVMSG code independant from the rest of compat.

This is a necessary precursor step to making the "STD" SYSV* code
into a separate module.

Tested in both monolithic and modular environments with no errors
seen.

Revision 1.5 / (download) - annotate - [select for diffs], Wed May 6 15:57:08 2015 UTC (8 years, 11 months ago) by hannken
Branch: MAIN
Changes since 1.4: +1 -3 lines
Diff to previous 1.4 (colored)

Remove miscfs/syncfs and

- move the syncer into kern/vfs_subr.c.

- change the syncer to process the mountlist and VFS_SYNC as appropriate.

- use an API for mount points similiar to the API for vnodes:
  - vfs_syncer_add_to_worklist(struct mount *mp) to add
  - vfs_syncer_remove_from_worklist(struct mount *mp) to remove a mount.

No objections on tech-kern@

Revision 1.4 / (download) - annotate - [select for diffs], Sat May 2 12:57:19 2015 UTC (8 years, 11 months ago) by mlelstv
Branch: MAIN
Changes since 1.3: +2 -2 lines
Diff to previous 1.3 (colored)

Merge dk_intf and dkdriver interfaces.
Merge common disk driver functionality in ld.c with dksubr.c.
Adjust the two previous users of dk_intf (cgd and xbd) to
the changes.

This file was missing from the commit.

Revision 1.2.2.1 / (download) - annotate - [select for diffs], Mon Apr 6 15:18:20 2015 UTC (9 years ago) by skrll
Branch: nick-nhusb
Changes since 1.2: +2 -2 lines
Diff to previous 1.2 (colored)

Sync with HEAD

Revision 1.3 / (download) - annotate - [select for diffs], Sat Mar 7 16:35:37 2015 UTC (9 years, 1 month ago) by christos
Branch: MAIN
CVS Tags: nick-nhusb-base-20150406
Changes since 1.2: +2 -2 lines
Diff to previous 1.2 (colored)

syscallnames are needed by dtrace

Revision 1.2 / (download) - annotate - [select for diffs], Sun Oct 12 04:38:28 2014 UTC (9 years, 6 months ago) by uebayasi
Branch: MAIN
CVS Tags: nick-nhusb-base
Branch point for: nick-nhusb
Changes since 1.1: +6 -6 lines
Diff to previous 1.1 (colored)

Mark some stray files as kern for now.

Revision 1.1 / (download) - annotate - [select for diffs], Sun Oct 12 04:30:42 2014 UTC (9 years, 6 months ago) by uebayasi
Branch: MAIN

Move kern definitions.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>