All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools/libbpf: signedness bug in btf_dedup_ref_type()
@ 2019-02-28  5:46 ` Dan Carpenter
  0 siblings, 0 replies; 19+ 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] 19+ messages in thread

* [PATCH] tools/libbpf: signedness bug in btf_dedup_ref_type()
@ 2019-02-28  5:46 ` Dan Carpenter
  0 siblings, 0 replies; 19+ 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] 19+ messages in thread

* Re: [PATCH] tools/libbpf: signedness bug in btf_dedup_ref_type()
  2019-02-28  5:46 ` Dan Carpenter
@ 2019-02-28  6:58   ` Yonghong Song
  -1 siblings, 0 replies; 19+ messages in thread
From: Yonghong Song @ 2019-02-28  6:58 UTC (permalink / raw)
  To: Dan Carpenter, Alexei Starovoitov, Andrii Nakryiko
  Cc: Daniel Borkmann, Martin Lau, Song Liu, netdev, kernel-janitors



On 2/27/19 9:46 PM, Dan Carpenter wrote:
> 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;

nit. Maybe you can change to
	int ref_type_id;
	__u32 h;
to maintain kernel declaration reverse christmas tree convention?

>   
>   	if (d->map[type_id] == BTF_IN_PROGRESS_ID)
>   		return -ELOOP;
> 

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

* Re: [PATCH] tools/libbpf: signedness bug in btf_dedup_ref_type()
@ 2019-02-28  6:58   ` Yonghong Song
  0 siblings, 0 replies; 19+ messages in thread
From: Yonghong Song @ 2019-02-28  6:58 UTC (permalink / raw)
  To: Dan Carpenter, Alexei Starovoitov, Andrii Nakryiko
  Cc: Daniel Borkmann, Martin Lau, Song Liu, netdev, kernel-janitors

DQoNCk9uIDIvMjcvMTkgOTo0NiBQTSwgRGFuIENhcnBlbnRlciB3cm90ZToNCj4gVGhlICJyZWZf
dHlwZV9pZCIgdmFyaWFibGUgbmVlZHMgdG8gYmUgc2lnbmVkIGZvciB0aGUgZXJyb3IgaGFuZGxp
bmcNCj4gdG8gd29yay4NCj4gDQo+IEZpeGVzOiBkNWNhZWY1YjU2NTUgKCJidGY6IGFkZCBCVEYg
dHlwZXMgZGVkdXBsaWNhdGlvbiBhbGdvcml0aG0iKQ0KPiBTaWduZWQtb2ZmLWJ5OiBEYW4gQ2Fy
cGVudGVyIDxkYW4uY2FycGVudGVyQG9yYWNsZS5jb20+DQo+IC0tLQ0KPiBUaGlzIGdvZXMgdGhy
b3VnaCB0aGUgQlBGIHRyZWUgcHJvYmFibHksIGFsdGhvdWdoIGl0IGRvZXMgYXBwbHkgdG8NCj4g
bmV0LW5leHQuDQo+IA0KPiAgIHRvb2xzL2xpYi9icGYvYnRmLmMgfCAzICsrLQ0KPiAgIDEgZmls
ZSBjaGFuZ2VkLCAyIGluc2VydGlvbnMoKyksIDEgZGVsZXRpb24oLSkNCj4gDQo+IGRpZmYgLS1n
aXQgYS90b29scy9saWIvYnBmL2J0Zi5jIGIvdG9vbHMvbGliL2JwZi9idGYuYw0KPiBpbmRleCA2
OGI1MGU5YmJkZTEuLjhmYWVkNTM4NjEyNCAxMDA2NDQNCj4gLS0tIGEvdG9vbHMvbGliL2JwZi9i
dGYuYw0KPiArKysgYi90b29scy9saWIvYnBmL2J0Zi5jDQo+IEBAIC0yMzI2LDcgKzIzMjYsOCBA
QCBzdGF0aWMgaW50IGJ0Zl9kZWR1cF9yZWZfdHlwZShzdHJ1Y3QgYnRmX2RlZHVwICpkLCBfX3Uz
MiB0eXBlX2lkKQ0KPiAgIAlzdHJ1Y3QgYnRmX3R5cGUgKnQsICpjYW5kOw0KPiAgIAkvKiBpZiB3
ZSBkb24ndCBmaW5kIGVxdWl2YWxlbnQgdHlwZSwgdGhlbiB3ZSBhcmUgcmVwcmVzZW50YXRpdmUg
dHlwZSAqLw0KPiAgIAlfX3UzMiBuZXdfaWQgPSB0eXBlX2lkOw0KPiAtCV9fdTMyIGgsIHJlZl90
eXBlX2lkOw0KPiArCV9fdTMyIGg7ID4gKwlpbnQgcmVmX3R5cGVfaWQ7DQoNCm5pdC4gTWF5YmUg
eW91IGNhbiBjaGFuZ2UgdG8NCglpbnQgcmVmX3R5cGVfaWQ7DQoJX191MzIgaDsNCnRvIG1haW50
YWluIGtlcm5lbCBkZWNsYXJhdGlvbiByZXZlcnNlIGNocmlzdG1hcyB0cmVlIGNvbnZlbnRpb24/
DQoNCj4gICANCj4gICAJaWYgKGQtPm1hcFt0eXBlX2lkXSA9PSBCVEZfSU5fUFJPR1JFU1NfSUQp
DQo+ICAgCQlyZXR1cm4gLUVMT09QOw0KPiANCg=

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

* Re: [PATCH] tools/libbpf: signedness bug in btf_dedup_ref_type()
  2019-02-28  6:58   ` Yonghong Song
