8/10/2019 Cohen Protectio Hydra
1/20
PROTEC TION IN THE HYDRA OPERATING SYSTEM
El l i s Cohen and Dav id Je f fe rson 1
C a r n e g i e - l v l e ll o n U n i v e r s i t y
P i t t sbu rg h , Pa .
A b s t r a c t
T h i s p a p e r d e s c r i b e s t h e c a p a b i l i t y b a s e d p r o t e c t i o n
m e c h a n i s m s p r o v i d e d b y t h e H y d r a O p e r a t i n g S y s t e m K e r n e l .
T h e s e m e c h an is m s s u p p o r t t h e c o n s t r u c ti o n o f u s e r - d e f i n e d
p r o t e c t e d s u b s y s t e m s , i n c l u d i n g fi l e a nd d i re c t o r y s u b s y s t e m s ,
w h i c h d o n o t t h e r e f o r e n e e d to b e s u p p l ie d d i r e c t l y b y H y d r a.
I n a d d i t i o n , w e d i s c u s s a n u m b e r o f w e l l k n o w n p r o t e c t i o n
p rob lems, inc lud ing Mu tua l Susp ic ion , Con f inemen t and
R e v o c a t i o n , a n d w e p r e s e n t t h e m e c h a n i s m s t h a t H y d r a
s u p p l i e s i n o r d e r t o s o l v e t h e m .
K e y w o r d s a n d p h r a s e s : o p e r a t i n g s y st em , p r o t e c t io n ,
c a p a b i l i t y , t y p e , p r o t e c t e d s u b s y s t e m , p r o t e c t i o n p r o b l e m ,
m u t u a l s u s p i c i o n , c o n f i n e m e n t , r e v o c a t io n .
1. Introduct ion
H y d r a w a s d e s i g n e d w i t h t h e p h i l o s o p h y t h a t p r o t e c t i o n
m u s t b e a n i n t e g r a l p a r t o f a n y g e n e r a l p u r p o s e o p e r a t in g
s y s t e m . A s e t o f p r o t e c t i o n m e c h a ni sm s sh o u l d b e p a r t o f t h e
l o w e s t l e v e l o f a n o p e r a t i n g s y s t e m , a n d t h o s e m e c h a n i s m s
m u s t b e f l e x i b l e e n o u g h t o s u p p o r t t h e w i d e ra n g e o f s e c u r i t y
p o l i c i e s n e e d e d b y b o t h h i g h l e v e l s u bs y st em s a n d u s e r
p r o g r a m s . I n th i s p a p e r w e w i l l d e s c r i b e t h e c a p a b i l i t y b a se d
m e c h a n i s m i n t h e H y d r a k e r n e l , i ts u s e i n c o n s t r u c t i n g
p r o t e c t e d s u b s y s t e m s a n d i n s o l v i n g a n u m b er o f w e l l k n o w n
p r o t e c t i o n p r o b l e m s . W e e x p e c t t h a t t h e r e a d e r is a l r e a d y
f a m i l i a r w i t h t h e c o n t e n t s o f t h e c o m p a n i o n p a p e r [ W L P 7 5 ]
w h i c h d i s c u s s e s i n g r e a t e r d e t a i l o u r p h i l o s o p h y o f w h a t a
p r o t e c t i o n s y s t e m s h o u l d be .
W h e n u s e r s s h a r e a c c e s s t o i n f o r m a t i o n , t h e r e i s
i n e v i t a b l y a p o s s i b i l i t y f o r m a l ic io u s o r a c c id e n ta l d i s c l o s u r e o f
t h a t i n f o r m a t i o n . I t is n e c e s s a r y t o r e s t r ic t t h e b e h a v i o r o f
p o s s i b l e c o m p u t a t i o n s i n o r d e r t o g u a r a n t e e t h a t s u c h m i s h a p s
d o n o t o c c u r . I n a g e n e r a l s e n s e [ C o h 7 5 ] , a p r o t e c t ~ n p r o b l l e ~ =
i s s i m p l y a d e s c r i p t i o n o f s o m e c l a s s o f r e s t r i c t e d b e h a v i o r s .
A p r o t e c t i o n p r o b l e m c a n b e s o l v e d i n a p r o t e c t i o n s y s t e m i f
t h e s y s t e m p r o v i d e s s o m e s e t o f m e c h a n i s m s w h i c h , w h e n
i n v o k e d , g u a r a n t e e t h a t t h e b e h a v i o r o f t h e s y s t e m w i l l b e
a p p r o p r i a t e l y r e s t r i c t e d .
I. T h i s w o r k w a s s u p p o r t e d b y t h e D e f e n s e A d v a n c e d
R e s e a r c h P r o j e c t s A g e n c y u n d e r C o n t r a c t F 4 4 6 2 0 - 7 3 - C - 0 0 7 4
a n d i s m o n i t o r e d b y t h e A i r F o r c e O f f i c e o f S c i e n t i fi c R e se a rc h .
I n t h i s p a p e r , w e w i l l p r i m a r i l y b e d i s c u s s i n g a c ce s s
p ro t : e c t ~o t t -
t he p e rm iss ion o r den ia l o f access to in fo rma t ion .
I n a c o m p a n i o n p a p e r [ L e v 7 5 ] , w e d i sc u ss t h e r e l a t e d i s s u e o f
co n t ro l p ro t : e c t ~o rL
w h i c h i n v o l v e s g u a r a n t e e i n g o r p r e v e n t i n g
e x e c u t i o n o f p r o g r a m s a t s c h e d u le d ti m es f o r s p e c i f i c d u r a t i o n s
us in g spec i f i c res ou rce s . P rob lems o f access p ro tec t ion can be
v i e w e d a l o n g t w o o r t h o g o n a l d i m e n s i o n s :
1 ) P r ~ r u s . F u t u r e D a c /a ~ n J: B y a p r i o r
dec is ion , we mean dec id ing in advance the
c i r c u m s t a n c e s u n d e r w h i c h a c c e s s t o c e r t a i n
in fo rm a t ion w i l l be pe rm i t t ed o r den ied. By a
f u t u r e d e c i s i o n , w e m e a n d e c i d in g a t
a r b i t r a r y t i m e s t o r e v o k e o r r e s t o r e a c c e s s
pe rm iss ions , t ha t i s , t o change the
c i rcumstances o f access a t some t ime in t he
f u t u r e .
2 ) U ~ l o z e r o J u s . N e g ot l~ a te d D s c i a ~ n J : B y a
u n i l a t e r a l d e c i s i o n w e r e f e r t o a s i n g l e u s e r
d e c i d i n g h o w o t h e r u s e r s a r e t o b e a b l e t o
access in fo rm a t ion Under h is aeg is. By a
n e g o t i a t e d d e c i s i o n w e r e f e r t o a u s e r
w a n t i n g t o t e m p e r o r l i m i t t h e r e s t r i c t i o n s t o
access imposed by ano the r use r .
W e c a n g i v e e x a m p l e s t o i l l u s t r a t e e a c h o f t h e s e
c a t e g o r i e s . I n p a r e n t h e s e s f o l l o w i n g e ac h e x a m p l e a r e a l i s t o f
p r o b l e m s d i s c u s s e d I n s e c t i o n 3 t h a t f a l l i n t o t h e s a m e
c a t e g o r y .
P r i o r a n d U n i l a t e r a l - T h e c r e a t o r o f a fi l e
w i s h e s o t h e r u s e r s t o b e p e r m i t t e d t o r e a d , b u t
no t w r i t e , t he f i l e . (Mu tua l Susp ic ion,
M o d i f i c a t i o n , L i m i t i n g P r o p a g a t i o n o f
Capab i l i t i es , Conse rva t ion , Con f inemen t ,
I n i t i a l i z a t i o n )
F u t u r e a n d U n i l a t e ra l - T h e c r e a t o r o f t h e f i l e
w i s h e s a t s o m e l a t e r p o i n t t o r e v o k e s o m e
use r ' s pe rm iss ion to read the fi l e . (Revoca t ion )
P r i o r a n d N e g o t i a t e d - A u s e r r e q u i r e s a
g u a r a n t e e i n a d v a n c e t h a t h i s p e r m i s s i o n t o
r e a d t h e f i l e w i l l n e v e r b e re v o k e d . ( F r e e z i n g )
F u t u r e a n d N e g o t i a t e d - A u s e r r e q u i r e s a
g u a r a n t e e t h a t , i f t h e c r e a t o r e v e r a t t e m p t s t o
revoke access , t he ma t te r w i l t be submi t ted to
( s o m e t r u s t e d p r o c e d u r e w h i c h i m p le m e n ts )
b i n d i n g a r b i t r a t i o n . ( A c c o u n t i n g a n d L o s t
O b j e c t P r o b l e m s )
1 4 1
8/10/2019 Cohen Protectio Hydra
2/20
I n s e c t i o n 2 o f t h i s p a p e r , w e w i l l d e s c r i b e t h e
b a s i c p r o t e c t i o n m e c h a n i s m s s u p p l i e d b y H y d ra , t h e i r u s e in
c o n s t r u c t e d p r o t e c t e d s u b s y s t e m s . W e w i l l al so s e e h o w t h e
m e c h a n i s m s d i r e c t l y s o l v e c e r t a i n s t r a i g h t f o r w a r d p r o b l e m s
a n d c a n b e c o m b i n e d , t h r o u g h procec~.croJ anzbedd~nif t o s o l v e
a n y o f t h e p r o b l e m s d e s c r i b e d a b o v e .
[ n s e c t i o n 3 , w e w i l l l o o k a t a n u m b e r o f w e l l
k n o w n p r o b l e m s a n d p r e s e n t a d d i t i o n a l H y d ra m e c h a n is m s t h a t
c a n b e u s e d t o s o l v e t h e m d i r e c t l y .
2 . P r o t e c t io n Me chan isms
2 .1 [ n t r o d u c t io n
C l e a r l y , t h e r e a r e a h u g e n u m b er o f p r o t e c t i o n
p r o b l e m s . H y d r a c a n n o t e v e n b e g i n t o p r o v id e p o l ic i e s t h a t
s o l v e e a c h o n e d i r e c t l y . B u t t h a t is n o t H y d r a 's p u rp o s e . I n
[ L e v 7 5 ] , w e d i s c u s s i n so m e d e t a il a c e n t r a l p h i l o s o p h y o f
H y d r a , t h a t o f P o l i c y / M e c h a n i s m s e p a r a t io n . B r i e f l y , w e
b e l i e v e t h a t a n o p e r a t i n g s y s t e m s h o u l d n o t a t te m p t t o p r o v i d e
a f i x e d s e t o f p o l i c i e s , p a r t i c u l a r l y p r o t e c t i o n p o l i c i e s . R a t h e r ,
i t s h o u l d p r o v i d e a s e t o f m e c h a n i s m s w i t h w h i c h a l a r g e s e t o f
p o l i c i e s ( h o p e f u l l y i n c l u d i n g a l l u s e f u l a n d i n t e r e s t i n g o n e s ) c a n
b e c o n s t r u c t e d . F o r e x a m p l e , w e d o n o t w i r e i n t o H y d ra a
p o l i c y t h a t p e r m i t s t h e c r e a t o r o f a f i l e t o r e v o k e a c c e s s t o i t .
; n s t e a d , t h e r e i s a m e c ha n is m t h a t p e r m i t s r e v o c a t i o n a n d
a n o t h e r ( f r e e z i n g ) t h a t p r e v e n t s it . Y e t o t h e r m e ch a n is m s
( p r o c e d u r e s , a m p l i f i c a t i o n ) c a n b e u s e d t o b u i l d a r b i t r a r i l y
c o m p l e x p o l i c i e s t h a t d e t e r m i n e u n d e r w h a t c ir c u m s t a n ce s
r e v o c a t i o n i s t o b e p e r m i t t e d o r p r e v e n t e d .
T h e p a r t i c u l a r p r o t e c t i o n m e c h a n i s m s p r o v i d e d h a v e a
s u b s t a n t i a l i m p a c t o n t h e p r o t e c t i o n p o l i c i e s o b t a i n a b le . T h e
m e c h a n i s m s p r o v i d e d b y H y d r a a r e b a s e d o n f i v e p h i l o s o p h i c a l
p - i n c i p l e s . T h e s e p r i n c i p l e s a n d t h e m e c h a n is m s
t h e y
i n d u c e
a r e :
1)
I n fo rm a t ion ca._ .n be d iv ided in to d is t inc t
ob je c ts fo_zE pu rpo ses o . f. p ro tec t ion . We
r e a l l y w a n t a p r o t e c t i o n s y s t e m t o c o n t r o l
access to and p ropoga t ion o f in fo rma t ion .
U n f o r t u n a t e l y , w e d o n o t u n d e r s t a n d h o w t o
d o t h i s d i r e c t l y . I n s te a d , H y d r a fo r c e s u s e r s
t o g r o u p i n f o r m a t i o n t o g e t h e r i n t o a u n i f o r m
d a t a s t r u c t u r e c a l l e d a n ob jec t a n d p r o v i d e s
p r o t e c t i o n a t t h e l e v e l o f t h e o b j e c t a s a
w h o l e . 2 T h i s i s o f t e n q u i t e n a t u r a l , as w h e n a
u s e r w i s h e s t o r e s t r i c t a c c e s s t o a n e n t i r e
f i l e . ] n o the r cases , t he d is t inc t ion makes an
enorm ous d i f f e ren ce . Fo r examp le , i t i s one
th ing to revoke access to a f i l e ; i t i s qu i t e
ano the r t o revoke access to a l l i n fo rma t ion in
t h e s y s t e m d e r i v e d f r o m o r d e p e n d e n t u p o n
t h e d a t a c o n t a i n e d i n t h a t f i l e .
2 )
3 )
4 )
Ob jects ar__e d is t inR us hed .b .Y_ t . ype . E a c h
ob jec t i s o f a pa r t i cu la r t ype , wh ich rema ins
c o n s t a n t f o r t h e l i f e t i m e o f t h e o b j e c t .
C e r t a i n t y p e s o f o b j e c t s ( e . g . P r o c e d u r e ,
Process , Semaphore ) and the ope ra t ions
r e l e v a n t t o e a c h ( e .g . C A L L , S T A R T , P ) a r e
d i r e c t l y p r o v i d e d by Hydra. Hyd ra a lso
p r o v i d e s m e c h a n i s m s f o r c r e a t i n g n e w t y p e s
o f o b j e c t s a n d d e f in i n g t h e o p e r a ti o n s w h i c h
ma n ipu la te them. A t t he sam e t ime , because
a l l o b j e c t s h a v e t h e s a m e s t r u c t u r e ,
r e g a r d l e s s o f t y p e ( t h e t y p e i s u s e d i n
i n t e r p r e t i n g t h e c o n t e n t s o f t h e o b j e c t ) , t h e
k e r n e l p r o v i d e s a s e t o f g e n e r i c o p e r a t i o n s
( f o r e x a m p l e , r e a d i n g o r w r i t i n g t h e o b j e c t )
w h i c h a r e t y p e i n d e p e n d e n t .
Acces s t .. .o ob jec ts i s co n t ro l led
c~po.bUi~es.
Capab i l i t i es may be passed f rom
o n e u s e r t o a n o t h e r a n d m a y b e r e t a i n e d b y
a u s e r b e t w e e n t e r m i n a l s e ss io n s. E a c h
capab i l i t y con ta ins a la rge (compared to
o t h e r s y s t e m s ) n u m b e r o f a c c e s s r i g h t s
w h i c h d e t e r m i n e h o w t h e o b j e c t n a m e d b y
t h e c a p a b i l i t y c a n b e a c ce s se d ; s o m e o f t h e s e
r i g h t s a r e t y p e i n d e p e n d e n t ( r e l a te d t o t h e
f a c t t h a t a l l o b je c t s h a v e t h e s a m e s t r u c t u r e )
w h i l e s o m e a r e t y p e s p e c if ic .
Possess ion o f a capab i l i t y i s t he so le
d e t e r m i n a n t o f a c c e s s , a l t h o u g h t h r o u g h t h e
use o f o the r mechan isms (p rocedu res ,
amp l i f i ca t ion ) , one can cons t ruc t po l i c ies tha t
t a k e i n t o a c c o u n t o t h e r c r i t e r i a ( e . g . w h o i s
the accesso r? ). Ob jec ts do no t have
" o w n e r s " a s s u c h . A l l h o l d e r s o f c a p a b i l i t i e s
f o r a n o b j e c t s h a r e c o n t r o l o f i t i n
p r o p o r t i o n t o t h e i r r i g h ts . ( O f c o u r s e , o n e
u s e r m i g h t r e t a i n a l l r i g h t s t o a n o b j e c t
h i m s e l f w i t h o u t g r a n t i n g a n y r i g h t s t o o t h e r s ,
b e c o m i n g t h e d e - f a c t o o w n e r . )
Each p roRram shou ld execu te w i th t h .~ .
sma l les t se t o f access r igh ts necessa ry . The
p ro tec t ion doma in i s t ha t se t o f capab i l i t i es
w h i c h m a y b e e x e r c i s e d b y a n e x e c u t in g
p r o c e d u r e . I t ch a ng e s w i t h e a ch p ro c e d u r e
cal l .
Proced~.Lres
( a t y p e o f o b j e c t ) i n H y d r a
have access to " own" ob jec ts (v ia
c a p a b i l i t i e s ) , i n a c c e s s i b l e t o u s e r s w i t h o n l y
t h e r i g h t t o e x e c u t e t h e p ro c e d u r e . E a c h
t ime a p rocedu re i s ca l led , i t execu tes in a
c o m p l e t e l y n e w e n v i r o n m e n t , d e t e r m i n e d
s o l e l y b y t h e p r o c e d u r e s " o w n s " a n d b y
capab i l i t i es passed as a rgumen ts by the
ca l le r . Th is Pe rm i t s a d i rec t so lu t ion to t he
Mutua l Susp ic ion p rob lem and (as we sha l l
s e e ) p e r m i t s t h e c o n s t r u c t i o n o f a r b i t r a r y
p r o t e c t i o n p o l i c i e s .
2 . O th e r sys tem s [D in73 ,Gr a72 ,Lau74 ] pe rm i t
d i f f e r e n t i a l p r o t e c t i o n o f s t r u c t u r e d s u b s e t s o f a n
o b j e c t . A c t u a l l y , i n H y d r a , o b j e c t s a r e d i v i d e d i n t o t w o
2 p a r t s , a C - l i s t a n d a D a t a - p a r t , a n d in so m e w a y s , e a c h
m a y b e p r o t e c t e d s e p a r a t e l y .
142
8/10/2019 Cohen Protectio Hydra
3/20
5 )
AJ_J. kn ow led ge ab ou t th..~, re pr es en tat ion an__d.
i m p l e m e n t a t i o n o ~ o p e r a t io n ~ f o r e a ch t y p e
o_f ob je c t shou ld be h idden i3 modu les Fa i led
u.bsystem$.
i n gene ra l , use rs o f an ob jec t o f
a pa r t i cu la r t ype canno t access i t d i rec t l y~
t h e y c a n o n l y d o s o t h r o u g h p r o c e d u r e s
a s s o c i a t e d w i t h t h e s u b s y s t e m f o r t h a t t y p e .
H y d r a s u p p o r t s t h i s t h r o u g h t h e m e c h a n i s m
o f
riLght$ anzp~..f ' i .coJ' i .on.
Under ce r ta in
c i rcums tances , w hen a capa b i l i t y is passed as
a n a r g u m e n t t o a p r o c e d u r e , i t w i l l h a v e
g r e a t e r r i g h t s ( i n p a r t i c u l a r , t h o s e n e c e s s a r y
to access th e con ten ts o f the ob jec t ) in t he
n e w d o m a i n c r e a t e d f o r t h a t p r o c e d u r e
i n v o c a t i o n t h a n i t h a d i n t h e d o m a i n o f t h e
ca l le r .
i n t h e r e m a i n d e r o f t h i s s e c ti o n , w e w i l l e x p l o r e t h e
m e c h a n i s m s t h a t s u p p o r t t h e s e p r i n c i p l e s i n g r e a t e r d e t a i l .
2.2 Ob jects, Capabi l it ies and LNS s
A n
o b j e c t
i s a d a ta s t r u c t u r e t h a t r e p r e s e n t s a n in s t a n c e
o f a r e s o u r c e , e i t h e r v i r t u a l o r p h y s i c a l . I t m ay b e t h o u g h t o f
a s a t h r e e - t u p l e :
< u n i q u e - n a m e , t y p e , r e p r e s e n t a t i o n
T h e
un.i.que-nxLnze
o f an ob jec t d is t ingu ishes i t f rom a l l
o t h e r o b j e c t s t h a t e v e r e x i s t e d i n t h e p a s t o r w i l l e x i s t i n t h e
f u t u r e . T h e
t y p e
o f t h e o b j e c t d e f i n e s t h e n a t u r e o f t h e
r e s o u r c e t h e o b j e c t r e p r e s e n t s . S o m e e x am p l e o f t y p e s m ig h t
b e DEVICE, DIRECTO RY, PROCEDURE, PROC ESS, SEMAPHORE,
F I L E , S E Q F ]L E a n d R A N D F i L E ( t h e la s t t h r e e r e p r e s e n t i n g
d i f f e r e n t k i n d s o f f i l e s ) .
A p r i m a r y p u r p o s e o f a p r o t e c t i o n s y s t e m i s t o c o n t r o l
access to ob jec ts . Th is i s accomp l ished in Hyd r a th rou gh the
use o f capo .b~ULes . Assoc ia ted w i th each execu t ing p rog ram is
a C - U s t a
l i n e a r l y n u m b e r e d l i s t o f c a p a b i l i t i e s . E a c h
c a p a b i l i t y c o n t a i n s b o t h t h e n a m e o f a p a r t i c u l a r o b j e c t a s w e l l
a s a s e t o f
ox;cess ri .ghts.
An access r igh t ( f o r examp le, i 'ead -
r i g h t s o r w r i t e - r i g h t s t o a f i l e ) u s u a l l y r e p r e s e n t s a n o p e r a t i o n
w h i c h t h e p o s s e s s o r o f a c a p a b i l i t y m a y l e g a l ly p e r fo r m o n th e
o b j e c t .
T h e r e p r e s e n t a t i o n s o f c a p a b i l i t i e s a n d r i g h t s a r e
m a n i p u l a t e d o n l y b y t h e H y d r a k e r n e l , i t i s i m p o s s ib l e t o
" f o r g e ' a c a p a b i l i t y o r g a i n a c c e s s t o a n o b j e c t w i t h o u t h a v i n g
a c a p a b i l i t y f o r i t.
I n many ca pab i l i t y based ope ra t ing systems, a capa b i l i t y
i s a n a t t r i b u t e o n l y o f e x e c u t o r s , i n su c h s y st em s , t h e C - li s t
a s s o c i a t e d w i t h a n e x e c u t i n g p r o g r a m d e f i n e s i t s p r o t e c t i o n
dom a in . W h i le t h is i s a lso t rue in Hyd ra , we have gene ra l i zed
t h e n o t i o n o f o b j e c t s a n d c a p a b i l i t i e s i n a n i m p o r t a n t d i r e c t i o n .
R e g a r d l e s s o f
t y p e , ~
o b j e c t s h a v e t h e s a m e s tr u c t u r e ; t h e
t y p e
o f a n o b j e c t s i m p l y p r o v i d e s a n i n t e r p r e t a t i o n f o r t h e
c o n t e n t s o f t h e o b j e c t . C a p a b i l it i e s a r e n o t a n a t t r i b u t e o f
e x e c u t i n g p r o g r a m s a l o n e ; ~ o b j e c t m a y c o n t a i n a C - l i s t.
T h i s g e n e r a l i z a t i o n h a s t w o i m p o r t a n t e f f e c t s .
1 )
E x e c u t i n g p r o g r a m s m a y b e r e p r e s e n t e d a s a
t y p e o f o b j e c t . T h i s t y p e i s a n
LN3,
s h o r t
f o r " Loca l Nam e Space".
2 )
N e w o b j e c t t y p e s ( n e w k i n d s o f r e s o u r c e s )
m a y b e d e f i n e d i n t e rm s o f e x i s t i n g o b j e c t
t ype s . Fo r exam p le , one m igh t imag ine a
F i l e - d i r e c to r y
wh ich con ta ins bo th a l i s t o f
f i l es and a semaphore wh ich p rov ides mu tua l
e x c l u s i o n o f o p e r a t i o n s o n t h e
f i l e -d i rec to ry .
i n t h e t e r m i n o l o g y o f H y d r a , t h e C - l i s t o f a n
o b j e c t o f t y p e F IL E - Di R EC T O R Y w o u l d
c o n t a i n c a p a b i l i t i e s f o r o b j e c t s o f t y p e F I L E ,
a s w e l l a s a c a p a b i l i t y f o r a n o b j e c t o f t y p e
SEMAPHORE
in add i t ion to a C - l i s t , an ob jec t con ta ins a
DoXa-po.rt, a
b l o c k o f s t o r a g e h o l d i n g r e l e v a n t i n f o rm a t i o n . T o g e t h e r , t h e
C - l i s t a n d t h e D a t a - p a r t c o n s t i t u t e t h e
r e p r e s e t z t = ~
o f t h e
ob je c t . Re tu rn in g to ou r F iLE-D iRECTORY examp le , t he Da ta -
p a r t o f a f i l e - d i r e c t o r y m i g h t b e u s e d t o h o l d t h e s t r in g n a m e s
o f t h e f i l e s i n t h e
f i l e -d i rec to ry .
T h e d e c i s i o n t o d i v i d e t h e r e p r e s e n t a t i o n o f a n o b j e c t
i n t o t w o p a r t s , D a t a - p a r t a n d C - l i s t, w a s m a d e p r i m a r i l y o n
p r a g m a t i c r a t h e r t h a n t h e o r e t i c a l g r o u n d s . A s F a b r y n o te s
[Fab74 ] , da ta and capab i l i t i es cou ld , in p r inc ip le , be comb ined
i n t o o n e s e g m e n t , i f t h e r e w e r e s o m e w a y t o a l l o w c o m p l e t e
f r e e d o m t o a l t e r t h e d a t a s w h i l e a t t h e s a m e t im e p r e v e n t i n g
a r b i t r a r y m a n i p u l a t i o n o f th e c a p a b i li ti e s . T h i s w o u l d b e
p o s s i b l e o n a p r o c e s s o r w i t h a t a g g e d a r c h i t e c t u r e , s u c h a s
t h e B u r r o u g h s 5 5 0 0 [ O r g 7 3 ] . H o w e v e r , w e w e r e li m i t e d t o t h e
a r c h i t e c t u r a l c o n f i n e s o f a P D P - I 1 .
T h e r e a r e o t h e r r e a s o n s f o r k e e p i n g t h e D a t a - p a r t a n d
C - l i s t s e p a r a t e a s w e l l . S i nc e a n y o b j e c t m ay p o t e n t i a l ly
c o n t a i n a c a p a b i l i t y f o r a n y o t h e r o b j e c t , o b j e c t s m a y f o r m
g e n e r a l d i r e c t e d g r a p h s t r u c t u r e s w h i c h r e q u i r e g a r b a g e
c o l l e c t i o n . G a t h e r i n g c a p a b i l i t ie s t o g e t h e r i n a s e p a r a t e C - l i s t
s i m p l i f i e s t h e g a r b a g e c o l l e c t i o n m e c h a n i s m .
2 .3 LNSe s and Pa ths
A n L N S d e f i n e s t h e i n s t a n t a n e o u s p r o t e c t i o n d o m a i n o f
a n e x e c u t i n g p r o g r a m ; i t s C - l i s t c o n t a in s c a p a b i li ti e s f o r a l l o f
t h e o b j e c t s t h a t m a y b e d i r e c t l y a c c e ss e d ( i n c lu d i n g
c a p a b i l i t i e s f o r P A G E o b j e c t s , w h i c h d e f i n e t h e L N S ' s a d d re s s
s p a c e ) . ~ o b j e c t s a c ce s se d m u s t b e r e f e r e n c e d th r o u g h t h e
L N S , b u t s i n c e t h e o b j e c t s r e f e r e n c e d b y c a p a b i l it i e s m a y
t h e m s e l v e s c o n t a i n c a p a b i l it i e s f o r o t h e r o b j e c ts , i t s h o u l d b e
c l e a r t h a t t h e a c t u a l p r o t e c t i o n d o m a in e x t e n d s t o a l l o b j e c t s
r e a c h a b l e v i a s o m e c a p a b i l i ty p a t h r o o t e d i n t h e L N S . A c c e ss
t o s u c h o b j e c t s i s li m i t e d t h o u g h , b y t h e r i g h t s i n t h e
c a p a b i l i t i e s a l o n g t h e p a t h .
In add i t ion to ac t ing as the p ro tec t ion doma in o f an
e x e c u t i n g p r o g r a m , t h e L N S a l s o s e r v e s a n a m i n g f u n c t i o n .
O b j e c t s r e f e r e n c e d i n t h e C - l i s t o f an L NS a r e n e v e r r e f e r r e d
t o b y t h e i r u n i q u e n a m e s . T h e y a r e a l w a y s n a m e d b y t h e i r
LNS C - l i s t ind ices . S im i la r l y , ob jec ts ind i rec t l y access ib le v ia a
c a p a b i l i t y c h a i n r o o t e d i n t h e L N S c a n b e d i r e c t l y n a m e d b y
t h e s e q u e n c e o f C - l i s t i n d i c e s a lo n g t h e p a t h t o t h e o b j e c t . A s
a g e n e r a l r u l e , a n y w h e r e ( t h e L N S i n d e x o f ) a c a p a b i l i t y m a y
a p p e a r i n t h e c a l l i n g s e q u e n c e o f a k e r n e l c a l l o r p r o c e d u r e
ca l l , a
p a t h
t o a more d is tan t ob jec t may a lso appea r, The
H y d r a k e r n e l h a n d l e s a l l o f t h e d e t a i ls o f f o l l o w i n g t h e p a t h t o
t h e t a r g e t o b j e c t .
1 4 3
8/10/2019 Cohen Protectio Hydra
4/20
2.4 Gen eric Operations
H y d r a s u p p o r t s o b j e c t s o f m an y d i f f e r e n t ty p e s . S o m e
o f t h e t y p e s a r e i m p l e m e n t e d b y t h e k e r n e l , f o r e x a m p l e
PROCEDUR E, SEMAP HORE, PROCESS and TY PE. Others, such as
FILE a nd D IRECTORY, a re d e f ined b y use r leve l subsys tems.
B u t a l l o b j e c t s , r e g a r d l e s s o f t y p e , w h e t h e r d e f i n e d b y t h e
k e r n e l o r b y u s e r s o f t w a r e , h a v e a c om m o n u n d e r l y in g
s t r u c t u r a l r e p r e s e n t a t i o n , i .e . D a t a - p a r t a n d C - l i s t.
F u r t h e r m o r e , a l l
opera t ions on ob jec ts can be composed f rom
s i m p l e m a n i p u l a t i o n s o f t h e i r D a t a - p a r ts a n d C - l is t s . T h e r e f o r e
t h e H y d r a k e r n e l p r o v i d e s a n u m b e r o f t y p e i n d e p e n d e n t
" g e n e r i c " o p e r a t i o n s f o r t h e s e m a n ip u la ti on s . T h e s e
o p e r a t i o n s a r e k e r n e l c a l l s , k - c a l l s f o r s h o r t , a n d a r e
i m p l e m e n t e d b y i n s t r u c t i o n s w h i c h t r a p to t h e ke r n e l .
T h e k - c a l l Cetd~:~ta prov ides access to t he Da ta -pa r t o f
a n o b j e c t . I t s f i r s t p a r a m e t e r i s a p a t h to a c a p a b i l i t y f o r t h e
o b j e c t w h o s e D a t a - p a r t i s to b e re a d . T h e o t h e r p a r a m e t er s
s p e c i f y w h a t p a r t o f t h e D a t a - p a r t o f t h e o b j e c t i s t o b e r e a d
( i . e . o f f se t and leng th ) and the add ress in t he ca l le r ' s add ress
s p a c e i n t o w h i c h t h e i n f o r m a t i o n s h o u l d b e c op ie d . 3 A s i m i la r
k - c a l l , P ~ t d ~ o . . , a l l o w s t h e u s e r t o w r i t e i n t o t h e D a t a - p a r t o f
a n o b j e c t . T h e r e i s a t h i r d k e r n e l c a l l, A d d ~ o. , w h i c h a l l o w s
t h e c a l l e r t o a p p e n d d a t a o n t o t h e e n d o f t h e D a t a - p a r t o f t h e
o b j e c t ( e x t e n d i n g t h e l e n g t h o f t h e D a t a - p a rt a s a s i d e - e f f e c t .)
T h e r e a r e s i m i l a r o p e r a t i o n s f o r m a n i p u l a t i n g t h e C - l i s t s
o f o b j e c t s . F o r " r e a d i n g " a C - l i s t , i .e . c o p y i n g a c a p a b i l it y in t o
t h e c u r r e n t L N S , t h e u s e r e x e cu t e s a Load k-ca l l . Load's f i r s t
p a r a m e t e r i s a p a t h t o t h e c a p a b i l i t y w h i c h i s t o b e " r e ad " .
T h e s e c o n d p a r a m e t e r i s th e i n d e x o f a c u r r e n t L N S s l o t i n t o
w h i c h t h e c a p a b i l i t y i s c o p i e d .
O f c o u r s e t h e r e i s a l s o a S t o r e k-ca l l wh ich cop ies a
c a p a b i l i t y f r o m t h e c u r r e n t L N S i n t o t h e C - l i s t o f a n o t h e r
o b j e c t o r i n t o a s l o t i n t h e L N S . H o w e v e r , i n a d d it i o n t o t h e
s o u r c e a n d d e s t i n a t i o n p a r a m e t e r s , S t o r e t akes a th i rd
p a r a m e t e r , a r i g h t s r e s t r i c t i o n m a s k . W h e n a c a p a b i l i t y is
s t o r e d , i t i s o f t e n d e s i r a b l e f o r t h e c o p y t h a t i s s t o r e d t o h a v e
f e w e r r i g h t s t h a n t h e o r ig i n a l . S t o r i n g a c a p a b i l i t y i n t o a
p u b l i c o b j e c t ( o r a t a n y r a t e a n o b j e c t t h a t a t l ea s t on e o t h e r
u s e r c a n a c c e s s ) i s t h e p r i m a r y m e c h a n i s m H y d r a p r o v i d e s f o r
s h a r i n g a c c es s r i g h t s , a n d o f t e n w h a t i s d e s i re d i s to s h a r e
s o m e , b u t n o t a l l, o f t h e r i g h t s t o a n o b j e c t, e , g . r e a d - r i g h t s ,
b u t n o t w r i t e - r i g h t s t o a f i le . T h e r i g h t s r e s t r i c t i o n m a s k
p a s s e d t o
3 to r e
ac ts as a r igh ts " f i l t e r " , and i s " anded" w i th t he
s e t o f r i g h t s c o n t a i n e d i n t h e s o u rc e c a p a b i l i ty to p r o d u c e t h e
r e s t r i c t e d r i g h t s t h a t a r e p l a c e d in th e d e s t i n a ti o n c a p a b i l i t y .
I n t h e c a s e t h a t t h e s o u r c e a n d d e s t i n a t i o n a r e t h e s a m e ,
Store
s i m p l y r e m o v e s t h e m a s k e d - o u t r i g h t s f r o m th e d e s ig n a t e d
c a p a b i l i t y .
A n
Appen.d
k-ca l l , w h ich appends a cap ab i l i t y t o a C - l i s t ,
i s a l s o p r o v i d e d . A s w i t h
3tore,
t he use r can res t r i c t t he r igh ts
o f t h e a p p e n d e d c a p a b i l i t y .
T h e Delete k-ca l l rem oves a cap ab i l i t y f rom the C - l i s t o f
an ob jec t . De le t ing a cap ab i l i t y f rom a C - l i s t does no t cause i t
t o c o l l a p s e , w i t h t h e c o n s e q u e n t r e n u m b e r i n g o f t h e h i g h e r
n u m b e r e d c a p a b i l i t i e s . T h e s l o t i n w h i c h t h e d e l e t e d c a p a b i l i t y
s a t i s s i m p l y w r i t t e n o v e r w i t h a c a p a b i l it y o f t h e s p ec i a l t y p e
N U L L ( w h o s e o n l y u s e i s t h e i n d i c a t i o n o f e m p t y C - l i s t s lo t s .)
N o t e t h a t t h e
Delete
o p e r a t i o n d o e s n o t d e s t r o y t h e o b j e c t
r e f e r r e d t o b y t h e c a p a b i l i t y ; i t o n l y d e s t r o y s t h e c a p a b i l i t y
i t se l f . On ly i f a l_L o f t he capa b i l i t i es fo r an ob jec t have been
d e l e t e d i s t h e o b j e c t i t s e l f e l i g i b le fo r d e s t r u c t io n . W e a re
p l a n n i n g t o i m p l e m e n t a Dest roy k - c a l l w h i c h w i l l d e s t r o y a n
o b j e c t e v e n t h o u g h c a p a b i l i t i e s f o r i t a r e s t i l l o u t s t a n d i n g .
A t t e m p t s t o a c c e s s a d e s t r o y e d o b j e c t w i l l s ig n al a n e r r o r .
F i n a l l y , t h e r e i s a Co p y k - c a l l w h i c h c o p i e s t h e D a t a - p a r t
a n d C - l i s t o f a n o b j e c t , g i v e n a c a p a b i l it y f o r i t , t o a n e w
o b j e c t , p l a c i n g a c a p a b i l i t y f o r t h e n e w o b j e c t i n a d e s i g n a te d
s l o t i n t h e c a l l e r ' s L N S . T h e c a p a b i l i t y f o r t h e n e w o b j e c t w i l l
c o n t a i n t h e s a m e r i g h t s a s d i d t h e o r i g i n a l . 4 T h e C r e ~ e k - c a l l ,
w h i c h c r e a t e s a n e n t i r e l y n e w o b j e c t w i l l b e d is c us s ed i n
s e c t i o n 2 . 1 1 .
T h e g e n e r i c o p e r a t i o n s a r e i m p o r t a n t be c au s e t h e y f o rm
t h e p r i m i t i v e b a s i s f o r t h e d e f i n i t io n o f " h i g h e r le v e l " ty p e
s p e c i f i c o p e r a t i o n s i m p l e m e n t e d a s p r o c e d u r e s . T h e C - l i s t
m a n i p u l a t i n g o p e r a t i o n s a r e e s p e c i a l l y i m p o r t a n t b e c a u s e t h e y
a l l o w t h e c o n s t r u c t i o n o f c o l l e c t i o n s o f o b j e c ts w h i c h a re
p a s s e d a r o u n d a n d m a n i p u l a t e d t o g e t h e r a s a u ni t .
I t s h o u l d b e n o t e d t h a t e a c h o f t h e g e n e r i c o p e r a t i o n s
d e s c r i b e d a b o v e i s im p l e m e n t e d i n d iv i s i b l y . T h i s m e a n s t h a t
t w o p r o c e s s e s c a n n o t o p e r a t e o n th e s a m e o b j e c t a t th e s a m e
t i m e e v e n i f t h e y a r e e x e c u t in g c o n c u r r e n t ly o n d if f e r e n t
p i ' o c e s s o r s . H o w e v e r , t h i s m u tu a l e x c l u s io n h o l d s f o r t h e
d u r a t i o n o f a s i n g le k e r n e l c a l l o n l y . F o r m u tu a l e x c l u s i o n o f
c o m p o s i t e o p e r a t i o n s r e q u i r i n g m o r e t h a n o n e k e rn e l c a l l, s o m e
o t h e r f o r m o f s y n c h r o n i z a t i o n , s u c h a s s e m a ph o re s , i s
n e c e s s a r y .
W e d i d e x p e c t t h a t u s e r s w o u l d d e s i r e c e r t a i n s e q u e n c e s
o f k - c a l l s e x e c u t e d i n d i v i s i b l y fr e q u e n t l y e n o u g h t h a t w e
pac kag ed them as sepa ra te k -ca l l s . Fo r examp le, t he k -ca l l s ,
T a k e
and Po .ss a re equ iva le n t t o t he compos ites
(Looxi ;
De/el:e)
a n d ( S t o r e ; D e l e t e ) r e s p e c t i v e l y .
2 .5 Shar ing
P e r h a p s t h e m a j o r b e n e f i t o f t h e v e r y g e n e r a l
o b j e c t / c a p a b i l i t y s t r u c t u r e i s t h e e a s e w i t h w h i c h it p e r m it s
s h a r i n g . I f t w o e x e c u t i n g L N S ' s , U s e r - 1 a n d U s e r - 2 b o t h h a v e
a C a p a b i l i t y f o r s o m e o b j e c t C o m m - 1 , t h e y c a n e a s i l y s h a r e
b o t h d a t a a n d c a p a b i l it i e s . U s e r - 1 c a n s t o r e d a t a i n t o C o m m -
l ' s D a t a - p a r t a n d U s e r - 2 c a n t h e n r e t r i e v e i t ( a s s u m i n g t h e i r
c a p a b i l i t i e s c o n t a i n t h e r i g h t s t h a t a l l o w t h e
necessary
k-ca l ls) .
M o r e i n t e r e s t i n g l y , i m a g i n e a s i t u a t io n w h e r e U s e r - 1 h a s r i g h t s
t h a t p e r m i t b o t h r e a d a n d w r i t e a c c e s s f o r s o m e f i le a n d
w i s h e s t o g r a n t U s e r - 2 r e a d a c c e s s o n l y . A s f i g u r e 2 .1
i l l u s t r a t e s , i t i s p o s s i b l e f o r U s e r - 1 t o s t o re a c a p a b i l i t y f o r
t h e f i l e i n C o m m - 1 , r e s t r i c t i n g r i g h t s s o t h a t t h e c a p a b i l i t y f o r
t h e f i l e p l a c e d i n C o m m - 1 o n l y c o n t a i n s t h e r i g h t s p e r m i t t i n g
r e a d a c ce s s. T h r o u g h C o m m - 1, U s e r - 2 c a n t h e n g a in re a d
access to t he f i l e (s teps (1 ) and (2 ) in t he f igu re ) ,
3 . H a r d w a r e l i m i t a t io n s p r e v e n t m a p pi ng t h e D a t a - p a r t s o f
o b j e c t s d i r e c t l y i n t o t h e u s e r ' s a d d r e s s s p a c e .
4 . Th is i s no t s t r i c t l y t rue , bu t w i l l su f f i ce fo r t h is d iscuss ion .
1 4 4
8/10/2019 Cohen Protectio Hydra
5/20
8/10/2019 Cohen Protectio Hydra
6/20
A s w e m e n t i o n e d i n s e c t i o n 2 .4 , a v e r s i o n o f S t o re a l l o w s
a u s e r t o r e s t r i c t h i s o w n a c c es s t o a n o b j e c t . A g o o d
p r o t e c t i o n m e c h an is m p r o t e c t s u s er s n o t o n l y fr o m o t h e r
u s e r s , b u t f r o m t h e m s e l v e s a s w e l l . T h i s i s e s p e c i a l l y
i m p o r t a n t w h e n a u s e r i s te s t i n g a p r o g ra m a b o u t w h ic h h e i s
s t i l l a b i t u n c e r t a i n , a n d w a n t s t o l i m i t t h e h a v o c h e c a n w r e a k
a m o n g o b j e c t s h e c a n a c c e ss .
D L T R T S p r o v i d e s a n e x a m p l e o f s u c h a s a f e gu a r d.
N o r m a l l y a l l c a p a b i l i t ie s c o n t a i n D L T R T $ , t h o u g h w e w i l l n o t
s h o w t h e m i n a n y o f o u r d ia g r am s . A c a p a b i l i t y m a y n o t b e
d e l e t e d , n o r m a y a n y r i g h t b e r e m o v e d f r o m it , u nl e ss i t
c o n t a i n s D L T R T S . T h u s , a n u n c e r t a i n u s e r c a n r e m o v e D LT R T S
f r o m c a p a b i l i ti e s i n h i s o w n L NS in o r d e r t o g u a r a n t e e t h a t h e
w i ld n o t m i s t a k e n l y r e d u c e h is o w n a c c e s s r i g h ts . A u s e r m a y
a l s o f i n d f f o c c a s i o n a l l y u s e f u l to r e s t r i c t D L T R T S w h e n s t o r i n g
a c a p a b i l i t y i n a n o b j e c t b e f o r e g r a n t i n g K [L L R TS f o r t h a t
o b j e c t t o a n o t h e r u s e r .
2.7 Procedures and LNSs
A procedure i s a n o b j e c t w h i c h s e r v e s a s a n a b s t r a c t i o n
o f t h e o r d i n a r y p r o g r a m m i n g n o t i o n o f p r o c e d u r e o r
s u b r o u t i n e . T h u s j i t h a s s o m e " c o d e " a n d s o m e " o w n s "
a s s o c i a t e d w i t h i t . ] t m a y t a k e c a p a b i l i ti e s a s p a r a m e t e r s a n d
i t m a y r e t u r n a c a p a b i l i t y t o i ts c a l le r . P r o c ed u r es m a y C a / /
o n e a n o t h e r i n a p o t e n t i a l l y r e c u r s i v e m a n n e r, b e c a u se
p r o c e d u r e a c t i v a t i o n s ( L N S e s ) a r e s t a c k e d .
H o w e v e r , H y d r a p r o c e d u r e s g o b e y o n d t h i s s i m p l e m o d e l
b y i n c l u d i n g p r o t e c t i o n f a c il it ie s . T h e p ro c e d u r e o b je c t
a c t u a l l y s e r v e s a s a p r o t o t y p e o r m o d e l f o r t h e L N S c r e a t e d
w h e n t h e p r o c e d u r e i s c al le d . F o r e xa m p l e , t h e p r o c e d u r e ' s C -
l i s t C o n t a i n s a c a p a b i l i t y f o r e a c h o f t h e o b j e c t s c o n s i d e r e d t o
b e " o w n " t o t h e p r o c e d u r e , a n d c o p ie s o f t h o s e c a p a b il it ie s a r e
p l a c e d i n t h e i n s t a n t i a t e d L N $ d u r i n g a p r o c e d u r e ca l l. I n
a d d i t i o n , t h e C - l i s t o f a p r o c e d u r e m a y c o n t a i n s t r u c t u r e s
w h i c h a r e n o t c a p a b i l i t ie s a t a ll , b u t " p r o t o t y p e c a p a b i l i ti e s "
c a l l e d tertzplo.te$. T h e r e m u s t b e o n e t e m p l a t e f o r e a c h " f o r m a l
p a r a m e t e r " o f t h e p r o c e d u r e , w h i c h s p e c i fi e s t h e t y p e a n d
r g h t s r e q u i r e d o f t h e p a r a m e t e r . D u r in g a p r o c e d u r e c a ll
t h e s e t e m p l a t e s a r e r e p l a c e d b y " a c tu a l p a r a m e t e r " c a p a b i li ti e s
d e r i v e d f r o m t h e c a p a b i l i t i e s p a s s e d a s a r g um e n t s . 7
T h e D a t a - p a r t o f a n L N S c o n ta i ns a v a r i e t y o f u s e f u l
i n f o r m a t i o n w h i c h is i n i t i a l iz e d fr o m t h e D a t a - p a r t o f th e
p r o c e d u r e w h e n t h e L N $ i s i n s t a n t ia t e d . T h i s i n f o r m a t i o n
i n c l u d e s s p e c i f i c a t io n o f t h e L N S ' s a d dr es s s p a c e , s o f t w a r e
t r a p a n d i n t e r r u p t v e c t o r s ( h a r d w a r e tr a p s a n d i n t e r r u p ts a r e
h a n d l e d b y t h e k e r n e l ) a n d t h e l o c a t io n o f t h e f i r s t i n s t r u c ti o n
o f t h e p r o c e d u r e .
6 . T h i s d i f f e r s f r o m K I L LR T S . A u s e r r e q u i r e s a c a p a b i l i t y
c o n t a i n i n g K IL L R T $ t o d e l e t e c a p a b i li ti e s i n t h e o b j e c t
r e f e r . e n c e d b y t h e g i v e n c a p a b i li t y .
7 . H y d r a P r o c e d u r e s a r e v e r y s i m i la r to a c o m b i n a ti o n o f w h a t
C A L - T S S c a l l s d om a i n s a n d g a t e s [ G r a 7 2 ] . T h e fo r m e r
s p e c i f i e s t h e p r o c e d u r e " o w n s ", w h i l e t h e l a t t e r s p e c if ie s t h e
f o r m o f t h e p r o c e d u r e a r g u m e n ts . F o r a n u m b e r o f re a s o n s,
i n c l u d i n g e f f i c ie n c y , w e h a v e c o m e t o b e l i e v e th a t t h e
s e p a r a t i o n i s p r o b a b l y d e s i r a b l e .
W e b e l i e v e t h a t i d e a l l y , a l l p r o c e d u r e s , i n c l u d in g s i m p l e
s u b r o u t i n e s s u c h a s s q ~ o r s i n e , s h o u l d e x e c u t e i n a n
e n v i r o n m e n t p r o v i d i n g t h e s m a l le s t s e t o f a c c e s s r i g h ts
n e c e s s a r y . T h i s i m p l i e s f r e q u e n t ch a n g e s i n t h e p r o t e c t i o n
d o m a i n . B u t i n m u c h t h e s a m e w a y t h a t o n e m i gh t d e c i d e
w h e t h e r a s u b r o u t i n e s h o u l d b e c a l le d o r e x p a n d e d i n l in e , o n e
m u s t c o n s i d e r t h e c o s t s i n v o l v e d i n s w i t c h i n g p r o t e c t i o n
d o m a i n s . U n f o r t u n a t e l y t h is c o s t i n H y d r a is c o n s i d e r a b l e , d u e
t o t h e l i m i t a t i o n s o f h a r d w a r e a n d t o c e r t a i n d e s ig n fl a w s . A
a r e s u l t , u s e r s p a c k a g e r o u t i n e s a s H y d r a P r o c e d u r e s o n l y
w h e n t h e p r o t e c t i o n d o m a i n m u st b e ch a ng e d t o p r o t e c t e i t h e
t h e c a l l e r o r t h e s u p p l i e r o f t h e r o u t i n e , o r w h e n t h e r o u t i n e i
s o l a r g e t h a t t h e o v e r h e a d o f d o m a in s w i tc h i n g i s i n s i g n i fi c a n
F o r e x a m p l e , a c o m p i l e r m ig h t b e p a ck a g e d as a p r o c e d u r
w h i c h t a k e s a c a p a b i l i t y f o r a s o u r c e f i l e a s a n a r g u m e n t a n
r e t u r n s a c a p a b i l i t y f o r a n o b j e c t fi le .
T h e d i f f e r e n c e b e t w e e n a p r o c e d u r e a n d a n L N S i s a n
i m p o r t a n t o n e e v e n t h o u g h i t is fr e q u e n t l y b l u r r e d . ( W
s o m e t i m e s s p e a k o f t h e e x e c u t i n g p ro c e d u r e w h e n w e a c t u a l l
m e a n t h e L N $ c r e a t e d f r o m t h a t p r o c e d u r e d u r i n g t h e ca
o p e r a t i o n . ) A n L N $ m a y c h a n g e d u r i n g t h e c o u r s e o f i t
e x e c u t i o n , f o r i n s ta n c e b y c r e a t in g n e w o b j e c ts a n d s t o r in
c a p a b i l i t i e s f o r t h e m i n t h e L N S ' s C - l is t . B u t th e p r o c e d u r
o b j e c t i t s e l f i s n e v e r a f f e c t e d b y t h e L N S ' s e x e c u t i o n . T h u s
p r o c e d u r e s a r e p o t e n t i a l l y re e n t r a n t a n d r e c u r si v e .
2 , 8 Processes
O b j e c t s o f t y p e P R O C E S S c o r r e s p o n d t o t h e u s u a
i n f o r m a l n o t i o n o f a p r o c e s s , t h a t i s , a n e n t i t y w h i c h m a y b
s c h e d u l e d f o r e x e c u t i o n . T h e D a t a - p a r t o f a pr oc e ss o b j e c
c o n t a i n s p r o c e s s s t a t e i n f o r m a t i o n (e . g. s c h e d ul in g p a r a m e t e r s
T h e C - l i s t o f a p r o c e s s o b j e c t c o n t a i n s a li s t o f L N S 's , t r e a t e
a s a s t a c k . T h e " t o p " L N $ d e f i n e s t h e c u r r e n t p r o t e c t i o
d o m a i n o f t h e p r o c e s s .
T h e c u r r e n t p r o t e c t i o n d o m a in o f a p r o ce s s m a y ch a n g
m a n y t i m e s d u r i n g e x e c u t i o n o f t h e p r o ce s s, c o r r e s p o n d i n g t
c a l l s a n d r e t u r n s o f H y d r a P r o ce d u r es . E a c h t i m e a p r o c e d u r
i s c a l l e d , a n e w L N $ i s c r e a t e d , i n i t ia l i z e d a n d p u s h e d o n t o t h
t o p o f t h e L N $ s ta c k , b e c o m in g th e c u r r e n t L N S . W h e n t h e t o
L N $ r e t u r n s , i t i s p o p p e d f ro m t h e t o p o f th e L N S s t ac k a n
d e s t r o ye d . C o n t r o l r e t u r n s t o L N $ b e l o w i t o n t h e s t a c k . 8
H o l d e r s o f a c a p a b i l i t y f o r a p ro c e s s o b j e c t m a y s t a r
and s top i t , as we l l as change the p rocess s ta te . (Add i t iona
d e t a i l s c a n b e f o u n d i n [ L e v 7 5 ] ) , h o w e v e r n o c a p a b i l i t y f o r
p r o c e s s c o n t a i n s t h e g e n e r i c r i g h t s n e c e ss a r y ( L O A D R T $ , e t c
t o p e r m i t a c c e s s t o t h e p r o c e s s ' C - l i s t. A u s e r s c h e du l in g
p r o c e s s d o e s n o t n e c e s s a r i l y h a v e a r i g h t t o k n o w w h a t t h
p r o c e s s i s d o i n g . T h i s i s e s p e c i a l l y t r u e i n th e c a s e t h a t
p r o p r i e t a r y p r o c e d u r e h a s b e e n ca ll ed . I f t h e p r o c e s
s c h e d u l e r c o u l d a c c e ss t h e p r o c e s s ' C - l i s t , i t w o u l d b e a b l e t
a c c e s s t h e p r o p r i e t a r y p r o c e d u r e ' s " ow n s ".
8 . T h e r e i s a f a c i l i t y t h a t a l l o w s L N S ' s t o b e s a v e d a f te r t h e y
r e t u r n . T h e L N S m a y th e n b e c o n ti n ue d , c a u s in g c o n t r o l t o b
t r a n s f e r e d j u s t b e y o n d t h e r e t u r n p o i n t . T h is d o es n o t r e q u i r
a n y c h a n g e s i n t h e L N S s t a c k a s d e s c r i b e d . T h e s t a c k i s u s e d
o n l y f o r c o n t r o l ( c a l l / r e t u r n d i s c i p li n e ) , r a t h e r t h a n f o r a c c e ss
A n y o b j e c t a c c e s s e d i s r e a c h e d t h r o u g h a p a th r o o t e d i n t h
c u r r e n t L N S , n o t t h r o u g h a n y L NS i n t h e s ta c k . A c t u a l l y , t h e r e
i s a s e t o f c a p a b i l i t ie s a c c es s ib l e i n d i r e c t l y . T h e c r e a t o r o f
p r o c e s s , i n a d d i t i o n t o s p e c i f y i n g i ts i n i t i a l L N $ , a l s o m a
a s s o c i a t e a p r o c e s s b a s e w i t h a p r o ce s s , a n o b j e c t w h o s e C
l i s t c a n b e a c c e ss e d b y a n y L N $ e x e c u t i n g u n d e r t h e p r o ce s s .
146
8/10/2019 Cohen Protectio Hydra
7/20
2.9 Typ es and Subsystems
W e h a v e a l r e a d y m e n t i o n e d t h a t a l l o b j e c t s a r e a t h r e e -
t u p l e :
< u n i q u e - n a m e , t y p e , r e p r e s e n t a t i o n > .
I n t h i s s e c t i o n , w e w i l l d i s c u s s t h e r e p r e s e n t a t i o n o f
t y p e s a n d i t s r o l e i n d e f i n i n g t y p e s u. bs ys te m J.
T h e t y p e o f a n o b j e c t i s a c t u a l l y t h e n a m e o f s o m e o t h e r
o b j e c t w h o s e t y p e i s T Y P E . T h a t i s , j u s t a s t h e r e o b j e c t s o f
t y pe PRO CESS , PROCEDURE and pe rhaps F ILE-D IRECTORY,
t h e r e a r e o b j e c t s o f t y p e T Y P E , e ac h o ne o f w h i c h
" r e p r e s e n t s " t h e c l a ss o f o b je c t s o f t h a t t y p e . F o r e x a m p l e ,
t h e o b j e c t w h o s e n a m e i s S E M AP H O RE a n d w h o s e t y p e i s TY P E
" r e p r e s e n t s " a l l o b j e c t s w h o s e t y p e i s S E M A P H O R E
O f c o u r s e , a l l th o s e o b j e c t s o f t y p e T Y P E m u s t b e
r e p r e s e n t e d b y a T Y P E o b j e c t w h o s e n a m e i s a ls o T Y P E . T h is
a l l c a n b e d e p i c t e d b y a t h r e e l e v e l t r e e w i t h t h e T Y P E - T Y P E
o b j e c t a t t h e r o o t . F i g u r e 2 .2 sh o w s p a r t o f t h e t r e e
c o n t a i n i n g o b j e c t s o f t y p e T Y P E , P A G ~ F I L E a n d S EM A PH O RE .
F igu re 2 .2
G i v e n a c a p a b i l i t y f o r s o m e T Y P E o b j e c t , a n e w o b j e c t o f
t h a t t y p e m a y b e c r e a t e d ( t h e d e t a i ls m a y b e f o u n d in s e c ti o n
2 . 1 1 ) . I n p a r t i c u l a r , n e w ty p e s m a y b e d e f i n e d b y
s t a r t i n g w i t h t h e T Y P E - T Y P E o b j e c t .
T h e D a t a - p a r t o f a T Y P E o b j e c t c o n t a i n s a v a r i e t y o f
u s e f u l i n f o r m a t i o n , s u c h a s t h e m a x i m u m p e r m i s s ib l e s iz e s o f
t h e C - l i s t a n d D a t a - p a r t s o f o b j e c t s o f t h a t t ype ( e n f o r c e d b y
t h e k e r n e l ) . A s w e s h a l l s e e s h o r t l y , t h e C - l is t i s m o r e
i n t e r e s t i n g .
T h e c o n c e p t o f " t y p e " i n H y d r a i s c l o s e l y r e l a t e d t o t h e
co nc ep t o f " da ta t yp e " in a numbe r o f p rog ramming languages
de s ig ned fo r " s t ru c tu red p rog ramm ing" , i .e . " c lass" in S imu la
[ D a h 6 6 ] , " c l u s t e r " i n C L U [L i s 7 4 ] a n d "f o r m " i n A l p h a r d
[ W u 1 7 4 b ] ( t h i s r e l a t i o n s h i p i s d is c us s ed m o r e t h o r o u g h l y i n
[ W L P 7 5 ] ) . T h e c e n t r a l n o t i o n is t h a t a t y p e i s a n a b s t r a c t io n
o f a c lass o f ob jec ts , and tha t t he abs t rac t ion spec i f ies no t
o n l y t h e r e p r e s e n t a t i o n o f t h e o b j e c t s , b u t t h e o p e r a t i o n s t h a t
a p p l y t o t h e o b j e c t s a s w e l l . A k e y f e a tu r e o f t y p e
a b s t r a c t i o n i s t h a t t h e r e p r e s e n t a t i o n o f a n o b j e c t s h o u l d n o t
g e n e r a l l y b e k n o w n t o u s e r s o f t h e ob j e c t . M a n i p u l a t io n o f t h e
o b j e c t s h o u l d o n l y b e p o s s i b l e b y i n v o k i n g t h o se o p e r a t i o n
s p e c i f i c t o i t s t y p e .
In t he case o f use r de f ined t ypes in Hyd ra , t hese
o p e r a t i o n s a r e s p e c i f i e d a s H y d r a P r oc e du r es , a n d t h e C - l i s t o f
t h e T Y P E o b j e c t c o n t a i n s c a p a b i l i t ie s f o r t h e s e p r o c e d u r e s . 9
We ca l l t h is co l lec t ion o f p roced u res a S~bs :t s~e rn . Fo r
e x a m p l e , a F i l e - d i r e c t o r y s u b s y s t e m w o u l d l i k e l y c o n t a i n o n e
p r o c e d u r e t h a t w o u l d s t o r e a f il e i n a g i v e n fi l e - d i re c t o r y b y
s y m b o l i c n a m e a s w e l l a s o n e t h a t w o u l d r e t u r n a c a p a b i l i t y
f o r a f i l e g i v e n a f i l e - d i r e c t o r y a n d t h e f il e ' s s y m b o l i c na m e .
A s a l r e a d y n o t e d , t h e r e p r e s e n t a t i o n o f a n o b j e c t ,
w h a t e v e r i t s t y p e , i s s i m p l y t h e c o n t e n t s o f i t s C - l i s t a n d D a t a -
p a r t . T h e r e i s n o e x p l i c i t d e c l a r a ti o n o f h o w t h a t
r e p r e s e n t a t i o n i s t o b e i n t e r p r e t e d ; r a t h e r i t is im p l i c i t i n h o w
t h e r e p r e s e n t a t i o n i s u s e d b y a s u b s y s t e m 's p ro c e d u r e s . F o r
e x a m p l e , t h e p r o c e d u r e s i n a F i l e - d i r e c t o r y s u b s y s t e m m i g h t
i n t e r p r e t t h e D a t a - p a r t o f a f i l e - d i r e c t o r y o b j e c t as c o n t a i n i n g
a m a p f r o m t h e s y m b o l i c n a m e o f a fi l e t o th e i n d e x i n th e f i l e -
d i r e c t o r y ' s C - l i s t w h e r e t h e c a p a b i l i t y f o r t h e f i l e m ig h t b e
f o u n d .
H y d r a m u s t s o m e h o w g u a r a n t e e t h a t o r d i n a r y u s e r s
c a n n o t a c c e s s o r m a n i p u l a te a n o b je c t ' s r e p r e s e n t a t i o n e x c e p t
b y c a l l i n g s u b s y s t e m p r o c e d u r e s , e s p e c i a ll y s in c e o u t s i d e
a c c e s s m i g h t t h r e a t e n t h e i n t e g r i t y o f t h e a s s u m p t i o n s m a d e
b y t h e s u b s y s t e m r e g a r d i n g t h e f o r m a t o f t h e r e p r e s e n t a t i o n .
T h i s i m p l i e s t h a t o r d i n a r y u s e r s do n o t h a v e c a p a b i l it i e s
c o n t a i n i n g t h e v a r i o u s g e n e r i c r i g h t s ( L O A D R T S , P U T R T S , e t c .)
t h a t pe rm i t access to an ob jec t ' s rep rese n ta t ion . Ye t , a
s u b s y s t e m p r o c e d u r e m u s t b e a b l e t o g a i n t h e s e r i g h t s w h e n a
c a p a b i l i t y f o r a n o b j e c t o f th e t y pe i t suppo r t s i s passed to i t
as an a rgum en t . I n o the r systems, ob jec ts a re " sea led "
[ M o r 7 3 , R e d 7 4 a ] b y a s u b s y s t e m w h e n p r e s e n t e d to a u s e r .
T h e s u b s y s t e m p r o c e d u r e s m u s t t h e n b e ab l e t o " u n s e a l " t h e m
i n o r d e r t o m a n i p u l a t e th e m d i r e c t l y . I n Hy d ra , se a l in g s i m p l y
m e a n s t h e r e s t r i c t i o n o f t h e a p p r o p r i a t e g e n e r i c r i g h t s .
U n s e a l i n g i s a c c o m p l i s h e d b y Ri~ght~ A~pb~[~o.ci.on [ Jon73 ] .
Th e ex ac t m echan ism wh ich suppo r t s amp l i f i ca t ion i s d iscussed
i n s e c t i o n 2 . 1 1 .
A s w e n o t e d i n s e c t i o n 2 .6 , th e a u x i l ia r y r ig h t s o f u s e r
d e f i n e d t y p e s a r e n o t s p e c i a l l y i n t e r p r e t e d b y t h e ke r n e l . L ik e
t h e g e n e r i c r i g h t s , t h e y m a y b e r e s t r i c t e d v i a t h e g e n e r i c
o p e r a t i o n s a l r e a d y d i s c u s s e d ( s e c t i o n 2 . 4 ) a n d m a y n o t b e
g a i n e d e x c e p t t h r o u g h r i g h t s a m p l if ic a t io n . I t is p o s s i b le t o
c h e c k w h e t h e r a c a p a b i l i t y c o n t a i n s a p a r t i c u l a r r i g h t ( s e c t i o n
2 . 1 1 ) , a n d t h u s a s u b s y s t e m m a y u s e a u x i l i a r y r ig h t s t o
a l l o w o r d i s a l l o w c a l l s o n v a r i o u s p r o c e d u r e s i n m u c h t h e s am e
w a y t h a t t h e k e r n e l u s e s g e n e r i c r i g h t s to a l lo w o r d i s a l l o w
t h e a p p l i c a t i o n o f v a r i o u s g e n e r i c o p e r a t i o n s .
F o r e x a m p l e , a F i l e - w r i t e p r o c e d u r e m i g h t r e q u i r e a
c a p a b i l i t y f o r a f i l e c o n t a i n i n g a u x i l ia r y r ig h t # 2 , w h i l e a F i l e -
r e a d p r o c e d u r e m i g h t r e q u i r e a c a p a b i l it y fo r a f i l e c o n t a i n i n g
a u x i l i a r y r i g h t # 5 . I f t h e " o w n e r " o f a f i l e h o l d s a c a p a b i l i t y
w i t h b o t h r i g h t s , b u t s h a r e s o n l y a c a p a b i l i t y w i t h a u x i l i a r y
r i g h t e 5 w i t h o t h e r u s e r s , t h e n w h i l e o t h e r u s e rs w i l l b e a b l e
t o r e a d t h e f i l e , o n l y t h e " o w n e r ' w i l l b e a b le to w r i t e i t .
9 . O n e d o e s n o t n e e d a c a p a b i l i t y f o r t h e T y p e o b j e c t i n o r d e r
t o c a l l o n e o f t h e s e p r o c e d u r e s . U s in g t h e T C A L L o p e r a t i o n
s u p p l i e d b y t h e k e r n e l , t h e y m a y b e ca l le d t h r o u g h a n y o b je c t
o f t h e s p e c i f i e d t y p e . A s im i l a r m e c h an is m m ay b e f o u n d i n
t h e P l e s s e y s y s t e m [ C o s 7 4 ] .
1 4 7
8/10/2019 Cohen Protectio Hydra
8/20
2 . 1 0 K e r n e l T y p e s
Whi le a l l t ypes may be though o f as de f in ing
sub sys tem s, ce r ta in t ypes , such as PROCEDURE, LNS and
PROCESS, a re c ruc ia l t o t he ope ra t ion o f Hyd ra. These t ypes ,
p l u s c e r t a i n o t h e r s u s e f u l a s b u i l d i n g b l o c k s f o r u s e r - d e f i n e d
t y p e s , a r e d e f i n e d a n d i m p l e m e n t e d d i r e c t l y b y t h e H y d r a
k e r n e l . O p e r a t i o n s o n t h e s e k e r n e l - s u p p o r t e d t y p e s a r e
i m p l e m e n t e d a s k - c a l l s i n s t e a d o f p r o c e d u r e c a ll s.
The fo l low ing i s a l i s t o f t he ke rne l -de f ined subsys tems.
In some cases ope ra t ions spec i f i c t o t he t ype a re men t ioned .
E a c h s u c h o p e r a t i o n i s p r o t e c t e d b y a n a u x i l i a r y r i g h t .
L N S - An LNS se rves as a p ro tec t ion doma in
and as a dynam ic ac t i va t ion o f a p rocedu re . I t
i s t h e r o o t o f t h e t r e e ( g r a p h ) o f o b j e c t s
a c c e s s i b l e t o a p r o g r a m a n d p r o v i d e s a
f r a m e w o r k f o r n a m i n g t h e m .
P r o c e d u . r e - Procedures a re the Hyd ra ana logue
o f o r d i n a r y p r o g r a m m i n g o f p r o c e d u r e .
H o w e v e r , a p r o c e d u r e c a l l i n H y d r a c a u s e s a
c h a n g e i n p r o t e c t i o n d o m a i n. T h e C oJ J
o p e r a t i o n r e q u i r e s t h e a u x i l i a r y r i g h t CA L LR T S .
P r o c e s s
- A p rocess ob jec t rep resen ts an
i n d e p e n d e n t l y s c h e d u l a b l e a c t i v i t y , t h e u n i t o f
pa r a l le l decom pos i t ion . P rocesses cons is t o f
some schedu l ing da ta and a s tack o f LNSes .
T h e p r i m a r y o p e r a t i o n s o n t h e m a r e sto.rt and
s t o p .
P~ge - A page ob jec t i s an image o f one o f t he
4 k w o r d d e f i n e d b y t h e h a r d w a r e . O n e c a n
th in k o f t he ad d ress space o f an LNS as de f ined
b y a t a b l e f o u n d i n t h e D a t a - p a r t o f t h e L N S ;
e a c h e n t r y c o n t a i n i n g a n i n d e x i n t o t h e L N S ' s
C - l i s t w h e r e t h e c a p a b i l i t y f o r t h e
c o r r e s p o n d i n g p a g e c a n be f o un d . A m or e
a c c u r a t e a n d c o m p l e t e d e s c r i p t io n i s i n c l u d e d i n
[ L e v 7 5 ] .
S e m . a p h o r e - T h e s e a r e D i j k s t r a - s t y l e
s e m a p h o r e s w i t h P , V a n d c o n d i t i o n a I- P
o p e r a t i o n s d e f i n e d .
P o r t - Por t s a re the bas ic ob jec ts o f t he Hyd ra
in te rp rocess message commun ica t ion sys tem.
T h e y ac t as message sw i t ch ing cen te rs and
s y n c h r o n i z a t i o n s t r u c t u r e s . O p e r a t io n s o n
p o r t s i n c l u d e c o n n e c t and cJ.sconnect ( t o f o rm
a n d b r e a k c h a n n e l c o n n e c t i o n s b e t w e e n p o r t s )
a n d o t h e r p r i m i t i v e s f o r s e n d i n g a n d r e c e i v i n g
messages.
O e u i c e A d e v i c e o b j e c t is t h e s o f t w a r e
r e p r e s e n t a t i v e o f a p h y s i c a l i / o d e v ic e . I n
H y d r a i t i s t r e a t e d a s a v a r i e t y o f p o r t . T h e
o n l y o p e r a t i o n s c u r r e n t l y d e f i n e d o n d e v i c e s
a r e c o n n e c t and ~ s c o~ m ec t : t o po r t s .
P o l l ~ y - Po l icy ob jec ts a re ma i lboxes used by
the ke rne l t o commun ica te w i th p o l i c y s y s t e r n J
res pon s ib le fo r schedu l ing p rocesses . De ta il s
c a n b e f o u n d i n [ L e v 7 5 ] .
D o J a - T h e k e r n e l p r o v i d e s d a t a o b j e c t s a s a
c o n v e n i e n c e t o u s e r s w h o w i s h t o s e a l d a t a i n
p r o t e c t e d o b j e c t s w i t h o u t g o i n g t o t h e t r o u b l e
o f de f in ing a fo rma l subsystem. Da ta ob jec ts
h a v e D a t a - p a r t s , b u t n o C - li s t . T h e i r o n l y us e
is as s imp le da ta ca r r ie rs .
Urd.uersoJ - Un ive rsa l ob jec ts a re s im i la r in
c o n c e p t t o d a t a o b j e c t s e x c e p t t h a t u n i v e r s a l
ob jec ts do have C - l i s t s , and thus can ac t as
ca r r ie rs o f capab i l i t i es as we l l as da ta .
T y p e T y p e o b j e c t s r e p r e s e n t e n t i r e
s u b s y s t e m s . T h e C - li s t s o f t y p e o b j e c ts c o n t a i n
c a p a b i l i t ie s f o r a l l o f t h e o p e r a t i o n s i n t h e
s u b s y s t e m ( i f t h e s y s t e m i s n o t o n e o f t h e s e
k e r n e l d e f i n e d s u b s y s t e m s ) . O n e a u x i l i a r y r i g h t
de f in ed i s T IV lPLRT$, wh ich pe rm i t s a temp la te
t o b e m a d e fr o m a T y p e o b j e c t ( s e c t i o n
2 . 1 t ) .
2 . 1 1 T e m p l a t e s
W e h a v e d e l a y e d d i s c u s s i n g u n t i l n o w t h r e e m e c h a n i s
t h a t H y d r a m u s t p r o v i d e i n o d e r t o s u p p o r t T y p e S u b s y st em s
1 ) C r e a t i o n - A u s e r w i s h e s to c r e a t e a n e w
o b j e c t o f a s p e c i fi c t y p e .
2)
T y p e a n d R i g h ts C h e c k i n g - A u s e r w i s h e s t o
g u a r a n t e e t h a t a c a p a b i l i t y r e f e r e n c e s a n
o b j e c t o f a s p e c i f ic t y p e a n d c o n t a in s
r e q u i r e d r i g h t s . T h i s i s p a r t i c u l a r l y
i m p o r t a n t i n s p e c i f y i n g p r o c e d u r e " f o r m a l s ".
3)
R i g h t s A m p l i f i c a t i o n - G i v e n a c a p a b i l i t y f o r
a n o b j e c t o f a p a r t i c u l a r t y p e , t h e s u b s y s t e m
f o r o b j e c t s o f t h a t t y p e w i s h e s t o g a i n t h e
r i g h t s n e c e s s a r y t o m a n i p u l a t e t h e o b j e c t ' s
r e p r e s e n t a t i o n .
H y d r a p r o v i d e s a s i n g le m e c h a ni sm , t e n t p ~ t e s , w h
s e r v e s a l l t h r e e p u r p o s e s .
T e m p l a t e s , l i k e c a p a b i l i t i e s , m a y a p p e a r i n t h e C - l i s t
a n o b j e c t , a n d t h r o u g h t h e u s e o f t h e g e n e r i c o p e r a t i o
a l r e a d y d i s c u s s e d , m a y b e m o v e d f r o m t h e C - l i s t o f o n e o b j e
t o a n o t h e r . U n l i k e c a p a b i l it i e s th e y d o n o t c o n ta i n a r e f e r e n
t o a n o b j e c t . R a t h e r t h e y c a n b e th o u g h t o f as p r o t o t y p
c a p a b i l i t i e s f o r a l l o b j e c t s o f a g i v e n t y p e . T h r o u g h th e u s e
t h e g e n e r i c o p e r a t i o n T e n t p ~ t e , a temp la te o f a pa r t i cu la r t y
m a y b e c r e a t e d b y a u s e r a l re a d y h o l d i n g a c a p a b i l i t y fo r t
T Y P E o b j e c t o f t h e s a m e ty p e . T h u s , a F i l e - d i r e c t o r y T e m p l a
c o u l d o n l y b e c r e a t e d b y s o m e o n e h a v i n g a c a p a b i l i t y f o r t
F i l e - d i r e c t o r y T Y P E O b j ec t.
The re a re th ree k inds o f t emp la tes , C rea t ion Temp la te
Pa ram ete r Tem p la tes and Am p l i f i ca t ion Temp la te
c o r r e s p o n d i n g t o t h e t h r e e f u n c ti o n s d e s c r i b e d a b o ve . E a
t e m p l a t e c o n t a i n s a f i e l d d e s i g n a t i n g i t s t y p e , a n d d e p e n d i
u p o n w h i c h k i n d o f t e m p l a t e i t i s , c o n t a i n s o n e o r b o t h o f t
t w o f i e l d s r e q u i r e d - r i . g h t $ and n e w - r i g h t s .
1 4 8
8/10/2019 Cohen Protectio Hydra
9/20
1) C re a t ion Temp la tes . C rea t ion temp la tes
c o n t a i n a t y p e f i e l d a n d a n e w - r i g h t s f i e l d .
T h r o u g h t h e u s e o f t h e g e n e r i c o p e r a t i o n
CreoJ 'e , t he ho lde r o f a c rea t ion tem p la te can
c r e a t e a n e w o b j e c t w h o s e t y p e wi l l be the
same as tha t o f t he temp la te . A capab i l i t y
fo r t he n ew ob jec t w i l l be p laced in t he
c r e a t o r ' s L N $ w i t h t h e s a m e r i g h t s a s as
t h o s e s p e c i f i e d i n t h e n e w - r i g h t s f i e l d o f t h e
t e m p l a t e .
Whe n a temp la te i s in i t ia l l y c rea ted , i ts new -
r igh ts f ie ld c on ta ins a l_ l. r igh ts . Th roug h the
u s e o f g e n e r i c o p e r a t i o n s , t h e s e r i g h t s m a y
b e s e l e c t i v e l y r em o v e d. A s u b sy s t e m m ay
choos e to make c rea t ion temp la tes gen e ra l l y
a v a i l a b l e a f t e r f i r s t r e m o v i n g t h o s e r i g h t s
f r o m n e w - r i g h t s t h a t w o u l d p e r m i t d i r e c t
access o f t he ob jec t (e .g . STORTS, PUTRTS,
e tc . ) . Thus , wh i le a use r cou ld c rea te a new
ob jec t , he s t i l l wou ld be unab le to man ipu la te
i t s r e p r e s e n t a t i o n w i t h o u t c a l l i n g s u b s y s t e m
p r o c e d u r e s .
O f t e n , w h e n a n o b j e c t i s n e w l y c r e a t e d , a
s u b s y s t e m w i s h e s t o i n i t ia l i z e it i n s o m e w a y .
In t ha t case , t he subsys tem m igh t no t choose
to make c rea t ion temp la tes gene ra l l y
ava i lab le . I t m igh t s imp ly re ta in a c rea t ion
t e m p l a t e i t s e l f a n d m a k e a p ro c e d u r e
ava i lab le to use rs , wh ich when ca l led , wou ld
bo th c re a te and in i t ia l i ze the ob jec t ,
r e t u r n i n g a c a p a b i l i t y w i t h a p p r o p r i a te l y
r e s t r i c t e d r i g h t s t o t h e c a l le r . ( A l s o s e e
sec t ion 3 .6 ) .
2 ) Para mete r Temp la tes . Pa ram ete r t emp la tes
c o n t a i n a t y p e f i e l d a n d a r e q u i r e d - r i g h t s
f ie ld . Th ey can be compared aga ins t a
c a p a b i l i t y t o d e t e r m i n e w h e t h e r o r n o t t h a t
c a p a b i l i t y i s o f t h e s a m e t y p e and has at
e a s t t h o s e r i g h t s l i s t e d i n t h e r e q u i r e d -
r igh ts f ie ld o f t he temp la te . (He re, Hyd ra
g o e s b e y o n d t y p e check ing g e n e r a l l y f o u n d
in p rog ramming languages in t ha t i t checks
r igh ts as we l l as t ype . ) I t i s expec ted tha t a
S U b S y st em w i l l m a k e t h e s e t e m p l a t e s
ge ne ra l l y ava i lab le to use rs . 10
3 ) Am p l i f i ca t io n Temp la tes. Am p l i f i ca t ion
t e m p l a t e s c o n t a i n a t y p e f i e l d , a r e q u i r e d -
r i g h t s f i e l d a n d a n e w - r i g h t s f i e ld . G i v e n a
c a p a b i l i t y o f t h e s a m e t y p e a s th e t e m p l a te ,
w i t h a l l t h e r i g h t s s p e c i f i e d i n t h e t e m p l a t e ' s
r e q u i r e d - r i g h t s l i s t , a n e w c a p a b i l i t y c a n b e
p r o d u c e d , r e f e r e n c i n g t h e s a m e o b j e c t a s t h e
o r i g i n a l c a p a b i l i t y , b u t c o n t a i n i n g t h e r i g h t s
s p e c i f i e d i n t h e n e w - r i g h t s f i e l d o f t h e
temp la te . I t is expe c ted tha t amp l i fi ca t ion
t e m p l at e s w i l l n e v e r b e m a d e g e n e r a l ly
ava i lab le by a subsystem. In pa r t i cu la r ,
a m p l i f i c a t i o n t e m p l a t e s f o r k e r n e l - s u p p o r t e d
t y p e s ( P r o c e s s , L N S , e t c .) a r e n e v e r m a d e
ava i lab le .
10 . A spe c ia l k ind o f pa ramete r t emp late , a Nu l l
Tem p la te , is made ava i lab le by the ke rne l . I t ma tches
~ n Y t y p e a n d o n l y c h e c k s r ig h t s .
2 ,1 2 The Hydra Proce dure Ca l l Me chan ism
W e h a v e d i s c u s s e d i n a g e n e r a l w a y t h e e f f e c t s o f a
p r o c e d u r e c a l l. N o w t h a t w e h a v e e x p l a i n e d t em p l at es , w e c an
d isc uss in m ore de ta i l t he he a r t o f t he Ca ll Mechan ism, the
in i t ia l i za t ion o f t he LNS 's C - l i s t . The CoJ/ . ope ra t ion i s a k -ca l l
h a v i n g t h e f o l l o w i n g f o rm :
Col.l. ( c pro c, retcu'n.-$Lot, p J, rn.oJkl, . .. pn., rn.oJkn )
T h e f i r s t p a r a m e t e r , cproc, must be (a pa th to ) a
c a p a b i l i t y f o r a H y d r a p r o c e d u r e o b je c t . T h e s e co n d
par am ete r , re tu . r rL -s~ t , is an index in to the cu r ren t LNS ( the
c a l l i n g L N $ ) i n d i c a t i n g w h e r e t h e c a l l e d p r o c e d u r e s h o u ld s to r e
the ca pa b i l i t y i t re tu rns . The res t o f t he pa ramete rs to Co ../.
a r e g r o u p e d i n p a i r s . E a c h p a i r c o n s is t s o f a p a t h t o a
c a p a b i l i t y a n d a m a s k u s e d t o r e s t r ic t t h e r i g h t s i n t h e
c a p a b i l i t y p a s se d .
E a c h c a p a b i l i t y ( a n d c r e a t i o n t e m p l a t e ) i n t h e
p r o c e d u r e ' s C - l i s t i s t h e n c o p i e d i n t o t h e c o r r e s p o n d i n g s l o t o f
t h e L N S 's C - l i s t . T h e s e a r e t h e p r o c e d u r e " o w n s " a nd a re sa i d
t o b e i n h e r i t e d f r o m t h e p r o c e d u r e .
A n u m b e r o f s l o t s i n t h e p r o c e d u r e ' s C - l i s t w i l l c o n t a i n
am p l i f i ca t ion and pa rame te r t emp la tes . The capab i l i t i es passed
a s a r g u m e n t s t o t h e p r o c e d u r e a r e b o u n d t o t h e s e t e m p l a t e s
i n l e f t t o r i g h t o r d e r . E a c h L N S s l o t c o r r e s p o n d i n g t o a n
a m p l i f i c a t i o n o r p a r a m e t e r t e m p l a t e i s f i l l e d b y t h e m a t c h i n g
c a p a b i l i t y p a s s e d a s a n a r g u m e n t .
I f a p a r a m e t e r t e m p l a t e i s e n c o u n t e r e d in t h e p a r a m e t er
b i n d i n g p r o c e s s , t h e m a t c h i n g a r g u m e n t c a p a b i l i t y ( w i t h r i g h t s
res t r i c ted as spec i f ied by i t s assoc ia ted mask) i s compared
aga ins t t he tem p la te . I f bo th t ype and r igh ts ma tch as
r e q u i r e d , t h e c a p a b i l i t y , w i t h r i g h t s r e s t r i c te d a c c o rd in g t o th e
asso c ia ted mask , i s p laced in the app rop r ia te C - l i s t s lo t. I n t he
case o f an am p l i f i ca t ion temp la te , t he sam e a lgo r i t hm is used ,
e x c e p t t h a t t h e c a p a b i l i t y p l a c e d in t h e LN S w i l l h a v e t h e
r i g h t s s p e c i f i e d b y t h e n e w - r i g h t s f ie l d o f th e te m p la te . I f t h e
t y p e o r r i g h t s o f a n y a r g u m e n t f a i l s t o m e e t t h e r e q u i r e m e n t s
o f t h e t e m p l a t e , t h e L N S i s d e s t r o y e d a n d c o n t r o l r e t u r n s to
t h e c a l l e r w i t h a n i n d i c a t i o n th a t t h e C a l l f a il e d .
2 . 1 3 A n E x a m p le
W e h a v e n o t e d t h a t f i l e s a r e n o t a k e r n e l s u p p o r t e d
t y p e . I n s t e a d t h e y m u s t b e p r o v i d e d t h r o u g h a u s e r d e f i n e d
F i le subsy s tem . In one poss ib le imp lemen ta t ion , a sbbsys tem
mig h t hav e so le access to a d isk (o f t ype Dev ice ). I t cou ld
m a k e f i l e o b j e c t s a v a i l a b l e w h o s e D a t a - p a r t w o u l d c o n t a in th e
l o c a t i o n o n t h e d i s k w h e r e t h e f i l e c o u ld b e f o u n d . O f c o u r s e ,
t h e D a t a - p a r t c o u l d o n l y b e a c c es s ed b y t h e F i le s u b s y s t e m
pro ced u re s . Th is i s s im i la r , in f ac t , t o Hyd ra 's imp leme n ta t ion
o f k e r n e l - s u p p o r t e d P a ge ob j ec t s.
A l t e r n a t e l y , f i l e s c o u l d b e c o n s t r u c t e d d i r e c t l y f r o m
k e r n e l - s u p p o r t e d o b j e c t s . T h e C - l i s t o f a f i le o b j e c t m i g h t
t h e n c o n t a i n c a p a b i l i t i e s f o r P a g e o r D a ta ob j e c ts . W e w i l l
b r i e f l y e x p l o r e t h e l a t t e r a l t e r n a t iv e b y e x a m i n i n g t h e
c o n s t r u c t i o n a n d i n s t a n t i a t i o n o f D a t a f i le - A p p e n d , a p r o c e d u r e
s u p p l i e d b y a D a ta f il e s u b s y s t e m .
Data f i le -Append takes two a rgumen ts , a Da ta f i le and a
Da ta o b jec t , and appends the da ta encapsu la ted in t he Da ta
o b j e c t o n t o t h e e n d o f t h e D a t a fi le . T h e c r e a t o r o f t h e D a ta f i le
s u b s y s t e m m u s t s t o r e t h r e e t h i n g s i n i n th e C - l i s t o f t h e
D a t a f i l e - A p p e n d p r o c e d u r e w h e n h e c r e at e s i t.
149
8/10/2019 Cohen Protectio Hydra
10/20
3 )
A Da ta f i le am p l i f i ca t ion temp la te. The ne w-
r igh ts f ie ld o f t he temp la te con ta ins those
r i g h t s n e c e s s a r y s o t h a t t h e p r o c e d u r e c a n
m a n i p u l a t e t h e r e p r e s e n t a t i o n o f t h e D a t a f i l e
passed to i t . I n add i tion , t he temp la te
req u i re s the Da ta f i le passed to i t have the
s e c o n d a u x i l i a r y r i g h t s e t .
I n
essence, th is
means tha t t he second aux i l i a ry r igh t i s
i n t e r p r e t e d a s a n " a p p e n d - r i g h t " f o r D a t a f i l e
o b j e c t s ; i t p e r m i t s a D a t a f i l e c a p a b i l i t y t o b e
used as an a rgumen t t o Da ta f i le -Append .
~Jser
(Lt~S)
t - L O A D R T S
s - STORYS
- GETRTS r - PR.EADRTS
x~
- APPe~td~tsrzg p- - pL~RTS k - K I L L R T S
Figu re 2 .3
F i g u r e 2 . 3 i l l u s t r a t e s w h a t h a p p en s w h e n D a t a f i l e -
A p p e n d i s c a l le d b y U s e r ( o f t y p e L N S ) w i t h a r g u m e n t s A r g ( o f
t y p e D A T A ) a n d D ( o f
t y p e
DATAF]LE) ins tan t ia t ing the LNS,
D a t a f i l e - A p p e n d ' . T h e C - l i s t s l o t s i n t h e p ro c e d u r e s p e c i f y i n g
t h e D a t a a n d D a t a f i l e t e m p l a t e s h a v e b e e n r e p l a c e d i n t h e L N S
b y t h e c o r r e s p o n d i n g a r g u m e n t s , w h i l e th e c a p a b i l it y f o r t h e
c o d e p a g e i n t h e p r o c e d u r e h a s b e e n i n h e r i t e d b y t h e L N S .
2 .1 4 Protect ion M echanisms and Protect ion Problems
T h e m e c h a n i s m s o f p r o c e d u r e i n v o c a t i o n a n d r i g h t s
a m p l i f i c a t i o n c o m b i n e t o f o r m a p o w e r f u l t o o l f o r t h e
c o n s t r u c t i o n o f a r b i t r a r y p r o t e c t i o n p o li c ie s . I f d i r e c t ac c es s
t o a n o b j e c t c a n b e p r e v e n t e d e x c e p t t h r o u g h a p r o c e d u r e
c a l l , t h e n t h e p r o c e d u r e c a n d e ci d e w h e n a c c e s s s h o u l d b e
p e r m i t t e d . I n g e n e r a l , w h e r e m e c h an is m s d o n ot e x i s t t o
d i r e c t l y s o l v e a p r o t e c t i o n p r o b l e m , p r o c e d u r e s c an b e us e d i n
c o n s t r u c t i n g a s o l u t i o n . T h u s , t h e r e a r e t w o w a y s t h a t
p r o t e c t i o n p r o b l e m s c a n b e s o l v e d :
1)
D i r e c t S o l u t io n . T h e m e c h a n i s m d i r e c t l y
so lve s the p rob lem. Fo r examp le, a
mechan ism tha t p rov ides sepa ra te r igh ts f o r
read and w r i t e access to a f i l e , on a use r by
u s e r b a s i s , d i r e c t l y s o l v e s t h e p r o b l e m o f
f i n d i n g a w a y t o a l l o w s o m e u s e r s t o r e a d a
f i l e w h i l e p e r m i t t i n g o t h e r s t o b o t h r e a d a n d
w r i t e i t .
2 )
Proc edura l Embedd ing . The mechan ism
m e r e l y p r o v i d e s a n a p p r o p r i a t e p r o t e c t e d
e n v i r o n m e n t f o r c o d e w h i c h im p le m e n ts t h e
s o l u t i o n t o t h e p r o b le m . P r o c e d u r e s in H y dr a
p ro v id e jus t such an env i ronm en t . Imag ine a
p r o c e d u r e t o w h i c h a u s e r co u l d pa s s a f i l e
a n d a s e t o f " k e y s " ( c a p a b i l i t i e s f o r t y p e k e y
o b j e c t s ) a s a r g u m e n t s , w h i c h t h e p r o c e d u r e
w o u l d s t o r e i n i t s " o w n " a r e a. S u b s e q u e n t
c a l l e r s o f t h i s p r o c e d u r e w o u l d b e p e r m i t t e d
a c c e s s t o t h e f i l e o n l y i f t h e y p r e s e n t e d o n e
o f t he des igna ted keys . Th is k ind o f
a r ran gem en t co u ld be used to imp lemen t lock
a n d ke y p r o t e c t i o n [ L a i n 6 9 ] o r t h e M i l i t a r y
C l e a r a n c e C l a s s i fi c a t io n s y s t e m
[Wei69,Wa174~
P r o c e d u r a l e m b e d d i n g h a s o t h e r p o s s i b i l i t i e s a s w e
I m a g i n e a l m o s t a n y c o m m o n p r o t e c t i o n p r o b l e m r e l a t i n g
u s a g e o f a n o t h e r u s e r ' s p r o g r a m . ( F o r ex a m p le , c o n s i d e r
u s e r w h o r e q u i r e s a g u a r a n t e e t h a t a p r o c e d u r e g i v e n a cc e
t o a f i l e w i l l n o t d e s t r o y t h e f i le - e s p e c i a l l y i m p o r t a n t o n
s y s t e m t h a t , u n l i k e H y d r a , d o e s n o t p r o v i d e s e p a r a t e r i g h t s f o
r e a d a n d w r i t e a c ce s s. ) L e t u s s u p p os e th a t s o m e v e r
t r u s t w o r t h y ( a n d v e r y b r i g h t ) p ro gr am m e r c o n s t ru c t s
p r o c e d u r e w h i c h a c c e p t s s o u r c e p ro g r a m s w r i t t e n i n a s p e c
l a n g u a g e t h a t m a k es i t e a s y ( w e l l. . g e n e r a l l y p o s s i b le )
d e c i d e w h e t h e r t h e p r o g r am e x h i b i ts c e rt a in r e p u g n a
b e h a v i o r ( e .g . w o u l d i t d e s t r o y a f i l e pa s se d t o i t a s a
a r g u m e n t ? ) . T h i s
v e r y
t r u s t w o r t h y p r o c e d ur e w o u l d c o m p
t h e p r o g r a m s ( i n t o H y d r a P r o c e d u r e s ) a n d w o u l d s t o r e t h e
a w a y w i t h t h e i r r e p u g n a n c e r a t i n g s .
S u b s e q u e n t c a l l e r s o f t h i s v e r y t r u s t w o r t h y p r o c e d u
c o u l d r e t r i e v e p r o c e d u r e s a l o n g w i t h t h e i r r e p u g n a n c e r a t in g
U s i n g t h e r e p u g n a n c e i nf or m a ti on ~ u s e r s c o u l d d e d u c
s p e c i f i c a t i o n s o f t h e p r o g r a m ' s b e h a v i o r .
B o t h t h e " d i r e c t " s o l u t i o n s a n d t h e " p r o c e d u r
em be dd in g " so lu t ions tha t w e ha ve descr ibed a re d :ynx~rn./ .c
t h e s e n s e t h a t t h e y r e q u i r e o v e r h e a d d u r i n g t h e e x e c u t io n
p r o g r a m s . W e c o u l d c o n s id e r , h o w e v e r , g o i n g o n e s t e p f u r t h e
t o s t a t i c a l l y d e t e r m i n e d p r o t e c t i o n b y c o m p l e te c e r t i f ic a t i o n
p r o g r a m s . I f u s e r s c a n v e r i f y , in ad v an c e, t h a t p ro c e d u r e
t h e y i n t e r a c t w i t h e x h i b i t o n l y u n o b j e c t i o n a b l e b e h a v i o
p r e s u m a b l y t h e r e w o u l d b e n o n e e d t o s u p p l y a n y d y n a m
p r o t e c t i o n m e c h an is m s . ( A l t h o u g h i t i s n o t c le a r , o f c o u r s
h o w a u s e r c o u l d k n o w , i n a d v a n c e , o f a l l p r o c e d u r e s w i
w h i c h i t m i g h t i n t e r a c t . ) C e r t i f i c a t i o n i s s t i l l a n a r t , a n d o n
w o u l d n o t w a n t t o r e l y u p o n i t a s t h e a n s w e r t o p r o t e c t i o n
a c u r r e n t s y s t e m . F u r t h e r , c e r t i f i c a t io n r e q u i re s a l a n g u a
( o r s e t o f l a n g u a g e s ) i n w h i c h p r o t e c t i o n q u e s t i o n s a
d e c i d a b l e . W e d i d n o t w a n t t o r e s t r i c t o u r s e l v e s t o s uc h
l a n g u a g e , e s p e c i a l l y s i n c e n o s u c h l a n g u a g e i s p r e s e n t
a v a i l a b l e .
C e r t i f i c a t i o n , a s a s t a t i c p r o c e s s , i d e a l l y n e e d o n l y b
p e r f o r m e d o n c e , w h e r e a s H y d r a ' s d y na m ic p r o t e c t i o
n e c e s s i t a t e s a c o n t i n u i n g o v e r h e a d . B u t p r o g ra m s a r e n
a l w a y s c o r r e c t o r c o m p l e t e , e v e n w h e n th e i r p r o t e c t io
p r o p e r t i e s h a v e b e e n c
Top Related