Re: [PATCH 009/117] iscsi: Add a compile-time structure size check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/19/21 5:06 PM, Bart Van Assche wrote:
> Before modifying the struct iscsi_bsg_reply definition, add a compile-time
> structure size check.
> 
> Cc: Lee Duncan <lduncan@xxxxxxxx>
> Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx>
> ---
>  drivers/scsi/scsi_transport_iscsi.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
> index bebfb355abdf..4f821118ea23 100644
> --- a/drivers/scsi/scsi_transport_iscsi.c
> +++ b/drivers/scsi/scsi_transport_iscsi.c
> @@ -4729,6 +4729,9 @@ static __init int iscsi_transport_init(void)
>  		.groups	= 1,
>  		.input	= iscsi_if_rx,
>  	};
> +
> +	BUILD_BUG_ON(offsetof(struct iscsi_bsg_reply, reply_data) != 8);
> +
>  	printk(KERN_INFO "Loading iSCSI transport class v%s.\n",
>  		ISCSI_TRANSPORT_VERSION);
>  
> 

Reviewed-by: Lee Duncan <lduncan@xxxxxxxx>




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux