Commit Graph

19274 Commits

Author SHA1 Message Date
Konstantin Belousov
cc29f221aa ksiginfo_alloc(): change to directly take M_WAITOK/NOWAIT flags
Also style, and remove unneeded cast.

Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D36207
2022-08-20 20:33:17 +03:00
Konstantin Belousov
5c78797e42 reap_kill_proc_locked(): remove outdated part of the comment
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential revision:	https://reviews.freebsd.org/D36207
2022-08-20 20:33:17 +03:00
Konstantin Belousov
30b16a6bcf exit1(): update comment about thread_single()
We do not check single-threading conditions in trap, or when sleeping
uninterruptible.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential revision:	https://reviews.freebsd.org/D36207
2022-08-20 20:33:17 +03:00
Konstantin Belousov
f835be5822 sleepq_set_timeout_sbt(): correct comment to not talk about ticks
It is sbt now.  Also, explain what flags are.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential revision:	https://reviews.freebsd.org/D36207
2022-08-20 20:33:17 +03:00
Konstantin Belousov
da39a100db sleepq_check_ast_sc_locked(): update comment
The relock order is important not only for a signal delivery, but also
for the suspension requests.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential revision:	https://reviews.freebsd.org/D36207
2022-08-20 20:33:17 +03:00
Konstantin Belousov
bd76586bb7 fork_norfproc(): style
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential revision:	https://reviews.freebsd.org/D36207
2022-08-20 20:33:17 +03:00
Mateusz Guzik
497240def8 Retire clone_drain_lock
It is only ever xlocked in drain_dev_clone_events and the only consumer of
that routine does not need it -- eventhandler code already makes sure the
relevant callback is no longer running.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D36268
2022-08-20 09:44:05 +00:00
Gleb Smirnoff
820bafd0bc unix/dgram: don't panic if socket buffer has negative space
That's a legitimate scenario, although unlikely.

Reported by:	https://syzkaller.appspot.com/bug?extid=6e8be1ec8d77578a3df4
2022-08-19 12:15:38 -07:00
Mateusz Guzik
545db925c3 pipe: fix EOF case for non-blocking fds
In particular unbreaks 'go build'.
2022-08-18 21:23:53 +00:00
Gleb Smirnoff
e7d02be19d protosw: refactor protosw and domain static declaration and load
o Assert that every protosw has pr_attach.  Now this structure is
  only for socket protocols declarations and nothing else.
o Merge struct pr_usrreqs into struct protosw.  This was suggested
  in 1996 by wollman@ (see 7b187005d1), and later reiterated
  in 2006 by rwatson@ (see 6fbb9cf860).
o Make struct domain hold a variable sized array of protosw pointers.
  For most protocols these pointers are initialized statically.
  Those domains that may have loadable protocols have spacers. IPv4
  and IPv6 have 8 spacers each (andre@ dff3237ee5).
o For inetsw and inet6sw leave a comment noting that many protosw
  entries very likely are dead code.
o Refactor pf_proto_[un]register() into protosw_[un]register().
o Isolate pr_*_notsupp() methods into uipc_domain.c

Reviewed by:		melifaro
Differential revision:	https://reviews.freebsd.org/D36232
2022-08-17 11:50:32 -07:00
Gleb Smirnoff
f6dc5aa342 unix: use private enum as argument for unp_connect2()
instead of using historic PRU_ flags that are now not used by anything
rather than TCP debugging.
2022-08-17 11:50:31 -07:00
Gleb Smirnoff
81a34d374e protosw: retire pr_drain and use EVENTHANDLER(9) directly
The method was called for two different conditions: 1) the VM layer is
low on pages or 2) one of UMA zones of mbuf allocator exhausted.
This change 2) into a new event handler, but all affected network
subsystems modified to subscribe to both, so this change shall not
bring functional changes under different low memory situations.

There were three subsystems still using pr_drain: TCP, SCTP and frag6.
The latter had its protosw entry for the only reason to register its
pr_drain method.

Reviewed by:		tuexen, melifaro
Differential revision:	https://reviews.freebsd.org/D36164
2022-08-17 11:50:31 -07:00
Gleb Smirnoff
1922eb3e9c protosw: retire pr_slowtimo and pr_fasttimo
They were useful many years ago, when the callwheel was not efficient,
and the kernel tried to have as little callout entries scheduled as
possible.

