lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 22 Sep 2022 15:22:56 -0700
From:   James Smart <>
To:     Kees Cook <>,
        "James E.J. Bottomley" <>
Cc:     Sachin Sant <>,
        "Martin K. Petersen" <>,,,
Subject: Re: [PATCH] scsi: scsi_transport_fc: Adjust struct fc_nl_event flex
 array usage

On 9/21/2022 1:51 PM, Kees Cook wrote:
> 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)
> Reported-by: Sachin Sant <>
> Link:
> Cc: "James E.J. Bottomley" <>
> Cc: "Martin K. Petersen" <>
> Cc:
> Signed-off-by: Kees Cook <>
> ---

Kinda crazy way to resolve it, but looks fine.

Reviewed-by: James Smart <>

-- james

Powered by blists - more mailing lists