]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: bfa: try to sanitize vendor netlink events
authorArnd Bergmann <arnd@arndb.de>
Fri, 10 Nov 2017 15:37:14 +0000 (16:37 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 5 Dec 2017 01:32:52 +0000 (20:32 -0500)
commit4528d6cdeaf8a44012919d653ea879268b786d5c
tree6f1ae647343302d57c4c7e21a0d345cedca91c01
parent23e1b8ae2ef3e1ba7ce16769a2fb1a9259ba5679
scsi: bfa: try to sanitize vendor netlink events

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: Arnd Bergmann <arnd@arndb.de>
Acked-by: Anil Gurumurthy <Anil.Gurumurthy@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/bfa/bfa_defs_svc.h
drivers/scsi/bfa/bfad_im.h