Reviewed by:		tuexen, melifaro
Differential revision:	https://reviews.freebsd.org/D36163
2022-08-17 11:50:31 -07:00
Gleb Smirnoff
78b1fc05b2 protosw: separate pr_input and pr_ctlinput out of protosw
The protosw KPI historically has implemented two quite orthogonal
things: protocols that implement a certain kind of socket, and
protocols that are IPv4/IPv6 protocol.  These two things do not
make one-to-one correspondence. The pr_input and pr_ctlinput methods
were utilized only in IP protocols.  This strange duality required
IP protocols that doesn't have a socket to declare protosw, e.g.
carp(4).  On the other hand developers of socket protocols thought
that they need to define pr_input/pr_ctlinput always, which lead to
strange dead code, e.g. div_input() or sdp_ctlinput().

With this change pr_input and pr_ctlinput as part of protosw disappear
and IPv4/IPv6 get their private single level protocol switch table
ip_protox[] and ip6_protox[] respectively, pointing at array of
ipproto_input_t functions.  The pr_ctlinput that was used for
control input coming from the network (ICMP, ICMPv6) is now represented
by ip_ctlprotox[] and ip6_ctlprotox[].

ipproto_register() becomes the only official way to register in the
table.  Those protocols that were always static and unlikely anybody
is interested in making them loadable, are now registered by ip_init(),
ip6_init().  An IP protocol that considers itself unloadable shall
register itself within its own private SYSINIT().

Reviewed by:		tuexen, melifaro
Differential revision:	https://reviews.freebsd.org/D36157
2022-08-17 11:50:31 -07:00
Gleb Smirnoff
489482e276 ipsec: isolate knowledge about protocols that are last header
Retire PR_LASTHDR protosw flag.

Reviewed by:		ae
Differential revision:	https://reviews.freebsd.org/D36155
2022-08-17 08:24:28 -07:00
Mateusz Guzik
9ac6eda6c6 pipe: try to skip locking the pipe if a non-blocking fd is used
Reviewed by:	markj (previous version)
Differential Revision:	https://reviews.freebsd.org/D36082
2022-08-17 14:23:34 +00:00
Ed Maste
fbafa98a94 Disallow invalid PT_GNU_STACK
Stack must be at least readable and writable.

PR:		242570
Reviewed by:	kib, markj
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D35867
2022-08-16 15:52:21 -04:00
Mateusz Guzik
84a0be4a23 vfs: plug a dead store in kern_linkat_vp
Reported by:	clang --analyze
2022-08-16 10:46:29 +00:00
Mateusz Guzik
eb9a1f9c68 vfs: plug dead store in vn_io_fault1
Reported by:	clang --analyze
2022-08-16 10:46:20 +00:00
Dimitry Andric
9762d48b7f Adjust function definition in kern_poll.c to avoid clang 15 warning
With clang 15, the following -Werror warning is produced:

    sys/kern/kern_poll.c:374:16: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    netisr_pollmore()
                   ^
                    void

This is because netisr_pollmore() is declared with a (void) argument
list, but defined with an empty argument list. Make the definition match
the declaration.

MFC after:	3 days
2022-08-14 21:27:34 +02:00
Alexander V. Chernikov
9b967bd65d domains: allow domains to be unloaded
Add domain_remove() SYSUNINT callback that removes the domain
 from the domain list if it has DOMF_UNLOADABLE flag set.
This change is required to support netlink ( D36002 ).

Reviewed by:	glebius
Differential Revision: https://reviews.freebsd.org/D36173
2022-08-14 09:22:33 +00:00
Gleb Smirnoff
f277746e13 protosw: change prototype for pr_control
For some reason protosw.h is used during world complation and userland
is not aware of caddr_t, a relic from the first version of C.  Broken
buildworld is good reason to get rid of yet another caddr_t in kernel.

Fixes:	886fc1e804
2022-08-12 12:08:18 -07:00
Gleb Smirnoff
948f31d7b0 netinet: do not broadcast PRC_REDIRECT_HOST on ICMP redirect
This is expensive and useless call.  It has been useless since Alexander
melifaro@ moved the forwarding table to nexthops with passive invalidation.
What happens now is that cached route in a inpcb would get invalidated
on next ip_output().

These were the last users of pfctlinput(), so garbage collect it.

Reviewed by:		melifaro
Differential revision:	https://reviews.freebsd.org/D36156
2022-08-12 08:31:29 -07:00
Gleb Smirnoff
8c77967ecc protosw: retire pr_output method
The only place to execute this method was raw_usend(). Only those
protocols that used raw socket were able to actually enter that method.
All pr_output assignments being deleted by this commit were a dead code
for many years.