@ 2019-02-28 13:36     ` Dan Carpenter
  -1 siblings, 0 replies; 19+ messages in thread
From: Dan Carpenter @ 2019-02-28 13:36 UTC (permalink / raw)
  To: Yonghong Song
  Cc: Alexei Starovoitov, Andrii Nakryiko, Daniel Borkmann, Martin Lau,
	Song Liu, netdev, kernel-janitors

On Thu, Feb 28, 2019 at 06:58:29AM +0000, Yonghong Song wrote:
> 
> 
> On 2/27/19 9:46 PM, Dan Carpenter wrote:
> > 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;
> 
> nit. Maybe you can change to
> 	int ref_type_id;
> 	__u32 h;
> to maintain kernel declaration reverse christmas tree convention?
> 

Yes.  Thanks.  Let me resend.

regards,
dan carpenter


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

* Re: [PATCH] tools/libbpf: signedness bug in btf_dedup_ref_type()
@ 2019-02-28 13:36     ` Dan Carpenter
  0 siblings, 0 replies; 19+ messages in thread
From: Dan Carpenter @ 2019-02-28 13:36 UTC (permalink / raw)
  To: Yonghong Song
  Cc: Alexei Starovoitov, Andrii Nakryiko, Daniel Borkmann, Martin Lau,
	Song Liu, netdev, kernel-janitors

On Thu, Feb 28, 2019 at 06:58:29AM +0000, Yonghong Song wrote:
> 
> 
> On 2/27/19 9:46 PM, Dan Carpenter wrote:
> > 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;
> 
> nit. Maybe you can change to
> 	int ref_type_id;
> 	__u32 h;
> to maintain kernel declaration reverse christmas tree convention?
> 

Yes.  Thanks.  Let me resend.

regards,
dan carpenter

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

* Re: [PATCH] tools/libbpf: signedness bug in btf_dedup_ref_type()
  2019-02-28 13:36     ` Dan Carpenter
@ 2019-02-28 17:44       ` Andrii Nakryiko
  -1 siblings, 0 replies; 19+ messages in thread
From: Andrii Nakryiko @ 2019-02-28 17:44 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Yonghong Song, Alexei Starovoitov, Andrii Nakryiko,
	Daniel Borkmann, Martin Lau, Song Liu, netdev, kernel-janitors

On Thu, Feb 28, 2019 at 5:37 AM Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> On Thu, Feb 28, 2019 at 06:58:29AM +0000, Yonghong Song wrote:
> >
> >
> > On 2/27/19 9:46 PM, Dan Carpenter wrote:
> > > 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;
> >
> > nit. Maybe you can change to
> >       int ref_type_id;
> >       __u32 h;
> > to maintain kernel declaration reverse christmas tree convention?
> >
>
> Yes.  Thanks.  Let me resend.
>

Thanks for catching and fixing this! With Yonghong's suggestion, you can add:

