home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / amiga / programm / 15882 < prev    next >
Encoding:
Internet Message Format  |  1992-11-15  |  2.8 KB

  1. Path: sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!cs.utexas.edu!sun-barr!decwrl!hal.com!darkstar.UCSC.EDU!cats.ucsc.edu!davids
  2. From: davids@cats.ucsc.edu (Dave Schreiber)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: physical memory protection with MMU
  5. Date: 16 Nov 1992 03:37:53 GMT
  6. Organization: University of California; Santa Cruz
  7. Lines: 45
  8. Message-ID: <1e752hINNk3h@darkstar.UCSC.EDU>
  9. References: <1duvk4INN65q@darkstar.UCSC.EDU> <paulk.27ok@terapin.com>
  10. NNTP-Posting-Host: as215-ws-17.ucsc.edu
  11.  
  12.  
  13. In article <paulk.27ok@terapin.com> paulk@terapin.com (Paul Kienitz) writes:
  14. [Somewhere, I wrote:]
  15. >> The real problem with memory protection on the Amiga is that it is
  16. >> possible for one task to share its memory with another without
  17. >> explicitly telling the OS that the shared memory is in fact shared.
  18. >> This is a big nono under a protected OS.  However, it is an
  19. >> exaggeration to say that 99.9% of Amiga programs do this.
  20. >Almost every program shares memory -- any time you do IO at either
  21. >the dos or exec level, any time you listen to IDCMP events, or look
  22. >at any system list, you're sharing memory between tasks.
  23. >But of course, we ALWAYS remember to use MEMF_PUBLIC in those cases,
  24. >right?
  25.  
  26. Intuition allocates the memory used in IDCMP messages.  If it doesn't use
  27. MEMF_PUBLIC for that memory now, it will by the time Exec implements 
  28. protected memory.  In any case, it isn't an application issue. 
  29.  
  30. Now, as for I/O, I'm assuming that you're referring to the buffer that
  31. holds the data to be transferred.  In that case, what does the device
  32. driver receive eventually?  A structure of a known length with a pointer
  33. (in a known place in the structure) to a memory buffer that is also of a
  34. known length.  In short, the device driver knows exactly what memory it
  35. will need to access, so it should be possible to include an OS call that 
  36. would allow the driver to check to see if the memory it has received is
  37. MEMF_PUBLIC.  If not, give the driver another call that will make it sharable.
  38. This could blow system security out the window, of course, but for the
  39. moment it seems that most people want memory protection to stop errant
  40. programs, not malicious ones.
  41.  
  42. The real problem stems for two (or more) tasks that pass their own
  43. privately defined structures around.  If a structure like that contains
  44. a pointer to memory that needs to be declared shared, Exec will never know
  45. and won't be able to pull off the protections-changing trick, and the
  46. receiving program will generate a protection violation and be terminated.
  47.  
  48. As for system lists, make them (and the things they point to) publically
  49. readable but not writable, or make them readable and writable after
  50. the calling process performs the appropriate Lock*() call.
  51.  
  52.  
  53. -- 
  54. Dave Schreiber  "Look.  Don't touch."  davids@cats.ucsc.edu (until 6/20/93)
  55.