Reviewed by:		melifaro
Differential revision:	https://reviews.freebsd.org/D36126
2022-08-11 09:19:37 -07:00
Andrew Turner
8e9ca1379e Adjust function definition in subr_devmap.c to avoid clang 15 warning
With clang 15, the following -Werror warning is produced:

    sys/kern/subr_devmap.c:87:19: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    devmap_print_table()
                      ^
                       void

This is because devmap_print_table() and devmap_lastaddr() are declared
with a (void) argument list, but defined with an empty argument list.
Make the definition match the declaration.

Sponsored by:	The FreeBSD Foundation
2022-08-11 14:30:32 +01:00
Alexander V. Chernikov
102e6817f0 devd: move all devd notification logic to a separate file.
Currently, subr_bus.c shares logic for (a) maintaining all HW devices
 (e.g. discovery/attach/detach logic) and (b) generic devctl notification
 layer for devices/PMU/GEOM/interfaces/etc).
These two subsystems share really tiny interaction interface, composed of 3
 notification functions. With that in mind, move devctl layer to a
 separate file, establishing a clear notification interface between the
 sub.c bus layer and the provider (devctl).

The primary driver of this change is netlink implementation (D36002).
The idea is to propagate device-level events to netlink as well, so all
 netlink customers can subscribe to these changes.
The long-term goal is to deprecate devctl and to use netlink as the
 kernel<> userland transport provided netlink gets enough traction.

Reviewed by:	imp, markj
Differential Revision: https://reviews.freebsd.org/D36091
MFC after:	1 month
2022-08-10 18:56:01 +00:00
Gleb Smirnoff
07285bb4c2 tcp: utilize new solisten_clone() and solisten_enqueue()
This streamlines cloning of a socket from a listener.  Now we do not
drop the inpcb lock during creation of a new socket, do not do useless
state transitions, and put a fully initialized socket+inpcb+tcpcb into
the listen queue.

Before this change, first we would allocate the socket and inpcb+tcpcb via
tcp_usr_attach() as TCPS_CLOSED, link them into global list of pcbs, unlock
pcb and put this onto incomplete queue (see 6f3caa6d81).  Then, after
sonewconn() we would lock it again, transition into TCPS_SYN_RECEIVED,
insert into inpcb hash, finalize initialization of tcpcb.  And then, in
call into tcp_do_segment() and upon transition to TCPS_ESTABLISHED call
soisconnected().  This call would lock the listening socket once again
with a LOR protection sequence and then we would relocate the socket onto
the complete queue and only now it is ready for accept(2).

Reviewed by:		rrs, tuexen
Differential revision:	https://reviews.freebsd.org/D36064
2022-08-10 11:09:34 -07:00
Gleb Smirnoff
8f5a0a2e4f sockets: provide solisten_clone(), solisten_enqueue()
as alternative KPI to sonewconn().  The latter has three stages:
- check the listening socket queue limits
- allocate a new socket
- call into protocol attach method
- link the new socket into the listen queue of the listening socket

The attach method, originally designed for a creation of socket by the
socket(2) syscall has slightly different semantics than attach of a socket
cloned by listener.  Make it possible for protocols to call into the
first stage, then perform a different attach, and then call into the
final stage.  The first stage, that checks limits and clones a socket
is called solisten_clone(), and the function that enqueues the socket
is solisten_enqueue().

Reviewed by:		tuexen
Differential revision:	https://reviews.freebsd.org/D36063
2022-08-10 11:09:34 -07:00
Konstantin Belousov
00d17cf342 elf_note_prpsinfo: handle more failures from proc_getargv()
Resulting sbuf_len() from proc_getargv() might return 0 if user mangled
ps_strings enough. Also, sbuf_len() API contract is to return -1 if the
buffer overflowed. The later should not occur because get_ps_strings()
checks for catenated length, but check for this subtle detail explicitly
as well to be more resilent.

The end result is that p_comm is used in this situations.

Approved by:	so
Security:	FreeBSD-SA-22:09.elf
Reported by:	Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Reviewed by:	delphij, markj
admbugs:	988
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D35391
2022-08-09 15:44:45 -04:00
Konstantin Belousov
1b0a4974c5 thread_create(): call cpu_copy_thread() after td_pflags is zeroed
By calling the function too early we might still have the td_pflags
value cached from the previous struct thread use. cpu_copy_thread()
depends on correct value for TDP_KTHREAD at least on x86.

