SlideShare una empresa de Scribd logo
1 de 29
Descargar para leer sin conexión
KMux:	
  Kernel	
  Extension	
  at	
  the	
  
    Hardware	
  Interface	
  

                   Tareque	
  Hossain	
  
          The	
  George	
  Washington	
  University	
  
           Department	
  of	
  Computer	
  Science	
  
                      April	
  27,	
  2011	
  

                               	
  
       Directed	
  by:	
  Dr.	
  Gabriel	
  Parmer	
  
Motivation	
  &	
  Background	
  
•  Most	
  commercial	
  operating	
  systems	
  are:	
  
        –  Monolithic	
  
        –  General	
  purpose	
  
•  Kernel	
  interfaces:	
  
        –  Tightly	
  coupled	
  into	
  the	
  kernel	
  code	
  
        –  Lack	
  customizability/extensibility	
  
        –  Generalized	
  to	
  accommodate	
  wide	
  array	
  of	
  services	
  
        –  InefRicient	
  for	
  speciRic	
  needs	
  
            •  a	
  system	
  that	
  only	
  runs	
  a	
  web	
  server	
  
•  Kernel	
  interfaces	
  should	
  be:	
  
        –  Decoupled	
  &	
  easily	
  conRigurable	
  
        –  Easily	
  enhanced,	
  extended	
  or	
  replaced	
  
2	
  
Motivation	
  

                         Extensions	
               •  Desired	
  state	
  
                                                        –  Browser	
  is	
  in	
  control	
  




                   Kernel	
  




•  Present	
  state	
  
        –  Browser	
  and	
  plugins	
  
           independently	
  talk	
  to	
  
           kernel	
                                                  Kernel	
  

3	
  
Introducing	
  KMux	
  
•  KMux	
  =	
  Kernel	
  Multiplexer	
  
        –  Controls	
  user	
  &	
  kernel	
  space	
  communication	
  
        –  Input:	
  	
                                                                      kernels	
  

             •  User-­‐level	
  system	
  call	
  service	
  requests	
           KMux	
  
        –  Output	
  path:	
  
                                                                      system	
  calls	
  
            •  Lightweight	
  &	
  efRicient	
  kernels	
  (yes!)	
  
            •  Implement,	
  extend,	
  enhance,	
  or	
  restrict	
  kernel	
  interfaces	
  
            •  Subkernels	
  
•  Challenges:	
  (details	
  after	
  diagram)	
  
        –  Control	
  user	
  –	
  kernel	
  communication	
  w/o	
  introducing	
  
           signiRicant	
  overhead	
  	
  
        –  Implement	
  conRigurable	
  sequence	
  of	
  subkernels	
  to	
  process	
  
           user	
  requests	
  
        –  KMux	
  &	
  subkernel	
  conRiguration	
  from	
  user	
  space	
  
4	
  
KMux	
  Overview	
  
                                   User	
  Process	
  1	
                            User	
  Process	
  2	
  

        User	
  Space	
  


                                                                   KMux	
  




              Subkernel	
  1	
                Subkernel	
  2	
                 Subkernel	
  3	
  




                                                              Host	
  Kernel	
  

                                                                                                            Kernel	
  Space	
  
5	
  
Implementation:	
  Extension	
  at	
  H/W	
  Interface	
  
•  How	
  to	
  intercept	
  system	
  calls?	
  Options:	
  
          –  POSIX	
  ptrace	
  	
  
                •  User	
  space	
  
                •  Unacceptable	
  overhead	
  
                •  Non-­‐portable	
  across	
  kernel	
  versions	
  (latest	
  standard	
  in	
  2008)	
  
          –  Kernel	
  ModiRication	
  
                •  Non-­‐portable	
  (kernel	
  interfaces	
  in	
  Rlux)	
  
                •  Complicated	
  development	
  
                •  Acceptance	
  into	
  “mainline”	
  -­‐	
  large	
  barrier	
  
          –  New:	
  Override	
  at	
  the	
  hardware	
  interface	
  
                •  Change	
  hardware-­‐deRined	
  kernel	
  entry	
  points!	
  
                      –  Change	
  the	
  default	
  system	
  call	
  hander	
  
                           »  DeRined	
  in	
  special-­‐purpose	
  registers	
  
                •  Extremely	
  fast	
  
                •  x86	
  interfaces	
  are	
  stable	
  
6	
  
Implementation:	
  Multiplexing	
  
  •  Kernel	
  entry	
  point	
  overridden	
  to	
  point	
  to	
  KMux	
  
     routine	
  
        –  Invoked	
  every	
  time	
  a	
  system	
  call	
  is	
  executed	
  
        –  General	
  purpose	
  registers	
  saved	
  
        –  KMux	
  system	
  call	
  handler	
  invoked	
  
  •  Different	
  system	
  calls	
  come	
  from	
  different	
  processes	
  
        –  With	
  different	
  contexts	
  
             •    Is	
  this	
  request	
  from	
  a	
  browser	
  extension?	
  
             •    Or	
  the	
  browser	
  itself	
  
             •    Or	
  a	
  third	
  party	
  application	
  
             •    Or	
  on	
  a	
  speci1ic	
  CPU?!	
  
  •  KMux	
  handler	
  analyzes	
  the	
  context	
  	
  
  •  Delegates	
  control	
  to	
  appropriate	
  subkernel	
  
  •  Speci1ic	
  subkernels	
  handle	
  requests	
  for	
  speci1ic	
  apps!	
  
7	
  