Acked-by: Andrii Nakryiko <andriin@fb.com>


> regards,
> dan carpenter
>

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

* Re: [PATCH] tools/libbpf: signedness bug in btf_dedup_ref_type()
@ 2019-02-28 17:44       ` Andrii Nakryiko
  0 siblings, 0 replies; 19+ messages in thread
From: Andrii Nakryiko @ 2019-02-28 17:44 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Yonghong Song, Alexei Starovoitov, Andrii Nakryiko,
	Daniel Borkmann, Martin Lau, Song Liu, netdev, kernel-janitors

On Thu, Feb 28, 2019 at 5:37 AM Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> On Thu, Feb 28, 2019 at 06:58:29AM +0000, Yonghong Song wrote:
> >
> >
> > On 2/27/19 9:46 PM, Dan Carpenter wrote:
> > > 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;
> >
> > nit. Maybe you can change to
> >       int ref_type_id;
> >       __u32 h;
> > to maintain kernel declaration reverse christmas tree convention?
> >
>
> Yes.  Thanks.  Let me resend.
>

Thanks for catching and fixing this! With Yonghong's suggestion, you can add:

Acked-by: Andrii Nakryiko <andriin@fb.com>


> regards,
> dan carpenter
>

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

* [PATCH v2] tools/libbpf: signedness bug in btf_dedup_ref_type()
  2019-02-28  6:58   ` Yonghong Song
@ 2019-02-28 17:50     ` Dan Carpenter
  -1 siblings, 0 replies; 19+ messages in thread
From: Dan Carpenter @ 2019-02-28 17:50 UTC (permalink / raw)
  To: Alexei Starovoitov, Andrii Nakryiko
  Cc: Daniel Borkmann, Martin KaFai Lau, Song Liu, Yonghong Song,
	netdev, bpf, 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>
Acked-by: Andrii Nakryiko <andriin@fb.com>
---
v2: Use reverse Christmas tree style

This goes through the BPF tree probably, although it does apply to
net-next.

 drivers/infiniband/ulp/iser/iscsi_iser.h | 2 +-
 tools/lib/bpf/btf.c                      | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.h b/drivers/infiniband/ulp/iser/iscsi_iser.h
index 120b40829560..ee7d3f6a666e 100644
--- a/drivers/infiniband/ulp/iser/iscsi_iser.h
+++ b/drivers/infiniband/ulp/iser/iscsi_iser.h
@@ -197,7 +197,7 @@ struct iser_data_buf {
 	struct scatterlist *sg;
 	int                size;
 	unsigned long      data_len;
-	unsigned int       dma_nents;
+	int		   dma_nents;
 };
 
 /* fwd declarations */
diff --git a/tools/lib/bpf/btf.c b/tools/lib/bpf/btf.c
index 68b50e9bbde1..00a2f06e38fd 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;
+	int ref_type_id;
+	__u32 h;
 
 	if (d->map[type_id] == BTF_IN_PROGRESS_ID)
 		return -ELOOP;
-- 
2.17.1


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

* [PATCH v2] tools/libbpf: signedness bug in btf_dedup_ref_type()
@ 2019-02-28 17:50     ` Dan Carpenter
  0 siblings, 0 replies; 19+ messages in thread
From: Dan Carpenter @ 2019-02-28 17:50 UTC (permalink / raw)
  To: Alexei Starovoitov, Andrii Nakryiko
  Cc: Daniel Borkmann, Martin KaFai Lau, Song Liu, Yonghong Song,
	netdev, bpf, 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>
Acked-by: Andrii Nakryiko <andriin@fb.com>
---
v2: Use reverse Christmas tree style

This goes through the BPF tree probably, although it does apply to
net-next.

 drivers/infiniband/ulp/iser/iscsi_iser.h | 2 +-
 tools/lib/bpf/btf.c                      | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.h b/drivers/infiniband/ulp/iser/iscsi_iser.h
index 120b40829560..ee7d3f6a666e 100644
--- a/drivers/infiniband/ulp/iser/iscsi_iser.h
+++ b/drivers/infiniband/ulp/iser/iscsi_iser.h
@@ -197,7 +197,7 @@ struct iser_data_buf {
 	struct scatterlist *sg;
 	int                size;
 	unsigned long      data_len;
-	unsigned int       dma_nents;
+	int		   dma_nents;
 };
 
 /* fwd declarations */
