diff options
author | 2025-03-05 18:52:59 +0300 | |
---|---|---|
committer | 2025-03-05 10:37:01 -0800 | |
commit | 528361c49962708a60f51a1afafeb00987cebedf (patch) | |
tree | 5197d4f8123e9310c3f4471ad43ad4362fdc576d /net/lapb/lapb_timer.c | |
parent | nvmet-tcp: Fix a possible sporadic response drops in weakly ordered arch (diff) | |
download | wireguard-linux-528361c49962708a60f51a1afafeb00987cebedf.tar.xz wireguard-linux-528361c49962708a60f51a1afafeb00987cebedf.zip |
nvme-tcp: fix signedness bug in nvme_tcp_init_connection()
The kernel_recvmsg() function returns an int which could be either
negative error codes or the number of bytes received. The problem is
that the condition:
if (ret < sizeof(*icresp)) {
is type promoted to type unsigned long and negative values are treated
as high positive values which is success, when they should be treated as
failure. Handle invalid positive returns separately from negative
error codes to avoid this problem.
Fixes: 578539e09690 ("nvme-tcp: fix connect failure on receiving partial ICResp PDU")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Caleb Sander Mateos <csander@purestorage.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Diffstat (limited to 'net/lapb/lapb_timer.c')
0 files changed, 0 insertions, 0 deletions