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
..
2020-11-19 03:59:21 +00:00
2021-08-10 21:27:54 -04:00
2021-05-02 19:45:23 -04:00
2020-10-14 22:51:40 +00:00
2021-08-05 22:52:26 +08:00
2021-05-07 17:08:03 +03:00
2021-08-10 21:27:54 -04:00
2020-08-17 13:02:01 +00:00
2021-05-07 17:08:03 +03:00
2021-05-15 20:47:29 +00:00
2021-06-17 16:58:44 +03:00
2020-11-19 03:59:21 +00:00
2020-11-19 03:59:21 +00:00
2021-05-13 20:13:34 +03:00