Don't allow to create GELI providers with a sector size, which is no a
power of 2. Noticed by: rwatson MFC after: 3 days
This commit is contained in:
parent
b298769db3
commit
41f48b56d0
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=260254
@ -789,7 +789,7 @@ eli_init(struct gctl_req *req)
|
||||
if (val == 0)
|
||||
md.md_sectorsize = secsize;
|
||||
else {
|
||||
if (val < 0 || (val % secsize) != 0) {
|
||||
if (val < 0 || (val % secsize) != 0 || !powerof2(val)) {
|
||||
gctl_error(req, "Invalid sector size.");
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user