} else {
bzero(&new_ldt->ldt[start_sel - begin_sel], num_sels * sizeof(struct real_descriptor));
}
-
/*
* Validate descriptors.
* Only allow descriptors with user privileges.
user_ldt_free(new_ldt);
return EACCES;
}
+ /* Reject attempts to create segments with 64-bit granules */
+ if (dp->granularity & SZ_64) {
+ task_unlock(task);
+ user_ldt_free(new_ldt);
+ return EACCES;
+ }
}
}
unsigned int ldt_count;
kern_return_t err;
- if (start_sel >= 8192)
+ if (start_sel >= LDTSZ)
return EINVAL;
- if ((uint64_t)start_sel + (uint64_t)num_sels > 8192)
+ if ((uint64_t)start_sel + (uint64_t)num_sels > LDTSZ)
return EINVAL;
if (descs == 0)
return EINVAL;