Bogdan:
> So far, to the problem of too often access to hardware, 2 solutions were
> proposed:
> 1. cache the values. You can then let the user shoot him-/her-self in the
> foot by making too many ioctl calls. But this prevent any legit use of
> current hardware state.
> 2. rate limiting. You don't let the user access the hardware too often (to
> be defined), so he/she can't shoot his-/her-self in the foot. Legit use
> of current hardware state is possible.
Why not provide cached data for unprivileged readers and only talk to the
hardware when a process with the appropriate capability makes a request?
All you'd need to do this is the memory required to store the cached data
and a timestamp. (an unprivileged read would only update the cached data
when it had exceeded a set age; this would provide rate limiting)
You could do this entirely in user space too, just keep a daemon running
that periodically makes queries and forwards the results. (and make it
impossible for non-privileged users to ask the kernel at all)
-Chris Wing
wingc@xxxxxxxxxxxxxxx
|