diff --git a/tools/lib/bpf/btf.c b/tools/lib/bpf/btf.c
index 68b50e9bbde1..00a2f06e38fd 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;
+	int ref_type_id;
+	__u32 h;
 
 	if (d->map[type_id] = BTF_IN_PROGRESS_ID)
 		return -ELOOP;
-- 
2.17.1

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

* Re: [PATCH v2] tools/libbpf: signedness bug in btf_dedup_ref_type()
  2019-02-28 17:50     ` Dan Carpenter
@ 2019-02-28 17:53       ` Arnaldo Carvalho de Melo
  -1 siblings, 0 replies; 19+ messages in thread
From: Arnaldo Carvalho de Melo @ 2019-02-28 17:53 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Alexei Starovoitov, Andrii Nakryiko, Daniel Borkmann,
	Martin KaFai Lau, Song Liu, Yonghong Song, netdev, bpf,
	kernel-janitors

Em Thu, Feb 28, 2019 at 08:50:35PM +0300, Dan Carpenter escreveu:
> The "ref_type_id" variable needs to be signed for the error handling
> to work.

Does the infiniband signedness change comes as a bonus? :-)

- Arnaldo
 
> Fixes: d5caef5b5655 ("btf: add BTF types deduplication algorithm")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> Acked-by: Andrii Nakryiko <andriin@fb.com>
> ---
> v2: Use reverse Christmas tree style
> 
> This goes through the BPF tree probably, although it does apply to
> net-next.
> 
>  drivers/infiniband/ulp/iser/iscsi_iser.h | 2 +-
>  tools/lib/bpf/btf.c                      | 3 ++-
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.h b/drivers/infiniband/ulp/iser/iscsi_iser.h
> index 120b40829560..ee7d3f6a666e 100644
> --- a/drivers/infiniband/ulp/iser/iscsi_iser.h
> +++ b/drivers/infiniband/ulp/iser/iscsi_iser.h
> @@ -197,7 +197,7 @@ struct iser_data_buf {
>  	struct scatterlist *sg;
>  	int                size;
>  	unsigned long      data_len;
> -	unsigned int       dma_nents;
> +	int		   dma_nents;
>  };
>  
>  /* fwd declarations */
> diff --git a/tools/lib/bpf/btf.c b/tools/lib/bpf/btf.c
> index 68b50e9bbde1..00a2f06e38fd 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;
> +	int ref_type_id;
> +	__u32 h;
>  
>  	if (d->map[type_id] == BTF_IN_PROGRESS_ID)
>  		return -ELOOP;
> -- 
> 2.17.1

-- 

- Arnaldo

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

* Re: [PATCH v2] tools/libbpf: signedness bug in btf_dedup_ref_type()
@ 2019-02-28 17:53       ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 19+ messages in thread
From: Arnaldo Carvalho de Melo @ 2019-02-28 17:53 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Alexei Starovoitov, Andrii Nakryiko, Daniel Borkmann,
	Martin KaFai Lau, Song Liu, Yonghong Song, netdev, bpf,
	kernel-janitors

Em Thu, Feb 28, 2019 at 08:50:35PM +0300, Dan Carpenter escreveu:
> The "ref_type_id" variable needs to be signed for the error handling
> to work.

Does the infiniband signedness change comes as a bonus? :-)

- Arnaldo
 
> Fixes: d5caef5b5655 ("btf: add BTF types deduplication algorithm")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> Acked-by: Andrii Nakryiko <andriin@fb.com>
> ---
> v2: Use reverse Christmas tree style
> 
> This goes through the BPF tree probably, although it does apply to
> net-next.
> 
>  drivers/infiniband/ulp/iser/iscsi_iser.h | 2 +-
>  tools/lib/bpf/btf.c                      | 3 ++-
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.h b/drivers/infiniband/ulp/iser/iscsi_iser.h
> index 120b40829560..ee7d3f6a666e 100644
> --- a/drivers/infiniband/ulp/iser/iscsi_iser.h
> +++ b/drivers/infiniband/ulp/iser/iscsi_iser.h
> @@ -197,7 +197,7 @@ struct iser_data_buf {
>  	struct scatterlist *sg;
>  	int                size;
>  	unsigned long      data_len;
> -	unsigned int       dma_nents;
> +	int		   dma_nents;
>  };
>  
>  /* fwd declarations */
> diff --git a/tools/lib/bpf/btf.c b/tools/lib/bpf/btf.c
> index 68b50e9bbde1..00a2f06e38fd 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;
> +	int ref_type_id;
> +	__u32 h;
>  
>  	if (d->map[type_id] = BTF_IN_PROGRESS_ID)
>  		return -ELOOP;
> -- 
> 2.17.1

