Re: [PATCH][next] net/tls: fix sign extension issue when left shifting u16 value

From: David Miller
Date: Tue Jun 30 2020 - 16:37:15 EST


From: Colin King <colin.king@xxxxxxxxxxxxx>
Date: Tue, 30 Jun 2020 15:27:46 +0100

> From: Colin Ian King <colin.king@xxxxxxxxxxxxx>
>
> Left shifting the u16 value promotes it to a int and then it
> gets sign extended to a u64. If len << 16 is greater than 0x7fffffff
> then the upper bits get set to 1 because of the implicit sign extension.
> Fix this by casting len to u64 before shifting it.
>
> Addresses-Coverity: ("integer handling issues")
> Fixes: ed9b7646b06a ("net/tls: Add asynchronous resync")
> Signed-off-by: Colin Ian King <colin.king@xxxxxxxxxxxxx>

Applied, thanks Colin.