Atomic pointer writes issue SOLVED.

From: David Wheeler (dwheelerat_private)
Date: Tue Sep 03 2002 - 06:18:39 PDT

  • Next message: David Wheeler: "Correct incantation to get a string in sys_security?"

    SOLVED!
    
    After much searching, I finally found a reference discussing
    atomic pointer writes, memory ordering, and Linux.
    It turns out that Paul Rusty Russell's
    "Unreliable Guide to Locking" (part of the Linux kernel documentation)
    specifically notes that it's okay to assume atomic pointer writes
    of aligned pointers, AND it discusses how to flush the memory
    cache to ensure memory writes are always viewed in order
    (the two issues I had).  It even notes a specific case
    (Alan Cox does this with some firewalling code).
    
    So, I intend to soon post a new version of the "stacker" module
    that by default uses this fast implementation; using this approach,
    locks are only needed when state of the stacker is changed
    (e.g., adding and removing stacked LSM modules).  I'll also
    include a "slower" implementation that has more pleasant support
    for removing LSM modules, so you can choose "fast but don't remove"
    or "slow and remove at will" through a compile-time flag.
    
    If you use the (default) fast version, to remove a module you first
    have to "deactivate" it, and then sometime later remove the module.
    Don't remove the module until all threads have had a chance to complete
    executing it and walk through it (unfortunately there's no way to detect
    this, but that's the price you pay for speed).  I don't expect this
    to be a real problem.
    
    --- David A. Wheeler
    
    
    _______________________________________________
    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 : Tue Sep 03 2002 - 06:26:57 PDT