-- 

- Arnaldo

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

* Re: [PATCH v2] tools/libbpf: signedness bug in btf_dedup_ref_type()
  2019-02-28 17:53       ` Arnaldo Carvalho de Melo
@ 2019-02-28 18:01         ` Dan Carpenter
  -1 siblings, 0 replies; 19+ messages in thread
From: Dan Carpenter @ 2019-02-28 18:01 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Alexei Starovoitov, Andrii Nakryiko, Daniel Borkmann,
	Martin KaFai Lau, Song Liu, Yonghong Song, netdev, bpf,
	kernel-janitors

On Thu, Feb 28, 2019 at 02:53:00PM -0300, Arnaldo Carvalho de Melo wrote:
> Em Thu, Feb 28, 2019 at 08:50:35PM +0300, Dan Carpenter escreveu:
> > The "ref_type_id" variable needs to be signed for the error handling
> > to work.
> 
> Does the infiniband signedness change comes as a bonus? :-)
> 

Oh wow...  :P

Let me resend v3.

regards,
dan carpenter


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

* Re: [PATCH v2] tools/libbpf: signedness bug in btf_dedup_ref_type()
@ 2019-02-28 18:01         ` Dan Carpenter
  0 siblings, 0 replies; 19+ messages in thread
From: Dan Carpenter @ 2019-02-28 18:01 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Alexei Starovoitov, Andrii Nakryiko, Daniel Borkmann,
	Martin KaFai Lau, Song Liu, Yonghong Song, netdev, bpf,
	kernel-janitors

On Thu, Feb 28, 2019 at 02:53:00PM -0300, Arnaldo Carvalho de Melo wrote:
> Em Thu, Feb 28, 2019 at 08:50:35PM +0300, Dan Carpenter escreveu:
> > The "ref_type_id" variable needs to be signed for the error handling
> > to work.
> 
> Does the infiniband signedness change comes as a bonus? :-)
> 

Oh wow...  :P

Let me resend v3.

regards,
dan carpenter

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

* [PATCH v3] tools/libbpf: signedness bug in btf_dedup_ref_type()
  2019-02-28  6:58   ` Yonghong Song
@ 2019-02-28 18:06     ` Dan Carpenter
  -1 siblings, 0 replies; 19+ messages in thread
From: Dan Carpenter @ 2019-02-28 18:06 UTC (permalink / raw)
  To: Alexei Starovoitov, Andrii Nakryiko
  Cc: Daniel Borkmann, Martin KaFai Lau, Song Liu, Yonghong Song,
	netdev, bpf, 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>
Acked-by: Andrii Nakryiko <andriin@fb.com>
---
v2: Use reverse Christmas tree style
v3: Remove the bonus fix.

This goes through the BPF tree probably, although it does apply to
net-next.

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

diff --git a/tools/lib/bpf/btf.c b/tools/lib/bpf/btf.c
index 68b50e9bbde1..00a2f06e38fd 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;
+	int ref_type_id;
+	__u32 h;
 
 	if (d->map[type_id] == BTF_IN_PROGRESS_ID)
 		return -ELOOP;
-- 
2.17.1

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

* [PATCH v3] tools/libbpf: signedness bug in btf_dedup_ref_type()
@ 2019-02-28 18:06     ` Dan Carpenter
  0 siblings, 0 replies; 19+ messages in thread
From: Dan Carpenter @ 2019-02-28 18:06 UTC (permalink / raw)
  To: Alexei Starovoitov, Andrii Nakryiko
  Cc: Daniel Borkmann, Martin KaFai Lau, Song Liu, Yonghong Song,
	netdev, bpf, 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>
Acked-by: Andrii Nakryiko <andriin@fb.com>
---
v2: Use reverse Christmas tree style
v3: Remove the bonus fix.

