tsk->thread.io_bitmap = NULL; /* *Don'ttouchtheTSSwheninvokedonafailedfork().TSS *reflectsthestateof@currentandnotthestateof@tsk.
*/ if (tsk == current)
task_update_io_bitmap(); if (iobm && refcount_dec_and_test(&iobm->refcnt))
kfree(iobm);
}
/* *Thischangestheiopermissionsbitmapinthecurrenttask.
*/ long ksys_ioperm(unsignedlong from, unsignedlong num, int turn_on)
{ struct thread_struct *t = ¤t->thread; unsignedint i, max_long; struct io_bitmap *iobm;
if ((from + num <= from) || (from + num > IO_BITMAP_BITS)) return -EINVAL; if (turn_on && (!capable(CAP_SYS_RAWIO) ||
security_locked_down(LOCKDOWN_IOPORT))) return -EPERM;
/* *Ifit'sthefirstioperm()callinthisthread'slifetime,setthe *IObitmapup.ioperm()ismuchlesstimingcriticalthanclone(), *thisiswhywedelaythisoperationuntilnow:
*/
iobm = t->io_bitmap; if (!iobm) { /* No point to allocate a bitmap just to clear permissions */ if (!turn_on) return0;
iobm = kmalloc(sizeof(*iobm), GFP_KERNEL); if (!iobm) return -ENOMEM;
/* *Storethebitmappointer(mightbethesameifthetaskalready *headone).Mustbedoneheresofreeingthebitmapwhenall *permissionsaredroppedhasthepointersetup.
*/
t->io_bitmap = iobm; /* Mark it active for context switching and exit to user mode */
set_thread_flag(TIF_IO_BITMAP);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.