• Johan Hovold's avatar
    USB: serial: ch341: fix control-message error handling · 2d5a9c72
    Johan Hovold authored
    A short control transfer would currently fail to be detected, something
    which could lead to stale buffer data being used as valid input.
    
    Check for short transfers, and make sure to log any transfer errors.
    
    Note that this also avoids leaking heap data to user space (TIOCMGET)
    and the remote device (break control).
    
    Fixes: 6ce76104 ("USB: Driver for CH341 USB-serial adaptor")
    Cc: stable <stable@vger.kernel.org>
    Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
    2d5a9c72
ch341.c 16.4 KB