This goes through the BPF tree probably, although it does apply to
net-next.

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

diff --git a/tools/lib/bpf/btf.c b/tools/lib/bpf/btf.c
index 68b50e9bbde1..00a2f06e38fd 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;
+	int ref_type_id;
+	__u32 h;
 
 	if (d->map[type_id] = BTF_IN_PROGRESS_ID)
 		return -ELOOP;
-- 
2.17.1

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

* Re: [PATCH v3] tools/libbpf: signedness bug in btf_dedup_ref_type()
  2019-02-28 18:06     ` Dan Carpenter
  (?)
@ 2019-02-28 19:29     ` Song Liu
  -1 siblings, 0 replies; 19+ messages in thread
From: Song Liu @ 2019-02-28 19:29 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Alexei Starovoitov, Andrii Nakryiko, Daniel Borkmann, Martin Lau,
	Yonghong Song, netdev, bpf, kernel-janitors



> On Feb 28, 2019, at 10:06 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> 
> 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>
> Acked-by: Andrii Nakryiko <andriin@fb.com>

Acked-by: Song Liu <songliubraving@fb.com>

> ---
> v2: Use reverse Christmas tree style
> v3: Remove the bonus fix.
> 
> This goes through the BPF tree probably, although it does apply to
> net-next.
> 
> tools/lib/bpf/btf.c                      | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/tools/lib/bpf/btf.c b/tools/lib/bpf/btf.c
> index 68b50e9bbde1..00a2f06e38fd 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;
> +	int ref_type_id;
> +	__u32 h;
> 
> 	if (d->map[type_id] == BTF_IN_PROGRESS_ID)
> 		return -ELOOP;
> -- 
> 2.17.1


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

* Re: [PATCH v3] tools/libbpf: signedness bug in btf_dedup_ref_type()
  2019-02-28 18:06     ` Dan Carpenter
@ 2019-03-01  0:01       ` Daniel Borkmann
  -1 siblings, 0 replies; 19+ messages in thread
From: Daniel Borkmann @ 2019-03-01  0:01 UTC (permalink / raw)
  To: Dan Carpenter, Alexei Starovoitov, Andrii Nakryiko
  Cc: Martin KaFai Lau, Song Liu, Yonghong Song, netdev, bpf, kernel-janitors

On 02/28/2019 07:06 PM, Dan Carpenter wrote:
> 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>
> Acked-by: Andrii Nakryiko <andriin@fb.com>

Applied, thanks!

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

* Re: [PATCH v3] tools/libbpf: signedness bug in btf_dedup_ref_type()
@ 2019-03-01  0:01       ` Daniel Borkmann
  0 siblings, 0 replies; 19+ messages in thread
From: Daniel Borkmann @ 2019-03-01  0:01 UTC (permalink / raw)
  To: Dan Carpenter, Alexei Starovoitov, Andrii Nakryiko
  Cc: Martin KaFai Lau, Song Liu, Yonghong Song, netdev, bpf, kernel-janitors

On 02/28/2019 07:06 PM, Dan Carpenter wrote:
> 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>
> Acked-by: Andrii Nakryiko <andriin@fb.com>

Applied, thanks!

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

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

Thread overview: 19+ 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  5:46 ` Dan Carpenter
2019-02-28  6:58 ` Yonghong Song
2019-02-28  6:58   ` Yonghong Song
2019-02-28 13:36   ` Dan Carpenter
2019-02-28 13:36     ` Dan Carpenter
2019-02-28 17:44     ` Andrii Nakryiko
2019-02-28 17:44       ` Andrii Nakryiko
2019-02-28 17:50   ` [PATCH v2] " Dan Carpenter
2019-02-28 17:50     ` Dan Carpenter
2019-02-28 17:53     ` Arnaldo Carvalho de Melo
2019-02-28 17:53       ` Arnaldo Carvalho de Melo
2019-02-28 18:01       ` Dan Carpenter
2019-02-28 18:01         ` Dan Carpenter
2019-02-28 18:06   ` [PATCH v3] " Dan Carpenter
2019-02-28 18:06     ` Dan Carpenter
2019-02-28 19:29     ` Song Liu
2019-03-01  0:01     ` Daniel Borkmann
2019-03-01  0:01       ` Daniel Borkmann

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.