• Arnd Bergmann's avatar
    scsi: bfa: try to sanitize vendor netlink events · 6d4bc344
    Arnd Bergmann authored
    bfa_aen_entry_s is passed to user space in a netlink message, but is
    defined using a 'struct timeval' and an 'enum' that are not only
    different between architectures, but also between 32-bit user space and
    64-bit kernels they may run on, as well as depending on the particular C
    library that defines timeval.
    
    This changes the in-kernel definition to no longer use the timeval type
    directly but instead use two open-coded 'unsigned long' members.  This
    keeps the existing ABI, but making the variable unsigned also helps make
    it work after y2038, until it overflows in 2106.
    
    Since the macro becomes overly complex at this point, I'm changing it to
    an inline function for readability.
    
    I'm not changing the 32-bit user-space ABI at this point, to keep the
    changes separate, I deally this would be defined using the same binary
    layout for all architectures.
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    Acked-by: default avatarAnil Gurumurthy <Anil.Gurumurthy@cavium.com>
    Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
    6d4bc344
bfa_defs_svc.h 47.7 KB