[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] usb-storage: tag usb_msd_csw as packed struct
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH] usb-storage: tag usb_msd_csw as packed struct |
Date: |
Mon, 6 Sep 2021 11:24:01 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 |
On 9/6/21 6:55 AM, Gerd Hoffmann wrote:
> Without this the struct has the wrong size: sizeof() evaluates
> to 16 instead of 13. In most cases the bug is hidden by the
> fact that guests submits a buffer which is exactly 13 bytes
> long, so the padding added by the compiler is simply ignored.
>
> But sometimes guests submit a larger buffer and expect a short
> transfer, which does not work properly with the wrong struct
> size.
>
> Cc: vintagepc404@protonmail.com
Fixes: a917d384ac0 ("SCSI TCQ support.")
15 years old bug, nice =)
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
> include/hw/usb/msd.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)