aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/stat-cpi.py
diff options
context:
space:
mode:
authorKees Cook <[email protected]>2022-09-21 13:51:55 -0700
committerMartin K. Petersen <[email protected]>2022-09-25 12:52:48 -0400
commitd88a0240ff76062eb0728963e7aacf6dbe87f7c7 (patch)
tree363ed7c30318045053e57b0cbc77e73416fa2b0d /tools/perf/scripts/python/stat-cpi.py
parent1a2433b0ec45acd71130bd0bf419394c7d7d85c0 (diff)
scsi: scsi_transport_fc: Adjust struct fc_nl_event flex array usage
In order to help the compiler reason about the destination buffer in struct fc_nl_event, add a flexible array member for this purpose. However, since the header is UAPI, it must not change size or layout, so a union is used. The allocation size calculations are also corrected (it was potentially allocating an extra 8 bytes), and the padding is zeroed to avoid leaking kernel heap memory contents. Detected at run-time by the recently added memcpy() bounds checking: memcpy: detected field-spanning write (size 8) of single field "&event->event_data" at drivers/scsi/scsi_transport_fc.c:581 (size 4) Link: https://lore.kernel.org/linux-next/[email protected]/ Link: https://lore.kernel.org/r/[email protected] Cc: "James E.J. Bottomley" <[email protected]> Cc: "Martin K. Petersen" <[email protected]> Cc: [email protected] Reported-by: Sachin Sant <[email protected]> Tested-by: Sachin Sant <[email protected]> Reviewed-by: James Smart <[email protected]> Signed-off-by: Kees Cook <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/stat-cpi.py')
0 files changed, 0 insertions, 0 deletions