[haiku-bugs] Re: [Haiku] #5118: Haiku panics on HDA sound card

  • From: "bonefish" <trac@xxxxxxxxxxxx>
  • Date: Sun, 13 Dec 2009 22:09:37 -0000

#5118: Haiku panics on HDA sound card
---------------------------+------------------------------------------------
 Reporter:  flaggy         |       Owner:  nobody        
     Type:  bug            |      Status:  new           
 Priority:  normal         |   Milestone:  Unscheduled   
Component:  Audio & Video  |     Version:  R1/Development
 Keywords:                 |   Blockedby:                
 Platform:  x86            |    Blocking:                
---------------------------+------------------------------------------------

Comment(by bonefish):

 Replying to [comment:4 stippi]:
 > I may have been looking at the wrong ioctl(), but how can a driver copy
 something to a pointer that points to memory in the user land process? The
 same address will point to completely unrelated kernel memory from the
 driver's point of view, no?

 No, the virtual address space is split. One part (on x86 currently the
 upper half) is used for the kernel, the other one for userland teams. The
 kernel part is fixed and always visible, the userland part switches with
 the running thread. When a userland thread enters the kernel, the userland
 address space for the respective team is visible and can be accessed as
 usual. It *should* be accessed via user_memcpy() and friends only, though,
 because those functions can deal with invalid addresses (e.g. null
 pointers) passed from userland. They will simply return an error instead
 of crashing the kernel.

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/5118#comment:6>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: