Commit 3ca8e73c authored by Fushuai Wang's avatar Fushuai Wang Committed by Greg Kroah-Hartman
Browse files

selftests/bpf: fix signedness bug in redir_partial()



[ Upstream commit 6a4bd31f ]

When xsend() returns -1 (error), the check 'n < sizeof(buf)' incorrectly
treats it as success due to unsigned promotion. Explicitly check for -1
first.

Fixes: a4b7193d ("selftests/bpf: Add sockmap test for redirecting partial skb data")
Signed-off-by: default avatarFushuai Wang <wangfushuai@baidu.com>
Link: https://lore.kernel.org/r/20250612084208.27722-1-wangfushuai@baidu.com


Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 0e853c14
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment