Commit 73fb7c30 authored by Dan Carpenter's avatar Dan Carpenter Committed by Zheng Zengkai
Browse files

selftests/bpf: fix a test for snprintf() overflow

stable inclusion
from stable-v5.10.137
commit d2b9e664bbfd06fb4b4b2d2a61f578771adc072f
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I60PLB

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=d2b9e664bbfd06fb4b4b2d2a61f578771adc072f



--------------------------------

[ Upstream commit c5d22f4c ]

The snprintf() function returns the number of bytes which *would*
have been copied if there were space.  In other words, it can be
> sizeof(pin_path).

Fixes: c0fa1b6c ("bpf: btf: Add BTF tests")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarMartin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/r/YtZ+aD/tZMkgOUw+@kili


Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: default avatarWei Li <liwei391@huawei.com>
parent f29b6bd8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment