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:
pjd 2014-01-04 09:27:49 +00:00
parent 3348884113
commit 687fee2804

View File

@ -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;
}