From: Blaisorblade <bla...@ya...> - 2005-09-28 12:01:15
|
On Tuesday 27 September 2005 19:28, Jeff Dike wrote: > On Tue, Sep 27, 2005 at 10:06:53AM -0400, Young Koh wrote: > > my question is, if so, shouldn't the error be caught when UML kernel > > translates the user space address to the kernel space address? i mean, > > UML kernel must know the valid memory regions and if the address is > > out of the valid regions, then it knows the address is invalid before > > UML tries to access the address. why should it use sigsetjmp() and let > > a segfault occur? > > Because the address may be fine, and an access may still cause a segfault. > > UML memory is backed by a file on the host. You can map anything from > the file you want, but if you access it when the host filesystem is full > or you've exceeded your disk quota, the access will segfault. That wasn't the original reason - this is fine too, but as I explained in the other mail, cat /dev/kmem will cause a copy_to_user() with invalid kernel ("from") address. I remember because I discussed this with you at length. -- Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!". Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894) http://www.user-mode-linux.org/~blaisorblade ___________________________________ Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB http://mail.yahoo.it |