Re: [PATCH] security_ops locking

From: Chris Wright (chrisat_private)
Date: Thu Jul 25 2002 - 00:29:14 PDT

  • Next message: Chris Wright: "Re: Why hooks in sys_iopl and sys_ioperm?"

    * James Morris (jmorrisat_private) wrote:
    > 
    > Nope, David was correct.  The spinlocking only imposes memory ordering 
    > with respect to its lock and critical region, which doesn't help us if 
    > pointer assignments are not atomic.
    
    Yes, I misinterpreted the use of the spinlock.  It is exactly as you
    describe.  But as it seems, the pointer assignment is not an issue.
    
    > The locking is still needed for 
    > unprotected use of the registration interface, though.
    
    So we go back to, how paranoid are we?  Randomly calling register_security
    outside of module_init is certainly legal, although I guess could be
    considered abuse of the interface.  OTOH, implicit reliance on the BKL
    is not exactly nice.  I support adding the extra locking.
    
    > However, I have been told by one of the kernel port maintainers that 
    > pointer assignments will always be atomic where the pointers are aligned 
    > correctly, for all current archs.  This means we should be ok, as the 
    > pointers we are using will be aligned correctly by the compiler.
    
    Ok, this is the same thing I dug up.  Register size assignments are
    guaranteed atomic.
    
    thanks,
    -chris
    -- 
    Linux Security Modules     http://lsm.immunix.org     http://lsm.bkbits.net
    _______________________________________________
    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 Jul 25 2002 - 00:30:57 PDT