View | Details | Raw Unified | Return to bug 209661
Collapse All | Expand All

(-)b/sys/amd64/amd64/sys_machdep.c (-1 / +2 lines)
Lines 344-350 amd64_set_ioperm(td, uap) Link Here
344
		return (error);
344
		return (error);
345
	if ((error = securelevel_gt(td->td_ucred, 0)) != 0)
345
	if ((error = securelevel_gt(td->td_ucred, 0)) != 0)
346
		return (error);
346
		return (error);
347
	if (uap->start + uap->length > IOPAGES * PAGE_SIZE * NBBY)
347
	if (uap->start > uap->start + uap->length ||
348
	    uap->start + uap->length > IOPAGES * PAGE_SIZE * NBBY)
348
		return (EINVAL);
349
		return (EINVAL);
349
350
350
	/*
351
	/*
(-)b/sys/i386/i386/sys_machdep.c (-2 / +4 lines)
Lines 315-322 i386_set_ioperm(td, uap) Link Here
315
	struct thread *td;
315
	struct thread *td;
316
	struct i386_ioperm_args *uap;
316
	struct i386_ioperm_args *uap;
317
{
317
{
318
	int i, error;
319
	char *iomap;
318
	char *iomap;
319
	u_int i;
320
	int error;
320
321
321
	if ((error = priv_check(td, PRIV_IO)) != 0)
322
	if ((error = priv_check(td, PRIV_IO)) != 0)
322
		return (error);
323
		return (error);
Lines 334-340 i386_set_ioperm(td, uap) Link Here
334
			return (error);
335
			return (error);
335
	iomap = (char *)td->td_pcb->pcb_ext->ext_iomap;
336
	iomap = (char *)td->td_pcb->pcb_ext->ext_iomap;
336
337
337
	if (uap->start + uap->length > IOPAGES * PAGE_SIZE * NBBY)
338
	if (uap->start > uap->start + uap->length ||
339
	    uap->start + uap->length > IOPAGES * PAGE_SIZE * NBBY)
338
		return (EINVAL);
340
		return (EINVAL);
339
341
340
	for (i = uap->start; i < uap->start + uap->length; i++) {
342
	for (i = uap->start; i < uap->start + uap->length; i++) {

Return to bug 209661