On Saturday 18 June 2005 21:03, Adam Jackson wrote:
> On Saturday 18 June 2005 11:20, Jon Smirl wrote:
> > Access to the registers is something that should require root priv
> > right? Once I can get to the registers I can program them to contol
> > the DMA hardware and then muck with the kernel's memory and escalate
> > my priveldge level. EGL avoids this possible hole by not using the
> > registers from user space.
> 
> Not all register access should require root.  In fact you want to do as 
much 
> as possible directly from userspace because shuffling large amounts of 
data 
> into the kernel is painful.  So what you need to restrict are those 
registers 
> which can trigger reads and writes from arbitrary system memory bypassing 
the 
> MMU, which basically means anything that can trigger bus-master writes or 
> DMA.
> 
> The point to notice here is that these registers generally segmented apart 
in 
> the card's memory map.  If all those trigger regs are within a single 4k 
> range, then that's the only range you need to hide from userspace.

I don't see any reason for mapping registers into userspace in the first 
place. Except for mode setting and related setup tasks (which aren't 
exactly performance critical), you'll never want to write to registers 
directly but go through a DMA'd command stream. 

Okay, there may be ancient hardware that doesn't support that mode of 
operation. But why not get rid of register maps completely for everything 
else?

cu,
Nicolai

Attachment: pgphGMxZv7NKH.pgp
Description: PGP signature

Reply via email to