Re: Detecting missing hook functions

From: Chris Wright (chrisat_private)
Date: Thu Oct 25 2001 - 14:11:56 PDT

  • Next message: Greg KH: "Re: Authoritative hooks updated to 2.4.13"

    * Stephen Smalley (sdsat_private) wrote:
    > 
    > On Thu, 25 Oct 2001, Stephen Smalley wrote:
    > 
    > > If there isn't any easier way, I'll submit a patch to expand verify to
    > > cover all of the current hooks.
    > 
    > A patch to expand the verify function to cover all current hooks is
    > attached.
    
    hmmm...i was thinking in terms of something more automated.  not sure of
    the pitfalls here, but assuming everyone makes there structs static so
    the empty holes are zero filled...
    
    #define VERIFY_STRUCT(type, s) \
            do { \
                    unsigned int size = sizeof(#type); \
                    unsigned long start = (unsigned long)s; \
                    unsigned long end = (unsigned long)s + size; \
                    while (start != end) { \
                            if (!*(long*)start) { \
                                    printk("error!\n"); \
                                    break; \
                            } \
                            start += sizeof(void *); \
                    } \
            } while (0) 
    
    
    whaddya think?
    
    -chris
    
    _______________________________________________
    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 Oct 25 2001 - 14:21:46 PDT