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++) { |