netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tools/libbpf: signedness bug in btf_dedup_ref_type()
@ 2019-02-28  5:46 Dan Carpenter
  2019-02-28  6:58 ` Yonghong Song
  0 siblings, 1 reply; 10+ messages in thread
From: Dan Carpenter @ 2019-02-28  5:46 UTC (permalink / raw)
  To: Alexei Starovoitov, Andrii Nakryiko
  Cc: Daniel Borkmann, Martin KaFai Lau, Song Liu, Yonghong Song,
	netdev, kernel-janitors

The "ref_type_id" variable needs to be signed for the error handling
to work.

Fixes: d5caef5b5655 ("btf: add BTF types deduplication algorithm")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
This goes through the BPF tree probably, although it does apply to
net-next.

 tools/lib/bpf/btf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/lib/bpf/btf.c b/tools/lib/bpf/btf.c
index 68b50e9bbde1..8faed5386124 100644
--- a/tools/lib/bpf/btf.c
+++ b/tools/lib/bpf/btf.c
@@ -2326,7 +2326,8 @@ static int btf_dedup_ref_type(struct btf_dedup *d, __u32 type_id)
 	struct btf_type *t, *cand;
 	/* if we don't find equivalent type, then we are representative type */
 	__u32 new_id = type_id;
-	__u32 h, ref_type_id;
+	__u32 h;
+	int ref_type_id;
 
 	if (d->map[type_id] == BTF_IN_PROGRESS_ID)
 		return -ELOOP;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-03-01  0:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-28  5:46 [PATCH] tools/libbpf: signedness bug in btf_dedup_ref_type() Dan Carpenter
2019-02-28  6:58 ` Yonghong Song
2019-02-28 13:36   ` Dan Carpenter
2019-02-28 17:44     ` Andrii Nakryiko
2019-02-28 17:50   ` [PATCH v2] " Dan Carpenter
2019-02-28 17:53     ` Arnaldo Carvalho de Melo
2019-02-28 18:01       ` Dan Carpenter
2019-02-28 18:06   ` [PATCH v3] " Dan Carpenter
2019-02-28 19:29     ` Song Liu
2019-03-01  0:01     ` Daniel Borkmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).