Sie sind auf Seite 1von 1
‘Computer Selence trom the Botom Up Prev (Chaser The Operating System Privileges Hardware ‘We montoned now ene ofthe major tasks ofthe parsing system's to implement secuny- thet tent allow ‘one application or user to interfere wih any ter tals untng nthe system. Tris means aplication should ote abe to overwieeach ers memory or les, and ony access system resources os sted y Stem potcy However when an apptication sunning thas eclswo uso oft processor Wo se Now his works when wo xan procosses ne ne chapor. Ensuring the applcaton ony acosses memory OMS implemonied by tho tual memery systom, which we examine inthe chap’ aor nox. Tho essontal pints ‘hat to hardware f response fr enforcing thaso res. “The sytem callntorface we have exained the gateway othe application gong fo system resources. By foreng the appicaton to request rescrces tough asjsom canto the Keto, the kel can enforce tes “boul wht sort of access canbe provided. For example, when sn appcston makes an see system cal fo ‘Span eon ds leak he permissions of he user aga! he fie permssions and alow or geny Privilege Levels, Hardware protocton can usualy be seen asa set of concen rings around a cores of operations. Figure 43. Rings Pratege eves on 386 In to inner most ing ao the most protected structions hose ma ont th krne shows bo atowed to cal For example the 2 nstuctn to hall tho rocossor shuld netbeallowod to be run by a usr application, ‘shee woud stop the ane computor fem werk. Howove, tho Kenai nods obo abit call es instucten when he computers leitately shut down) Ect inning can access any instructions eoteced by fuer ou ring, bu ot any otc by a fuer fing. Nota actrees hve multiple levels of ngs as stove, but most wether prove ort ast 3 “Kemet” and see avs 386 protection model “he 386 potacton modo has fou ings, hough most operaing systoms (suchas Linc and Windows) ony use two oth ings fo maintain compatbiy wih oor rchtetutes thal do now alow as mary cele protection ils 308 maintains plepes by making each pee of appication code running inthe system have a smal ‘scipter called a cde deserter, whch desis, amongst ofber tangs, ts prvege vel When ing “splicaon cage makes a janp no some he cod utegehe region deserbed by toe desenton 2 Drogo lve ofthe lxget is Cnecked I haher than the cureny tuning Cod, the jo is dsioned by ‘enaraware and ie aplication wi crash) Raising Privilege ‘Agpcatons may ony ras tee prvlene lovely spoctc calls Ma lbw such ato istucbon to impemont a system cal Those are usualy eforod to a aca gato bocause hy uncon jst a a pyial ‘gale, a sna onty tough an otis mponebabo wa When thal struct scaled we have $008 how ‘ha hardware comploely slept running aplication and hands conto overt the kere Tho karl ust ‘alas a gasheeper ensuing that noting nasty s coming tough fie gale. Ths means f must check stom ‘alergement cael fo maks sure tw not be folad so doing anything shou (ean ba, Hat = ‘secuny bug).As he kerel rns inthe innermost ang, thas permssions todo any operation f wants when & Is fished it i tum cont back othe acaton which wil again be running wit lmer Eres vel Fast system Cals (One problem with taps as described above is that they are vary expensive forthe processor implement “Tere lao stata tobe saved before context can swch Modem processors have estead ts overaad and sms to reduce “ounderstend te cal.gate mechanism desemad stove requires investigation ofthe genious bt complicated segrentabon scheme used bythe processor The orgineleeson fx segmentabon was to beable Touse more han te 16 Ds avalable na register for an adress as Husted in Eure Figure 44, x86 Segmentation Aaressing ‘Segnentton eparcing ears: space oa processor yang tint hunts. The proceso Keeps spect segment teen soar a pees ee ee elon Te aul ese eae = Wien x8 moved t 2 bitters, the segmentation scheme remained but in a derent erst Rater than {od segment 5255 segments are alowed to be any sao. Ths maans the processor noods to ep Wack of at ‘hese dierent sogments and te sizes, which it does using descrptrs. The segment descriptors evslabie fo ‘everyore ate kein te bs! desea Tad or GDT for short Each process nase numberof estes ‘wich onto eros m the GT, thse aro the segments the process can accoss (Moro af also Oca. scipter tables, and all nora wth task stato segments, bul has aot mportant now). The overall ‘Staton ssa in Pinus 5 Flgure 45. x86 segments iis 286 sens n acon tre row eT cpeeses vlna catgate hen rare oa sognent of ge rnnng a aioe give Th enya to modiy We cage saree script wsat a ogesaseaes va ‘meen truss eshanan ensure hao chaos aw segment desea ene pest ara atc ee yu rusitanston a ae ey pon Since the cperatng system aston tho sogment rogers as pat of to procoss sat, tho processor hardware ‘ows whal sogments fama the cartel unnng process can accass and can enforce protect ‘ensure the process doost touch anything ts net suppose © If does go ou of bounds youreceve ‘Segmented fu, wien most rogrammers ar fair wit “The peture becmas more intresing when runing codo needs © make cals to code at resis in another “segment As discussed nthe Secon call i vetectan md xB doas ths wth ngs, where gO the Fnghest permission, rng 3 the owest,andinner ngs can access outer ngs bul not vice-versa ‘As discussed in te Seton cll ing Pavia, when ing 3 code wants o ump inf ng D code, kis ‘essen modtyig is cde segment select to pont to 8 dteent segment To do Mis, mus se speci fact instucton wach Narva ensures passes trough th cal gato. There m0 Der way to unnng process to choose a now codo-sagmont cesrpto, and nance tho processor wl tart exacung code at ho row ofsot win th ang 0 segment. which is esponsbie fer maintarungntgnty (@ 9. ol eadng abtary ‘and possibly malcus cose and executing Of cousa nafarous attackers wil alway lok or ways to ake ‘your code do hat you dd na intend). “Tis allows a whe herarchy of segments an pomisions bette her. You might have noticed a cross ‘segment ell sounds exacty Skea systom cal I youve ever looked at Linux x8 assanely to standard way {omake a system cals one ass, whch res infamupt sao AA inlerupt stops fhe processor and goes oan intetust gae, whch then works te same a cal gale changes prviege vel and bounces you of 0 ‘some ae ea of coe “Te problem wit Wis schemes hat ts stow kes fot feo to doa ns checking, and many estes ood be saved to get no to new code. And onthe way back out al noose restored aga (ona modern x05 systom sogmsnton and to fou-ove ing systom nol used thanks fo vt memory, ‘discussed ayn Chap 6. Te ony eg Mat realy happens wih sgmentation swhing is system cals whch essonalyswich fot med 3 (userspaco) te meds 0 and jump tothe system call ander code sido ‘tha kernal. Thus tho procassor prvidos ex fas ystam calinstuchons ald ayescez and sexs got ck) wich spead up the ce process over ace os cally temowng te general aie ofa eral — ‘ats be poss of tanstioning nfo ay segment a any rng evel — apd esting the cl 10 oy ‘ranston rng 0 codes a specie segment and ofa, a sored in regiters ‘Because ne gana nate hasbeen replaced wih se much por known oman the whole process can be speed up and hence we havea the aorermentoned st systom ca Tho other thing to notes tha stale > notoreserved when he Kernel els Cono The kere has 0 be cee ono dest sae, Dut also moans ts Te to ony savo as tesa as renutod 10 Jo hed, so canbe much more eficent aout “sts avery RISC palosopy, and akties Now The ine Dues wetapan RISC and CISC processors For more infomation on how Bs siplomertodin the Linux kore, so to Secton called Kernel Library (Chapt Other ways of communicating with the kernel foot out ioats File Systems aout 0, SS debuts te Notes: a Vina nappens when anaugny” eplcatincals at istcton ayy? The heroware wil suas) ‘ase an exception which wil nie jmpng to specfed hander ne opetng system st © ‘he system call hander Te parsing sytem hen bab tmnt hepegam sua kg the user some eter about hw the appkaton has crashed 2 comments +e L| ‘eaten - imi owe 2h Cumetited 6 stecthea ie ie Syam Cats oe Te

Das könnte Ihnen auch gefallen