Reported, bisected, and tested by:	pho
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D36069
2022-08-08 19:44:17 +03:00
Gordon Bergling
fa1ac9693a vnode(9): Fix a typo in a source code comment
- s/paramater/parameter/

MFC after:	3 days
2022-08-07 16:08:43 +02:00
Ed Maste
f0687f3e0e Clarify code comments on ASLR default settings
Sponsored by:	The FreeBSD Foundation
2022-08-05 10:01:16 -04:00
Mark Johnston
d07675a935 file: Move code to share fdtol structs into kern_descrip.c
This ensures the filedesc-to-leader code is consistently encapsulated in
kern_descrip.c.

No functional change intended.

Reviewed by:	kib
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D35988
2022-08-04 09:39:25 -04:00
Konstantin Belousov
c53fec7603 sig_suspend_threads(): remove 'sending' arg
The TDA_AST flag is set on td2 unconditionally (as it was TDF_ASTPENDING
before AST rework), so it is not used practically for some time.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D36033
2022-08-03 16:56:23 +03:00
Konstantin Belousov
f2fd7d8bfc ast_sig(): add missed TDAI()
Mask checked was completely wrong

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D36033
2022-08-03 16:56:23 +03:00
Mark Johnston
852695416c domain: Use designated constants for timeout periods
No functional change intended.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-08-02 20:31:29 -04:00
Konstantin Belousov
4a662c9064 ktrace: change AST handler to require AST flag set
When it was inline it made sense to depend on the existing nested check
in KTRUSERRET() rather than adding a new td_flags flag.  However, since
we now have a TDA_KTRACE flag anyway, we might as well check it and
avoid the call.

Suggested by:	jhb
Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D35888
2022-08-02 21:11:10 +03:00
Konstantin Belousov
c46771a7b7 kern/subr_trap.c: cleanup no longer needed headers
Also bump Foundation' copyright year

Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D35888
2022-08-02 21:11:10 +03:00
Konstantin Belousov
cc1ec77231 Adjust g_waitidle() visibility and definition
Explicitly pass the struct thread argument.
Move the function prototype from sys/systm.h to geom/geom.h, we do not
need almost each kernel source to see the prototype, it is now used
only by kern/vfs_mountroot.c outside geom/geom_event.c, where the
function is defined.

Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D35888
2022-08-02 21:11:10 +03:00
Konstantin Belousov
4fced8642f sigfastblock_setpend() and fastblock_mask can be static now
Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D35888
2022-08-02 21:11:10 +03:00
Konstantin Belousov
c6d31b8306 AST: rework
Make most AST handlers dynamically registered.  This allows to have
subsystem-specific handler source located in the subsystem files,
instead of making subr_trap.c aware of it.  For instance, signal
delivery code on return to userspace is now moved to kern_sig.c.

Also, it allows to have some handlers designated as the cleanup (kclear)
type, which are called both at AST and on thread/process exit.  For
instance, ast(), exit1(), and NFS server no longer need to be aware
about UFS softdep processing.

The dynamic registration also allows third-party modules to register AST
handlers if needed.  There is one caveat with loadable modules: the
code does not make any effort to ensure that the module is not unloaded
before all threads processed through AST handler in it.  In fact, this
is already present behavior for hwpmc.ko and ufs.ko.  I do not think it
is worth the efforts and the runtime overhead to try to fix it.

Reviewed by:	markj
Tested by:	emaste (arm64), pho
Discussed with:	jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D35888
2022-08-02 21:11:09 +03:00
Alexander V. Chernikov
be1f485d7d sockets: add MSG_TRUNC flag handling for recvfrom()/recvmsg().
Implement Linux-variant of MSG_TRUNC input flag used in recv(), recvfrom() and recvmsg().
Posix defines MSG_TRUNC as an output flag, indicating packet/datagram truncation.
Linux extended it a while (~15+ years) ago to act as input flag,
resulting in returning the full packet size regarless of the input
buffer size.
It's a (relatively) popular pattern to do recvmsg( MSG_PEEK | MSG_TRUNC) to get the
packet size, allocate the buffer and issue another call to fetch the packet.
In particular, it's popular in userland netlink code, which is the primary driving factor of this change.

This commit implements the MSG_TRUNC support for SOCK_DGRAM sockets (udp, unix and all soreceive_generic() users).