Multiplexing	
  Overview	
  
                     any	
  call	
  from	
  
                  process	
  2	
  on	
  CPU	
  1	
          process	
  3	
  -­‐	
  clone	
  



          process	
  1	
  -­‐	
  creat	
  


                                                                                                    Subkernel	
  
                                                                                                     Registry	
  



                                                                                                        Process	
  
                                                                                                        Registry	
  



                                                                                                          CPU	
  
                                                                                                        Registry	
  



        Rilesystem	
  Rilter	
                                             process	
  replication	
  
            subkernel	
                                                        subkernel	
  


                                             sandbox	
  subkernel	
  
8	
  
Implementation:	
  Subkernels	
  
•  Host	
  kernel	
  from	
  which	
  KMux	
  assumes	
  control	
  
   becomes	
  the	
  Rirst	
  subkernel	
  
        –  Boot	
  into	
  Linux,	
  then	
  activate	
  KMux	
  &	
  other	
  subkernels	
  
•  Ranges	
  from	
  simple	
  system	
  call	
  Rilters	
  to	
  self-­‐
   sufRicient	
  kernels	
  	
  
        –  System	
  can	
  run	
  many	
  kernels	
  concurrently	
  
•  Registers	
  themselves	
  with	
  KMux	
  on	
  initialization	
  
•  Examples:	
  Process	
  creation	
  control	
  kernel	
  
        –  Monitors	
  process	
  creation	
  and	
  termination	
  
        –  Simply	
  monitor	
  these	
  calls,	
  or…	
  
        –  Prevent	
  processes	
  from	
  creating	
  new	
  process	
  
9	
  
Subkernel	
  Chaining	
  

         ls	
  –al	
  |	
  grep	
  kmux	
  |	
  less	
  




10	
  
