On Wed, 2007-01-10 at 11:38 -0800, Ury Segal wrote:
> Hi!
> 
>  I am trying to call copy_from_user in a 
> security_sem_semop hook (Called from
> sys_semtimedop in ipc/sem.c). After several such
> calls, I get a panic about trying to unlock a
> spin lock twice (I can't copy-paste the panic and
> the trace since the console just freezes and
> nothing goes into /var/log/messages). After the
> panic, the machine freezes.
> 
>  I noticed that the spin lock attached to the
> semaphore is locked, and I remember you can't
> call anything that might sleep when a spin is
> help. Also, rcu_read_lock is called. All this
> just before the call to security_sem_semop is
> make.
> 
> My question is: Is there any way to access user
> memory inside a security_sem_semop hook? 

What is it you really want to do?  i.e. what data do you want from user
memory and why?  You generally do not want any such copying to occur
from within a hook, not only due to locking issues, but also to avoid
duplicate copying and inconsistent views of the same data.  The data
copy should always occur in the core code and then be passed to the
hook.

-- 
Stephen Smalley
National Security Agency

-
To unsubscribe from this list: send the line "unsubscribe 
linux-security-module" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to