PR:		kern/176322
Reviewed by:	pauamma(doc)
Differential Revision: https://reviews.freebsd.org/D35909
MFC after:	1 month
2022-07-30 18:21:51 +00:00
John Baldwin
ea8f128c7c pmap_mapdev: Consistently use vm_paddr_t for the first argument.
The devmap variants used vm_offset_t for some reason, and a few places
explicitly cast bus addresses to vm_offset_t.  (Probably those casts
along with similar casts for vm_size_t should just be removed and
instead permit the compiler to DTRT.)

Reviewed by:	markj
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D35961
2022-07-28 15:55:10 -07:00
Dimitry Andric
a387bd1b6a Adjust function definition in vfs_bio.c to avoid clang 15 warnings
With clang 15, the following -Werror warning is produced:

    sys/kern/vfs_bio.c:3430:11: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    buf_daemon()
              ^
               void

This is because buf_daemon() is declared with a (void) argument list,
but defined with an empty argument list. Make the definition match the
declaration.

MFC after:	3 days
2022-07-26 19:59:57 +02:00
Dimitry Andric
78cfed2de7 Adjust function definitions in sysv_msg.c to avoid clang 15 warnings
With clang 15, the following -Werror warnings are produced:

    sys/kern/sysv_msg.c:213:8: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    msginit()
           ^
            void
    sys/kern/sysv_msg.c:316:10: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    msgunload()
             ^
              void

This is because msginit() and msgunload() are declared with (void)
argument lists, but defined with empty argument lists. Make the
definitions match the declarations.

MFC after:	3 days
2022-07-26 19:59:57 +02:00
Dimitry Andric
b54e962aca Adjust function definition in subr_bus.c to avoid clang 15 warnings
With clang 15, the following -Werror warning is produced:

    sys/kern/subr_bus.c:871:16: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    bus_topo_assert()
                   ^
                    void

This is because bus_topo_assert() is declared with a (void) argument
list, but defined with an empty argument list. Make the definition match
the declaration.

MFC after:	3 days
2022-07-26 19:59:57 +02:00
Dimitry Andric
3c8f0790dd Adjust function definition in subr_autoconf.c to avoid clang 15 warnings
With clang 15, the following -Werror warning is produced:

    sys/kern/subr_autoconf.c:119:34: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    run_interrupt_driven_config_hooks()
                                     ^
                                      void

This is because run_interrupt_driven_config_hooks() is declared with a
(void) argument list, but defined with an empty argument list. Make the
definition match the declaration.

MFC after:	3 days
2022-07-26 19:59:57 +02:00
Dimitry Andric
f2eb09b089 Adjust function definitions in kern_resource.c to avoid clang 15 warnings
With clang 15, the following -Werror warnings are produced:

    sys/kern/kern_resource.c:1212:10: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    lim_alloc()
             ^
              void
    sys/kern/kern_resource.c:1365:11: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    uihashinit()
              ^
               void

This is because lim_alloc() and uihashinit() are declared with (void)
argument lists, but defined with empty argument lists. Make the
definitions match the declarations.

MFC after:	3 days
2022-07-26 19:59:57 +02:00
Dimitry Andric
db8ea61ae2 Adjust function definitions in kern_dtrace.c to avoid clang 15 warnings
With clang 15, the following -Werror warnings are produced:

    sys/kern/kern_dtrace.c:64:18: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    kdtrace_proc_size()
                     ^
                      void
    sys/kern/kern_dtrace.c:87:20: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    kdtrace_thread_size()
                       ^
                        void

This is because kdtrace_proc_size() and kdtrace_thread_size() are
declared with (void) argument lists, but defined with empty argument
lists. Make the definitions match the declarations.

MFC after:	3 days
2022-07-26 19:59:57 +02:00
Dimitry Andric
9806e82a23 Adjust function definitions in kern_cons.c to avoid clang 15 warnings
With clang 15, the following -Werror warnings are produced:

    sys/kern/kern_cons.c:201:14: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    cninit_finish()
                 ^
                  void
    sys/kern/kern_cons.c:376:7: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    cngrab()
          ^
           void
    sys/kern/kern_cons.c:389:9: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    cnungrab()
            ^
             void
    sys/kern/kern_cons.c:402:9: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    cnresume()
            ^
             void

This is because cninit_finish(), cngrab(), cnungrab(), and cnresume()
are declared with (void) argument lists, but defined with empty argument
lists. Make the definitions match the declarations.

MFC after:	3 days
2022-07-26 19:59:56 +02:00