opnsense-src/sys
Mark Johnston 686aa9287c swap_pager: Handle large swap_pager_reserve() requests
This interface is used solely by md(4) when the MD_RESERVE flag is
specified, as in `mdconfig -a -t swap -s 1G -o reserve`.  It
pre-allocates swap blocks for the entire object.

The number of blocks to be reserved is specified as a vm_size_t, but
swp_pager_getswapspace() can allocate at most INT_MAX blocks.  vm_size_t
also seems like the incorrect type to use here it refers only to the
size of the VM object, not the size of a mapping.  So:
- change the type of "size" in swap_pager_reserve() to vm_pindex_t, and
- clamp the requested number of blocks for a single
  swp_pager_getswapspace() call to INT_MAX.

Reported by:	syzkaller
Reviewed by:	dougm, alc, kib
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D31875
2021-09-07 14:04:50 -04:00
..
amd64 vmd(4): Major driver refactoring 2021-09-02 20:58:02 -04:00
arm Revert "arm: Bump KSTACK_PAGES default to match i386/amd64" 2021-09-01 13:13:27 -07:00
arm64 qoriq_dw_pci: Fix typo in link status checking code 2021-08-31 06:22:33 +02:00
bsm Add fspacectl(2), vn_deallocate(9) and VOP_DEALLOCATE(9). 2021-08-05 23:20:42 +08:00
cam ses: Guard the elm_type_names declaration by _KERNEL 2021-09-02 14:47:18 -06:00
cddl Create sys/reg.h for the common code previously in machine/reg.h 2021-08-30 12:50:53 +01:00
compat syscalls.master: switch to CAPENABLED flags 2021-09-01 21:58:16 +01:00
conf vmd(4): Major driver refactoring 2021-09-02 20:58:02 -04:00
contrib zfs: merge openzfs/zfs@3b89d9518 (master) into main 2021-08-31 09:02:21 +02:00
crypto crypto(4): Fix a few typos in camellia.c 2021-09-04 13:02:11 +02:00
ddb Create sys/reg.h for the common code previously in machine/reg.h 2021-08-30 12:50:53 +01:00
dev efirt: Mark buffers filled out by EFI firmware as initialized 2021-09-07 11:19:29 -04:00
dts Remove "All Rights Reserved" from FreeBSD Foundation sys/ copyrights 2021-08-08 10:42:24 -04:00
fs unionfs: style 2021-09-01 07:55:37 -07:00
gdb
geom g_label: Handle small sector sizes when tasting 2021-09-07 11:19:29 -04:00
gnu
i386 vmd(4): Major driver refactoring 2021-09-02 20:58:02 -04:00
isa newbus: Move from bus_child_{pnpinfo,location}_src to bus_child_{pnpinfo,location} with sbuf 2021-06-22 20:52:06 -06:00
kern genoffset.sh: Use 10 X's instead of 5 for pick mkdtemp implementations 2021-09-07 10:08:51 -06:00
kgssapi
libkern libkern: remove bcopy 2021-08-24 11:24:07 +00:00
mips Fix a common typo in source code comments 2021-09-04 12:56:57 +02:00
modules vmd(4): Major driver refactoring 2021-09-02 20:58:02 -04:00
net pf: remove unused function prototype 2021-09-07 16:38:49 +02:00
net80211 net80211: add func/line information to IEEE80211_DISCARD* macros 2021-09-04 09:24:51 +00:00
netgraph routing: Allow using IPv6 next-hops for IPv4 routes (RFC 5549). 2021-08-22 22:56:08 +00:00
netinet sctp: Fix iterator synchronization in sctp_sendall() 2021-09-07 11:19:29 -04:00
netinet6 ip6mrouter: Make the expiration callout MPSAFE 2021-09-07 11:19:29 -04:00
netipsec ipsec: fix race condition in key.c 2021-08-13 12:52:38 +02:00
netpfil pf: ensure states passed to pf_free_state() are always unlinked 2021-09-03 09:36:19 +02:00
netsmb netsmb: Avoid a read-after-free in smb_t2_request_int() 2021-05-26 10:45:40 -04:00
nfs
nfsclient
nfsserver
nlm
ofed routing: Allow using IPv6 next-hops for IPv4 routes (RFC 5549). 2021-08-22 22:56:08 +00:00
opencrypto ktls: Support asynchronous dispatch of AEAD ciphers. 2021-08-30 13:11:52 -07:00
powerpc powerpc: Fix typo in thread register copy 2021-09-04 11:44:02 -05:00
riscv sifive_spi: Add missing case for SPIBUS_MODE_NONE 2021-08-30 23:38:02 +01:00
rpc Fix a common typo in source code comments 2021-09-04 12:56:57 +02:00
security Add fspacectl(2), vn_deallocate(9) and VOP_DEALLOCATE(9). 2021-08-05 23:20:42 +08:00
sys cdefs.h: Remove redundant #ifdefs 2021-09-07 09:51:48 -06:00
teken
tests routing: add IPv6 fib validation procedure. 2021-08-16 23:04:01 +00:00
tools makesyscalls.lua: add a CAPENABLED flag 2021-09-01 21:58:06 +01:00
ufs ffs: remove unused thread argument from ffs_reload() 2021-09-04 12:25:10 -08:00
vm swap_pager: Handle large swap_pager_reserve() requests 2021-09-07 14:04:50 -04:00
x86 Create sys/reg.h for the common code previously in machine/reg.h 2021-08-30 12:50:53 +01:00
xdr
xen xen: introduce xen_pv_disks_disabled() 2021-07-28 17:27:04 +02:00
Makefile