Creating	
  Subkernel/App	
  Mapping	
  
                                                                             Kernel	
         User	
  
                         register(‘Rilesys_Rilter’,	
  
                         &syscall_handler,	
  
                         &conRig_handler)	
                register	
  
      init	
                                              subkernel	
                                                        register	
  
                                                                                                                             process	
  
                                                                           subkernel	
  
                                                r’)	
     unregister	
      registry	
  
                       unregister(‘Rilesys_Rilte          subkernel	
  
      exit	
  
                                                                                                                            unregister	
  
                                                           register	
       process	
                                        process	
  
                                                           process	
        registry	
  
    conRig	
  
   handler	
  
                                                          unregister	
  
                                                           process	
  
                                                                                                                            conRigure	
  
   syscall	
                                                                                                                subkernel	
  
   handler	
                                              conRigure	
         proc	
                             _id,	
  
                                                          subkernel	
                                      ernel
                                                                                                   ure(k
                                                                                           con0ig _id,	
  
                                                                                                  ss             ath)	
  
Rilesys-­‐Rilter	
                                                                          proce rectory_p
                                                                                                  di                        kmux	
  user	
  
 subkernel	
  
                                                           syscall	
                         root_
                                                           handler	
                                                         library	
  
                                                                           KMux	
  

 11	
  
Accepting/Rejecting	
  a	
  System	
  Call	
  
                                                                                        Kernel	
  Space	
  
              Browser:	
  
             privileged	
  
              process	
                                                                                  syscall	
  	
                                syscall	
  	
  
                                                                 2                                       handler	
                                    handler	
  
                                                               register(pid,	
  
 1                                                KMux	
       Rilesys_Rilter)	
  
                                                  User	
       con0igure                              Rilesys	
  Rilter	
                         host	
  
pid	
  =	
  fork()	
  
                                                 Library	
     (kernel_id,	
  
                                                               (pid	
  =	
  path)	
                   next	
  =	
  host/error	
  
             Extension:	
                                                                                                      5
                                                                                                4
               child	
  
              process	
                                                                   handler(regs)	
  


                                                                                                                           system	
  entry	
  routine	
  
                                     3
                                                                      system	
  
                   create(‘/tmp/test.log’)	
                            call	
  

                                                                                                              6                                                     6
                         7                                                                                                  system	
  exit	
  routine	
  
                             int	
  result	
                            syscall	
  
                                                                        return	
                                                                    kmux	
  
                                           User	
  Space	
  
      12	
  
Benchmarks	
  
•  KMux	
  overhead	
  
•  Subkernel	
  overhead	
  
•  Multiple	
  subkernel	
  overhead	
  

•  Subkernels	
  prepared:	
  
         –  Null:	
  does	
  not	
  perform	
  any	
  action	
  and	
  returns	
  to	
  KMux	
  
            immediately	
  
         –  Syscall	
  Multiplexer:	
  keeps	
  track	
  of	
  which	
  system	
  call	
  should	
  be	
  
            handled	
  by	
  which	
  subkernel	
  
         –  File	
  System	
  Filter:	
  conRines	
  Rile	
  creation	
  and	
  deletion	
  system	
  calls	
  
            from	
  a	
  registered	
  process	
  to	
  a	
  registered	
  directory	
  root	
  
         –  Sandbox:	
  allows	
  a	
  preconRigured	
  list	
  of	
  system	
  calls	
  to	
  pass	
  through	
  
            for	
  a	
  given	
  process	
  or	
  group	
  of	
  processes	
  	
  	
  

13	
  
Microbenchmarks	
  
•  LMBench	
  OS	
  only,	
  on	
  Core	
  2	
  Duo	
  1.8	
  GHz,	
  876	
  MB	
  RAM	
  
                                                  lmbench	
  



                                                                 kmux	
  



                                                                           syscallmux	
  
              1st	
  Run	
  

                                 2nd	
  Run	
  

                                                          3rd	
  Run	
                RilesysRilter	
  



                                                                                        4th	
  Run	
  
                                                    host	
  

14	
  
Basic	
  OS	
  Calls	
  
                              3.5	
  

                                 3	
  

                              2.5	
                                                                                     vanilla	
  
           microseconds	
  




                                 2	
                                                                                    kmux	
  

                              1.5	
                                                                                     kmux	
  -­‐	
  syscallmux	
  

                                 1	
                                                                                    kmux	
  -­‐	
  syscallmux	
  -­‐	
  
                                                                                                                        Rilesys_Rilter	
  
                              0.5	
  

                                 0	
  
                                         null	
  call	
      null	
  I/O	
     stat	
         open/close	
  


         call	
                                             null	
  call	
       null	
  I/O	
             stat	
                   open/close	
  
         Max	
  overhead	
                                   40.9%	
              23.9%	
                      3%	
                       6.7%	
  
15	
  
Macrobenchmark	
  

                                                                    699.748



         Compile Time (s)                                                700.264



                                                                              700.994




                            695   696    697      698     699      700     701      702   703   704   705
                                        vanilla    kmux         kmux + syscallmux



•  Linux	
  Kernel	
  v2.6.33	
  
           –  Same	
  conRiguration	
  for	
  all	
  runs	
  
           –  Maximum	
  overhead	
  0.17%	
  
16	
  
Pure	
  Subkernel	
  Chain	
  Overhead	
  
                                     2.5


                                      2
         Latency in µsec




                                     1.5


                                      1


                                     0.5


                                      0
                                                           null call                                stat
                           vanilla                         0.1467                                  2.0567
                           kmux + 2 null                   0.2133                                  2.0967
                           kmux + 4 null                   0.2133                                  2.1067
                           kmux + 8 null                   0.3433                                   2.33


                                     call	
                         null	
  call	
      stat	
  
                                     Max	
  overhead	
                 134%	
          13.2%	
  
17	
  
Self-­‐sufRicient	
  Kernel	
  -­‐	
  Composite	
  
                            700	
  
                                                                      Composite	
  w/	
  
                                                                       KMux,	
  592	
  
                            600	
  

                                        Composite,	
  493	
  
                            500	
  
          Nanoseconds	
  




                            400	
  

                            300	
  

                            200	
  

                            100	
  

                                0	
  
                                                 Latency	
  per	
  Invocation	
  


•  Only	
  15	
  lines	
  of	
  code	
  added	
  to	
  Composite	
  code,	
  mostly	
  kernel	
  
   and	
  process	
  registration/	
  deregistration	
  
•  Average	
  overhead	
  per	
  invocation	
  ~20%	
  
18	
  
Things	
  KMux	
  doesn’t	
  do	
  
•  KMux	
  does	
  not	
  provide	
  all	
  functions	
  necessary	
  for	
  
   subkernels,	
  	
  
         –  Subkernels	
  currently	
  rely	
  on	
  host	
  kernel	
  for	
  resources	
  


•  Isolation	
  of	
  subkernels	
  not	
  strictly	
  enforced	
  
         –  One	
  subkernel	
  can	
  trivially	
  crash	
  the	
  system	
  
         –  Currently	
  requires	
  “trusted”	
  subkernels	
  




19	
  
Related	
  Work	
  
•  Hijack	
  method,	
  used	
  by	
  Composite	
  component-­‐
   based	
  system	
  
•  System-­‐call	
  table	
  overriding	
  
         –  SLIC,	
  Systrace,	
  virus	
  checking	
  software	
  
•  SPIN,	
  Interposition	
  agents	
  
•  SFI,	
  XFI,	
  Vx32,	
  Native	
  Client	
  sandboxing	
  




20	
  
Conclusion	
  
•  KMux:	
  
         –  Practically	
  efRicient	
  
         –  Allows	
  multiple	
  kernels	
  in	
  the	
  system!	
  
         –  Highly	
  conRigurable	
  
         –  Works	
  with	
  commercial	
  systems	
  out	
  of	
  the	
  box	
  
         –  Allows	
  extension,	
  enhancement,	
  monitoring	
  and	
  
            even	
  complete	
  replacement	
  of	
  system	
  calls	
  
         –  Perfect	
  for	
  sandboxing	
  untrusted	
  applications!	
  




21	
  
Questions	
  
•  Source	
  available	
  at:	
  
         –  github.com/tarequeh/kmux	
  




22	
  
Future	
  
•  Get	
  multiple	
  standard	
  Linux	
  kernels	
  to	
  work	
  with	
  
   KMux	
  
•  Modify	
  Firefox/	
  Chrome	
  to	
  register	
  extension	
  
   processes	
  with	
  KMux	
  
         –  Activate	
  extension	
  sandboxing	
  
•  Implement	
  KMux	
  for	
  Windows/	
  Mac	
  OSX	
  
•  Provide	
  interfaces	
  necessary	
  for	
  subkernels	
  and	
  
   isolate	
  them	
  



23	
  
Subkernels	
  Chaining	
  
•  Upon	
  receiving	
  control	
  for	
  a	
  system	
  call,	
  a	
  
   subkernel	
  may:	
  
         –  Perform	
  necessary	
  action	
  and	
  delegate	
  to	
  another	
  
            subkernel,	
  adding	
  to	
  the	
  chain	
  	
  
         –  Return	
  control	
  to	
  host	
  kernel	
  or	
  return	
  to	
  user	
  space,	
  
            ending	
  the	
  chain	
  
•  Chaining	
  allows:	
  
         –  Decoupling	
  of	
  functionality	
  	
  
         –  Subkernels	
  to	
  utilize	
  each	
  others	
  capabilities	
  
         –  Analysis	
  from	
  multiple	
  perspective	
  before	
  a	
  system	
  call	
  
            is	
  approved	
  
         –  Optimal	
  use	
  of	
  the	
  subkernel	
  network	
  

24	
  
CPU	
  Multiplexing	
  
•  Imagine	
  600	
  processors	
  in	
  a	
  system	
  
•  Multiple	
  kernels	
  should	
  be	
  able	
  to	
  function	
  
         –  Each	
  claiming	
  a	
  number	
  of	
  CPUs	
  

•  Create	
  CPU	
  –	
  subkernel	
  mapping	
  
         –  KMux	
  provides	
  this	
  feature	
  


•  EfRicient	
  utilization	
  of	
  CPU	
  
•  Easier	
  accommodation	
  of	
  multiple	
  kernels	
  
•  Isolation	
  domains	
  

25	
  
Using	
  KMux	
  in	
  Kernel	
  Space	
  
•  KMux	
  provides	
  interface	
  at	
  kernel	
  level	
  
•  Subkernel	
  registration	
  
         –  Subkernels	
  can	
  register	
  themselves	
  with	
  KMux	
  upon	
  
            initialization	
  
         –  Subkernels	
  can	
  unregister	
  themselves,	
  and	
  KMux	
  provides	
  a	
  
            graceful	
  exit	
  path	
  
•  Subkernel	
  conRiguration	
  
         –  Subkernels	
  may	
  choose	
  to	
  accept	
  conRiguration	
  parameters	
  
         –  Upon	
  initialization	
  they	
  register	
  a	
  conRiguration	
  handler	
  with	
  
            KMux	
  
         –  Accepts	
  simple	
  character	
  string	
  containing	
  conRiguration	
  
            information	
  

26	
  
Using	
  KMux	
  in	
  User	
  Space	
  
•  KMux	
  user	
  library	
  provides	
  access	
  from	
  user	
  level	
  
•  Process	
  Binding	
  
         –  KMux	
  will	
  by	
  default	
  delegate	
  control	
  for	
  all	
  system	
  calls	
  to	
  
            the	
  host	
  kernel	
  
         –  Privileged	
  processes	
  or	
  users	
  can	
  bind	
  a	
  process	
  to	
  a	
  
            particular	
  subkernel	
  
         –  All	
  system	
  calls	
  from	
  a	
  bound	
  process	
  will	
  be	
  delegated	
  to	
  
            chosen	
  subkernel	
  
•  Subkernel	
  conRiguration	
  
         –  Privileged	
  processes	
  or	
  users	
  can	
  conRigure	
  subkernels	
  to	
  
            suit	
  their	
  needs	
  
         –  Example	
  conRigurations	
  are:	
  specifying	
  next	
  subkernel	
  in	
  
            chain	
  or	
  set	
  of	
  system	
  calls	
  to	
  analyze	
  

27	
  
File	
  System	
  Calls	
  
                                            35
                                            30
           Latency in µsec

                                            25
                                            20
                                            15
                                            10
                                             5
                                             0
                                                       create 0k         create 10k       delete 0k         delete 10k
                             vanilla                    14.867             30.767          10.367            15.333
                             kmux                       14.733             30.967          10.333            15.667
                             kmux - syscallmux          14.667              31.3           10.233              15.3
                             kmux - syscallmux -
                                                            15.767            32.1            11.5           16.767
                                filesys_filter


         call	
                              create	
  0k	
          create	
  10k	
     delete	
  0k	
     delete	
  10k	
  
         Max	
  overhead	
                         6%	
                  4.3%	
            10.9%	
              9.3%	
  
28	
  
Sandbox	
  Performance	
  
                                      3.5
                                        3
                    Latency in µsec   2.5
                                        2
                                      1.5
                                            1
                                       0.5
                                            0
                                                null call
                                                                       null I/O
                                                                                               stat
                                                                                                         open/close

                                                     null call                    null I/O              stat          open/close
               Vanilla                               0.1533                       0.2233              2.1033            2.8966
               KMux + Sandbox                        0.2366                       0.3066               2.11              3.1


         call	
                                     null	
  call	
                null	
  I/O	
         stat	
        open/close	
  
         Max	
  overhead	
                             54%	
                        37%	
                1%	
              7%	
  
29	
  

Más contenido relacionado

La actualidad más candente

Advanced processor principles
Advanced processor principlesAdvanced processor principles
Advanced processor principlesDhaval Bagal
 
AOS Lab 6: Scheduling
AOS Lab 6: SchedulingAOS Lab 6: Scheduling
AOS Lab 6: SchedulingZubair Nabi
 
Advanced computer architecture lesson 5 and 6
Advanced computer architecture lesson 5 and 6Advanced computer architecture lesson 5 and 6
Advanced computer architecture lesson 5 and 6Ismail Mukiibi
 
Kernel module programming
Kernel module programmingKernel module programming
Kernel module programmingVandana Salve
 
6 Dean Google
6 Dean Google6 Dean Google
6 Dean GoogleFrank Cai
 
Linux Module Programming
Linux Module ProgrammingLinux Module Programming
Linux Module ProgrammingAmir Payberah
 
Testing real-time Linux. What to test and how
Testing real-time Linux. What to test and how Testing real-time Linux. What to test and how
Testing real-time Linux. What to test and how Chirag Jog
 
Windows kernel and memory io subsystem
Windows kernel and memory io subsystemWindows kernel and memory io subsystem
Windows kernel and memory io subsystemSisimon Soman
 
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B KuteUnit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B KuteTushar B Kute
 
Bridging the Semantic Gap in Virtualized Environment
Bridging the Semantic Gap in Virtualized EnvironmentBridging the Semantic Gap in Virtualized Environment
Bridging the Semantic Gap in Virtualized EnvironmentAndy Lee
 
Oracle rac 10g best practices
Oracle rac 10g best practicesOracle rac 10g best practices
Oracle rac 10g best practicesHaseeb Alam
 

La actualidad más candente (20)

Daemons
DaemonsDaemons
Daemons
 
Advanced processor principles
Advanced processor principlesAdvanced processor principles
Advanced processor principles
 
운영체제론 Ch22
운영체제론 Ch22운영체제론 Ch22
운영체제론 Ch22
 
AOS Lab 6: Scheduling
AOS Lab 6: SchedulingAOS Lab 6: Scheduling
AOS Lab 6: Scheduling
 
Advanced computer architecture lesson 5 and 6
Advanced computer architecture lesson 5 and 6Advanced computer architecture lesson 5 and 6
Advanced computer architecture lesson 5 and 6
 
Vx works RTOS
Vx works RTOSVx works RTOS
Vx works RTOS
 
Kernel module programming
Kernel module programmingKernel module programming
Kernel module programming
 
6 Dean Google
6 Dean Google6 Dean Google
6 Dean Google
 
운영체제론 Ch20
운영체제론 Ch20운영체제론 Ch20
운영체제론 Ch20
 
Linux Module Programming
Linux Module ProgrammingLinux Module Programming
Linux Module Programming
 
Chen Haibo
Chen HaiboChen Haibo
Chen Haibo
 
Testing real-time Linux. What to test and how
Testing real-time Linux. What to test and how Testing real-time Linux. What to test and how
Testing real-time Linux. What to test and how
 
3 process management
3 process management3 process management
3 process management
 
Chapter03
Chapter03Chapter03
Chapter03
 
Windows kernel and memory io subsystem
Windows kernel and memory io subsystemWindows kernel and memory io subsystem
Windows kernel and memory io subsystem
 
Different types of kernels
Different types of kernelsDifferent types of kernels
Different types of kernels
 
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B KuteUnit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
 
Bridging the Semantic Gap in Virtualized Environment
Bridging the Semantic Gap in Virtualized EnvironmentBridging the Semantic Gap in Virtualized Environment
Bridging the Semantic Gap in Virtualized Environment
 
Oracle rac 10g best practices
Oracle rac 10g best practicesOracle rac 10g best practices
Oracle rac 10g best practices
 
Basic Linux kernel
Basic Linux kernelBasic Linux kernel
Basic Linux kernel
 

Similar a Introducing KMux - The Kernel Multiplexer

Scheduler activations
Scheduler activationsScheduler activations
Scheduler activationsVin Voro
 
F9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
F9: A Secure and Efficient Microkernel Built for Deeply Embedded SystemsF9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
F9: A Secure and Efficient Microkernel Built for Deeply Embedded SystemsNational Cheng Kung University
 
Advancedperformancetroubleshootingusingesxtop 101110131727-phpapp02
Advancedperformancetroubleshootingusingesxtop 101110131727-phpapp02Advancedperformancetroubleshootingusingesxtop 101110131727-phpapp02
Advancedperformancetroubleshootingusingesxtop 101110131727-phpapp02Suresh Kumar
 
Operating system 15 micro kernel based os
Operating system 15 micro kernel based osOperating system 15 micro kernel based os
Operating system 15 micro kernel based osVaibhav Khanna
 
Advanced performance troubleshooting using esxtop
Advanced performance troubleshooting using esxtopAdvanced performance troubleshooting using esxtop
Advanced performance troubleshooting using esxtopAlan Renouf
 
Os structure
Os structureOs structure
Os structureMohd Arif
 
Beneath the Linux Interrupt handling
Beneath the Linux Interrupt handlingBeneath the Linux Interrupt handling
Beneath the Linux Interrupt handlingBhoomil Chavda
 
Synchronization linux
Synchronization linuxSynchronization linux
Synchronization linuxSusant Sahani
 
XenTT: Deterministic Systems Analysis in Xen
XenTT: Deterministic Systems Analysis in XenXenTT: Deterministic Systems Analysis in Xen
XenTT: Deterministic Systems Analysis in XenThe Linux Foundation
 
Unix operating system
Unix operating systemUnix operating system
Unix operating systemABhay Panchal
 
Large Scale Computing Infrastructure - Nautilus
Large Scale Computing Infrastructure - NautilusLarge Scale Computing Infrastructure - Nautilus
Large Scale Computing Infrastructure - NautilusGabriele Di Bernardo
 
2.1 Red_Hat_Cluster1.ppt
2.1 Red_Hat_Cluster1.ppt2.1 Red_Hat_Cluster1.ppt
2.1 Red_Hat_Cluster1.pptManoj603126
 
Embedded Operating System-Kernel Features.pptx
Embedded Operating System-Kernel Features.pptxEmbedded Operating System-Kernel Features.pptx
Embedded Operating System-Kernel Features.pptxssuseradc877
 
Running Applications on the NetBSD Rump Kernel by Justin Cormack
Running Applications on the NetBSD Rump Kernel by Justin Cormack Running Applications on the NetBSD Rump Kernel by Justin Cormack
Running Applications on the NetBSD Rump Kernel by Justin Cormack eurobsdcon
 

Similar a Introducing KMux - The Kernel Multiplexer (20)

Scheduler activations
Scheduler activationsScheduler activations
Scheduler activations
 
L4 Microkernel :: Design Overview
L4 Microkernel :: Design OverviewL4 Microkernel :: Design Overview
L4 Microkernel :: Design Overview
 
F9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
F9: A Secure and Efficient Microkernel Built for Deeply Embedded SystemsF9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
F9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
 
Advancedperformancetroubleshootingusingesxtop 101110131727-phpapp02
Advancedperformancetroubleshootingusingesxtop 101110131727-phpapp02Advancedperformancetroubleshootingusingesxtop 101110131727-phpapp02
Advancedperformancetroubleshootingusingesxtop 101110131727-phpapp02
 
Xilkernel
XilkernelXilkernel
Xilkernel
 
Xen arm
Xen armXen arm
Xen arm
 
Operating system 15 micro kernel based os
Operating system 15 micro kernel based osOperating system 15 micro kernel based os
Operating system 15 micro kernel based os
 
Kernel (OS)
Kernel (OS)Kernel (OS)
Kernel (OS)
 
Advanced performance troubleshooting using esxtop
Advanced performance troubleshooting using esxtopAdvanced performance troubleshooting using esxtop
Advanced performance troubleshooting using esxtop
 
Os structure
Os structureOs structure
Os structure
 
Beneath the Linux Interrupt handling
Beneath the Linux Interrupt handlingBeneath the Linux Interrupt handling
Beneath the Linux Interrupt handling
 
Synchronization linux
Synchronization linuxSynchronization linux
Synchronization linux
 
XenTT: Deterministic Systems Analysis in Xen
XenTT: Deterministic Systems Analysis in XenXenTT: Deterministic Systems Analysis in Xen
XenTT: Deterministic Systems Analysis in Xen
 
Unix operating system
Unix operating systemUnix operating system
Unix operating system
 
Large Scale Computing Infrastructure - Nautilus
Large Scale Computing Infrastructure - NautilusLarge Scale Computing Infrastructure - Nautilus
Large Scale Computing Infrastructure - Nautilus
 
System structure
System structureSystem structure
System structure
 
OpenVZ Linux Containers
OpenVZ Linux ContainersOpenVZ Linux Containers
OpenVZ Linux Containers
 
2.1 Red_Hat_Cluster1.ppt
2.1 Red_Hat_Cluster1.ppt2.1 Red_Hat_Cluster1.ppt
2.1 Red_Hat_Cluster1.ppt
 
Embedded Operating System-Kernel Features.pptx
Embedded Operating System-Kernel Features.pptxEmbedded Operating System-Kernel Features.pptx
Embedded Operating System-Kernel Features.pptx
 
Running Applications on the NetBSD Rump Kernel by Justin Cormack
Running Applications on the NetBSD Rump Kernel by Justin Cormack Running Applications on the NetBSD Rump Kernel by Justin Cormack
Running Applications on the NetBSD Rump Kernel by Justin Cormack
 

Más de Tareque Hossain

django Forms in a Web API World
django Forms in a Web API Worlddjango Forms in a Web API World
django Forms in a Web API WorldTareque Hossain
 
RESTful APIs: Promises & lies
RESTful APIs: Promises & liesRESTful APIs: Promises & lies
RESTful APIs: Promises & liesTareque Hossain
 
API Design & Security in django
API Design & Security in djangoAPI Design & Security in django
API Design & Security in djangoTareque Hossain
 
Life in a Queue - Using Message Queue with django
Life in a Queue - Using Message Queue with djangoLife in a Queue - Using Message Queue with django
Life in a Queue - Using Message Queue with djangoTareque Hossain
 
SIGTRAN - An Introduction
SIGTRAN - An IntroductionSIGTRAN - An Introduction
SIGTRAN - An IntroductionTareque Hossain
 
Linux Composite Communication
Linux Composite CommunicationLinux Composite Communication
Linux Composite CommunicationTareque Hossain
 
Xen & the Art of Virtualization
Xen & the Art of VirtualizationXen & the Art of Virtualization
Xen & the Art of VirtualizationTareque Hossain
 
Introduction to django-config
Introduction to django-configIntroduction to django-config
Introduction to django-configTareque Hossain
 

Más de Tareque Hossain (11)

django Forms in a Web API World
django Forms in a Web API Worlddjango Forms in a Web API World
django Forms in a Web API World
 
The solr power
The solr powerThe solr power
The solr power
 
RESTful APIs: Promises & lies
RESTful APIs: Promises & liesRESTful APIs: Promises & lies
RESTful APIs: Promises & lies
 
API Design & Security in django
API Design & Security in djangoAPI Design & Security in django
API Design & Security in django
 
Life in a Queue - Using Message Queue with django
Life in a Queue - Using Message Queue with djangoLife in a Queue - Using Message Queue with django
Life in a Queue - Using Message Queue with django
 
SIGTRAN - An Introduction
SIGTRAN - An IntroductionSIGTRAN - An Introduction
SIGTRAN - An Introduction
 
Django orm-tips
Django orm-tipsDjango orm-tips
Django orm-tips
 
Linux Composite Communication
Linux Composite CommunicationLinux Composite Communication
Linux Composite Communication
 
Django Deployment
Django DeploymentDjango Deployment
Django Deployment
 
Xen & the Art of Virtualization
Xen & the Art of VirtualizationXen & the Art of Virtualization
Xen & the Art of Virtualization
 
Introduction to django-config
Introduction to django-configIntroduction to django-config
Introduction to django-config
 

Último

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 

Último (20)

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 

Introducing KMux - The Kernel Multiplexer

  • 1. KMux:  Kernel  Extension  at  the   Hardware  Interface   Tareque  Hossain   The  George  Washington  University   Department  of  Computer  Science   April  27,  2011     Directed  by:  Dr.  Gabriel  Parmer  
  • 2. Motivation  &  Background   •  Most  commercial  operating  systems  are:   –  Monolithic   –  General  purpose   •  Kernel  interfaces:   –  Tightly  coupled  into  the  kernel  code   –  Lack  customizability/extensibility   –  Generalized  to  accommodate  wide  array  of  services   –  InefRicient  for  speciRic  needs   •  a  system  that  only  runs  a  web  server   •  Kernel  interfaces  should  be:   –  Decoupled  &  easily  conRigurable   –  Easily  enhanced,  extended  or  replaced   2  
  • 3. Motivation   Extensions   •  Desired  state   –  Browser  is  in  control   Kernel   •  Present  state   –  Browser  and  plugins   independently  talk  to   kernel   Kernel   3  
  • 4. Introducing  KMux   •  KMux  =  Kernel  Multiplexer   –  Controls  user  &  kernel  space  communication   –  Input:     kernels   •  User-­‐level  system  call  service  requests   KMux   –  Output  path:   system  calls   •  Lightweight  &  efRicient  kernels  (yes!)   •  Implement,  extend,  enhance,  or  restrict  kernel  interfaces   •  Subkernels   •  Challenges:  (details  after  diagram)   –  Control  user  –  kernel  communication  w/o  introducing   signiRicant  overhead     –  Implement  conRigurable  sequence  of  subkernels  to  process   user  requests   –  KMux  &  subkernel  conRiguration  from  user  space   4  
  • 5. KMux  Overview   User  Process  1   User  Process  2   User  Space   KMux   Subkernel  1   Subkernel  2   Subkernel  3   Host  Kernel   Kernel  Space   5  
  • 6. Implementation:  Extension  at  H/W  Interface   •  How  to  intercept  system  calls?  Options:   –  POSIX  ptrace     •  User  space   •  Unacceptable  overhead   •  Non-­‐portable  across  kernel  versions  (latest  standard  in  2008)   –  Kernel  ModiRication   •  Non-­‐portable  (kernel  interfaces  in  Rlux)   •  Complicated  development   •  Acceptance  into  “mainline”  -­‐  large  barrier   –  New:  Override  at  the  hardware  interface   •  Change  hardware-­‐deRined  kernel  entry  points!   –  Change  the  default  system  call  hander   »  DeRined  in  special-­‐purpose  registers   •  Extremely  fast   •  x86  interfaces  are  stable   6  
  • 7. Implementation:  Multiplexing   •  Kernel  entry  point  overridden  to  point  to  KMux   routine   –  Invoked  every  time  a  system  call  is  executed   –  General  purpose  registers  saved   –  KMux  system  call  handler  invoked   •  Different  system  calls  come  from  different  processes   –  With  different  contexts   •  Is  this  request  from  a  browser  extension?   •  Or  the  browser  itself   •  Or  a  third  party  application   •  Or  on  a  speci1ic  CPU?!   •  KMux  handler  analyzes  the  context     •  Delegates  control  to  appropriate  subkernel   •  Speci1ic  subkernels  handle  requests  for  speci1ic  apps!   7  
  • 8. Multiplexing  Overview   any  call  from   process  2  on  CPU  1   process  3  -­‐  clone   process  1  -­‐  creat   Subkernel   Registry   Process   Registry   CPU   Registry   Rilesystem  Rilter   process  replication   subkernel   subkernel   sandbox  subkernel   8  
  • 9. Implementation:  Subkernels   •  Host  kernel  from  which  KMux  assumes  control   becomes  the  Rirst  subkernel   –  Boot  into  Linux,  then  activate  KMux  &  other  subkernels   •  Ranges  from  simple  system  call  Rilters  to  self-­‐ sufRicient  kernels     –  System  can  run  many  kernels  concurrently   •  Registers  themselves  with  KMux  on  initialization   •  Examples:  Process  creation  control  kernel   –  Monitors  process  creation  and  termination   –  Simply  monitor  these  calls,  or…   –  Prevent  processes  from  creating  new  process   9  
  • 10. Subkernel  Chaining   ls  –al  |  grep  kmux  |  less   10  
  • 11. Creating  Subkernel/App  Mapping   Kernel   User   register(‘Rilesys_Rilter’,   &syscall_handler,   &conRig_handler)   register   init   subkernel   register   process   subkernel   r’)   unregister   registry   unregister(‘Rilesys_Rilte subkernel   exit   unregister   register   process   process   process   registry   conRig   handler   unregister   process   conRigure   syscall   subkernel   handler   conRigure   proc   _id,   subkernel   ernel ure(k con0ig _id,   ss ath)   Rilesys-­‐Rilter   proce rectory_p di kmux  user   subkernel   syscall   root_ handler   library   KMux   11  
  • 12. Accepting/Rejecting  a  System  Call   Kernel  Space   Browser:   privileged   process   syscall     syscall     2 handler   handler   register(pid,   1 KMux   Rilesys_Rilter)   User   con0igure Rilesys  Rilter   host   pid  =  fork()   Library   (kernel_id,   (pid  =  path)   next  =  host/error   Extension:   5 4 child   process   handler(regs)   system  entry  routine   3 system   create(‘/tmp/test.log’)   call   6 6 7 system  exit  routine   int  result   syscall   return   kmux   User  Space   12  
  • 13. Benchmarks   •  KMux  overhead   •  Subkernel  overhead   •  Multiple  subkernel  overhead   •  Subkernels  prepared:   –  Null:  does  not  perform  any  action  and  returns  to  KMux   immediately   –  Syscall  Multiplexer:  keeps  track  of  which  system  call  should  be   handled  by  which  subkernel   –  File  System  Filter:  conRines  Rile  creation  and  deletion  system  calls   from  a  registered  process  to  a  registered  directory  root   –  Sandbox:  allows  a  preconRigured  list  of  system  calls  to  pass  through   for  a  given  process  or  group  of  processes       13  
  • 14. Microbenchmarks   •  LMBench  OS  only,  on  Core  2  Duo  1.8  GHz,  876  MB  RAM   lmbench   kmux   syscallmux   1st  Run   2nd  Run   3rd  Run   RilesysRilter   4th  Run   host   14  
  • 15. Basic  OS  Calls   3.5   3   2.5   vanilla   microseconds   2   kmux   1.5   kmux  -­‐  syscallmux   1   kmux  -­‐  syscallmux  -­‐   Rilesys_Rilter   0.5   0   null  call   null  I/O   stat   open/close   call   null  call   null  I/O   stat   open/close   Max  overhead   40.9%   23.9%   3%   6.7%   15  
  • 16. Macrobenchmark   699.748 Compile Time (s) 700.264 700.994 695 696 697 698 699 700 701 702 703 704 705 vanilla kmux kmux + syscallmux •  Linux  Kernel  v2.6.33   –  Same  conRiguration  for  all  runs   –  Maximum  overhead  0.17%   16  
  • 17. Pure  Subkernel  Chain  Overhead   2.5 2 Latency in µsec 1.5 1 0.5 0 null call stat vanilla 0.1467 2.0567 kmux + 2 null 0.2133 2.0967 kmux + 4 null 0.2133 2.1067 kmux + 8 null 0.3433 2.33 call   null  call   stat   Max  overhead   134%   13.2%   17  
  • 18. Self-­‐sufRicient  Kernel  -­‐  Composite   700   Composite  w/   KMux,  592   600   Composite,  493   500   Nanoseconds   400   300   200   100   0   Latency  per  Invocation   •  Only  15  lines  of  code  added  to  Composite  code,  mostly  kernel   and  process  registration/  deregistration   •  Average  overhead  per  invocation  ~20%   18  
  • 19. Things  KMux  doesn’t  do   •  KMux  does  not  provide  all  functions  necessary  for   subkernels,     –  Subkernels  currently  rely  on  host  kernel  for  resources   •  Isolation  of  subkernels  not  strictly  enforced   –  One  subkernel  can  trivially  crash  the  system   –  Currently  requires  “trusted”  subkernels   19  
  • 20. Related  Work   •  Hijack  method,  used  by  Composite  component-­‐ based  system   •  System-­‐call  table  overriding   –  SLIC,  Systrace,  virus  checking  software   •  SPIN,  Interposition  agents   •  SFI,  XFI,  Vx32,  Native  Client  sandboxing   20  
  • 21. Conclusion   •  KMux:   –  Practically  efRicient   –  Allows  multiple  kernels  in  the  system!   –  Highly  conRigurable   –  Works  with  commercial  systems  out  of  the  box   –  Allows  extension,  enhancement,  monitoring  and   even  complete  replacement  of  system  calls   –  Perfect  for  sandboxing  untrusted  applications!   21  
  • 22. Questions   •  Source  available  at:   –  github.com/tarequeh/kmux   22  
  • 23. Future   •  Get  multiple  standard  Linux  kernels  to  work  with   KMux   •  Modify  Firefox/  Chrome  to  register  extension   processes  with  KMux   –  Activate  extension  sandboxing   •  Implement  KMux  for  Windows/  Mac  OSX   •  Provide  interfaces  necessary  for  subkernels  and   isolate  them   23  
  • 24. Subkernels  Chaining   •  Upon  receiving  control  for  a  system  call,  a   subkernel  may:   –  Perform  necessary  action  and  delegate  to  another   subkernel,  adding  to  the  chain     –  Return  control  to  host  kernel  or  return  to  user  space,   ending  the  chain   •  Chaining  allows:   –  Decoupling  of  functionality     –  Subkernels  to  utilize  each  others  capabilities   –  Analysis  from  multiple  perspective  before  a  system  call   is  approved   –  Optimal  use  of  the  subkernel  network   24  
  • 25. CPU  Multiplexing   •  Imagine  600  processors  in  a  system   •  Multiple  kernels  should  be  able  to  function   –  Each  claiming  a  number  of  CPUs   •  Create  CPU  –  subkernel  mapping   –  KMux  provides  this  feature   •  EfRicient  utilization  of  CPU   •  Easier  accommodation  of  multiple  kernels   •  Isolation  domains   25  
  • 26. Using  KMux  in  Kernel  Space   •  KMux  provides  interface  at  kernel  level   •  Subkernel  registration   –  Subkernels  can  register  themselves  with  KMux  upon   initialization   –  Subkernels  can  unregister  themselves,  and  KMux  provides  a   graceful  exit  path   •  Subkernel  conRiguration   –  Subkernels  may  choose  to  accept  conRiguration  parameters   –  Upon  initialization  they  register  a  conRiguration  handler  with   KMux   –  Accepts  simple  character  string  containing  conRiguration   information   26  
  • 27. Using  KMux  in  User  Space   •  KMux  user  library  provides  access  from  user  level   •  Process  Binding   –  KMux  will  by  default  delegate  control  for  all  system  calls  to   the  host  kernel   –  Privileged  processes  or  users  can  bind  a  process  to  a   particular  subkernel   –  All  system  calls  from  a  bound  process  will  be  delegated  to   chosen  subkernel   •  Subkernel  conRiguration   –  Privileged  processes  or  users  can  conRigure  subkernels  to   suit  their  needs   –  Example  conRigurations  are:  specifying  next  subkernel  in   chain  or  set  of  system  calls  to  analyze   27  
  • 28. File  System  Calls   35 30 Latency in µsec 25 20 15 10 5 0 create 0k create 10k delete 0k delete 10k vanilla 14.867 30.767 10.367 15.333 kmux 14.733 30.967 10.333 15.667 kmux - syscallmux 14.667 31.3 10.233 15.3 kmux - syscallmux - 15.767 32.1 11.5 16.767 filesys_filter call   create  0k   create  10k   delete  0k   delete  10k   Max  overhead   6%   4.3%   10.9%   9.3%   28  
  • 29. Sandbox  Performance   3.5 3 Latency in µsec 2.5 2 1.5 1 0.5 0 null call null I/O stat open/close null call null I/O stat open/close Vanilla 0.1533 0.2233 2.1033 2.8966 KMux + Sandbox 0.2366 0.3066 2.11 3.1 call   null  call   null  I/O   stat   open/close   Max  overhead   54%   37%   1%   7%   29