Use an unsigned iterator for domain sets.

Otherwise (iter % ds->ds_cnt) is not guaranteed to lie in the range
[0, MAXMEMDOM).

Reported by:	pho
Reviewed by:	kib
Approved by:	re (rgrimes)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D17374
This commit is contained in:
Mark Johnston 2018-10-01 18:51:39 +00:00
parent 8696dcdacf
commit 93db904d19
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=339075
2 changed files with 2 additions and 2 deletions

View File

@ -54,7 +54,7 @@ typedef struct _domainset domainset_t;
struct domainset;
struct domainset_ref {
struct domainset * volatile dr_policy;
int dr_iterator;
unsigned int dr_iterator;
};
#endif /* !_SYS__DOMAINSET_H_ */

View File

@ -32,7 +32,7 @@
struct vm_domainset_iter {
struct domainset *di_domain;
int *di_iter;
unsigned int *di_iter;
vm_pindex_t di_offset;
int di_flags;
uint16_t di_policy;