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
3348884113
commit
687fee2804
@ -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