Re: Locking task->security

From: Greg KH (gregat_private)
Date: Thu Aug 30 2001 - 15:39:29 PDT

  • Next message: richard offer: "Re: Locking task->security"

    On Thu, Aug 30, 2001 at 02:47:22PM -0700, richard offer wrote:
    > 
    > \begin{A non-kernel person stupid question}
    > 
    > I have my own blob in current->security, it comprises a bunch of data that
    > I think I need to lock access to.
    > 
    > My naive options appear to be :-
    > 
    >     1) lock the whole task structure (very bad)
    >     2) add a new security specific lock to the task to protect access to
    > the security blob
    >     3) add a lock inside the structure hanging off security (bad)
    >     4) add a global policy specific lock (bad)
    
    Do either #1 or #3, but do it _within_ your module.  Since the
    ->security blob is only being touched by your module, only you know what
    kind of lock you need, and when you need it.  So hang it off of the
    security blob, or have a static lock in your module that you use.
    
    Remember, there are a lot of different kinds of locks, all for different
    things, picking any one of them as the "security" lock in the LSM code
    would not work for everyone.
    
    Does that help?
    
    thanks,
    
    greg k-h
    
    _______________________________________________
    linux-security-module mailing list
    linux-security-moduleat_private
    http://mail.wirex.com/mailman/listinfo/linux-security-module
    



    This archive was generated by hypermail 2b30 : Thu Aug 30 2001 - 15:42:38 PDT