All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next] libbpf: fix type compatibility check copy-paste error
@ 2020-08-21 22:56 Andrii Nakryiko
  2020-08-24 21:51 ` Alexei Starovoitov
  0 siblings, 1 reply; 2+ messages in thread
From: Andrii Nakryiko @ 2020-08-21 22:56 UTC (permalink / raw)
  To: bpf, netdev, ast, daniel; +Cc: andrii.nakryiko, kernel-team, Andrii Nakryiko

Fix copy-paste error in types compatibility check. Local type is accidentally
used instead of target type for the very first type check strictness check.
This can result in potentially less strict candidate comparison. Fix the
error.

Fixes: 3fc32f40c402 ("libbpf: Implement type-based CO-RE relocations support")
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
---
 tools/lib/bpf/libbpf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 210429c5b772..ea80a1582af6 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -4603,7 +4603,7 @@ static int bpf_core_types_are_compat(const struct btf *local_btf, __u32 local_id
 
 	/* caller made sure that names match (ignoring flavor suffix) */
 	local_type = btf__type_by_id(local_btf, local_id);
-	targ_type = btf__type_by_id(local_btf, local_id);
+	targ_type = btf__type_by_id(targ_btf, targ_id);
 	if (btf_kind(local_type) != btf_kind(targ_type))
 		return 0;
 
-- 
2.24.1


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

* Re: [PATCH bpf-next] libbpf: fix type compatibility check copy-paste error
  2020-08-21 22:56 [PATCH bpf-next] libbpf: fix type compatibility check copy-paste error Andrii Nakryiko
@ 2020-08-24 21:51 ` Alexei Starovoitov
  0 siblings, 0 replies; 2+ messages in thread
From: Alexei Starovoitov @ 2020-08-24 21:51 UTC (permalink / raw)
  To: Andrii Nakryiko
  Cc: bpf, Network Development, Alexei Starovoitov, Daniel Borkmann,
	Andrii Nakryiko, Kernel Team

On Fri, Aug 21, 2020 at 4:00 PM Andrii Nakryiko <andriin@fb.com> wrote:
>
> Fix copy-paste error in types compatibility check. Local type is accidentally
> used instead of target type for the very first type check strictness check.
> This can result in potentially less strict candidate comparison. Fix the
> error.
>
> Fixes: 3fc32f40c402 ("libbpf: Implement type-based CO-RE relocations support")
> Signed-off-by: Andrii Nakryiko <andriin@fb.com>

Applied. Thanks

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

end of thread, other threads:[~2020-08-24 21:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-21 22:56 [PATCH bpf-next] libbpf: fix type compatibility check copy-paste error Andrii Nakryiko
2020-08-24 21:51 ` Alexei Starovoitov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.