2013-03-10 02:16:20

by Chen Gang

[permalink] [raw]
Subject: [PATCH] ARM:net: an issue for k which is u32, never < 0


k is u32 which never < 0, need type cast, or cause issue.

Signed-off-by: Chen Gang <[email protected]>
---
arch/arm/net/bpf_jit_32.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c
index 6828ef6..a0bd8a7 100644
--- a/arch/arm/net/bpf_jit_32.c
+++ b/arch/arm/net/bpf_jit_32.c
@@ -576,7 +576,7 @@ load_ind:
/* x = ((*(frame + k)) & 0xf) << 2; */
ctx->seen |= SEEN_X | SEEN_DATA | SEEN_CALL;
/* the interpreter should deal with the negative K */
- if (k < 0)
+ if ((int)k < 0)
return -1;
/* offset in r1: we might have to take the slow path */
emit_mov_i(r_off, k, ctx);
--
1.7.7.6


2013-03-10 21:12:37

by David Miller

[permalink] [raw]
Subject: Re: [PATCH] ARM:net: an issue for k which is u32, never < 0

From: Chen Gang <[email protected]>
Date: Sun, 10 Mar 2013 10:15:54 +0800

>
> k is u32 which never < 0, need type cast, or cause issue.
>
> Signed-off-by: Chen Gang <[email protected]>

Who will apply this, ARM folks or me?

2013-03-11 04:53:29

by Chen Gang

[permalink] [raw]
Subject: Re: [PATCH] ARM:net: an issue for k which is u32, never < 0

于 2013年03月11日 05:12, David Miller 写道:
> From: Chen Gang <[email protected]>
> Date: Sun, 10 Mar 2013 10:15:54 +0800
>
>> >
>> > k is u32 which never < 0, need type cast, or cause issue.
>> >
>> > Signed-off-by: Chen Gang <[email protected]>
> Who will apply this, ARM folks or me?
>
>

sorry I don't know, either. I get the mail addresses by
./scripts/get_maintainers.pl. it includes you.

if no others reply within a week, I hope you can help to check and
apply it.

thanks.

--
Chen Gang

Asianux Corporation

2013-03-11 16:48:23

by Russell King - ARM Linux

[permalink] [raw]
Subject: Re: [PATCH] ARM:net: an issue for k which is u32, never < 0

On Sun, Mar 10, 2013 at 05:12:38PM -0400, David Miller wrote:
> From: Chen Gang <[email protected]>
> Date: Sun, 10 Mar 2013 10:15:54 +0800
>
> >
> > k is u32 which never < 0, need type cast, or cause issue.
> >
> > Signed-off-by: Chen Gang <[email protected]>
>
> Who will apply this, ARM folks or me?

I'm happy if you wish to take the patch:

Acked-by: Russell King <[email protected]>

Thanks.

2013-03-11 16:54:47

by Mircea Gherzan

[permalink] [raw]
Subject: Re: [PATCH] ARM:net: an issue for k which is u32, never < 0

2013/3/10 Chen Gang <[email protected]>:
>
> k is u32 which never < 0, need type cast, or cause issue.
>
> Signed-off-by: Chen Gang <[email protected]>
> ---
> arch/arm/net/bpf_jit_32.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c
> index 6828ef6..a0bd8a7 100644
> --- a/arch/arm/net/bpf_jit_32.c
> +++ b/arch/arm/net/bpf_jit_32.c
> @@ -576,7 +576,7 @@ load_ind:
> /* x = ((*(frame + k)) & 0xf) << 2; */
> ctx->seen |= SEEN_X | SEEN_DATA | SEEN_CALL;
> /* the interpreter should deal with the negative K */
> - if (k < 0)
> + if ((int)k < 0)
> return -1;
> /* offset in r1: we might have to take the slow path */
> emit_mov_i(r_off, k, ctx);
> --
> 1.7.7.6

Acked-by: Mircea Gherzan <[email protected]>

2013-03-12 00:01:35

by Chen Gang

[permalink] [raw]
Subject: Re: [PATCH] ARM:net: an issue for k which is u32, never < 0

?? 2013??03??12?? 00:47, Russell King - ARM Linux д??:
> On Sun, Mar 10, 2013 at 05:12:38PM -0400, David Miller wrote:
>> > From: Chen Gang <[email protected]>
>> > Date: Sun, 10 Mar 2013 10:15:54 +0800
>> >
>>> > >
>>> > > k is u32 which never < 0, need type cast, or cause issue.
>>> > >
>>> > > Signed-off-by: Chen Gang <[email protected]>
>> >
>> > Who will apply this, ARM folks or me?
> I'm happy if you wish to take the patch:
>
> Acked-by: Russell King <[email protected]>
>
> Thanks.
>
>

thank you very much.

:-)

--
Chen Gang

Asianux Corporation

2013-03-12 00:02:10

by Chen Gang

[permalink] [raw]
Subject: Re: [PATCH] ARM:net: an issue for k which is u32, never < 0

?? 2013??03??12?? 00:54, Mircea Gherzan д??:
> 2013/3/10 Chen Gang <[email protected]>:
>> >
>> > k is u32 which never < 0, need type cast, or cause issue.
>> >
>> > Signed-off-by: Chen Gang <[email protected]>
>> > ---
>> > arch/arm/net/bpf_jit_32.c | 2 +-
>> > 1 files changed, 1 insertions(+), 1 deletions(-)
>> >
>> > diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c
>> > index 6828ef6..a0bd8a7 100644
>> > --- a/arch/arm/net/bpf_jit_32.c
>> > +++ b/arch/arm/net/bpf_jit_32.c
>> > @@ -576,7 +576,7 @@ load_ind:
>> > /* x = ((*(frame + k)) & 0xf) << 2; */
>> > ctx->seen |= SEEN_X | SEEN_DATA | SEEN_CALL;
>> > /* the interpreter should deal with the negative K */
>> > - if (k < 0)
>> > + if ((int)k < 0)
>> > return -1;
>> > /* offset in r1: we might have to take the slow path */
>> > emit_mov_i(r_off, k, ctx);
>> > --
>> > 1.7.7.6
> Acked-by: Mircea Gherzan <[email protected]>
>
>

thank you very much.

:-)

--
Chen Gang

Asianux Corporation

2013-03-12 15:33:22

by David Miller

[permalink] [raw]
Subject: Re: [PATCH] ARM:net: an issue for k which is u32, never < 0

From: Russell King - ARM Linux <[email protected]>
Date: Mon, 11 Mar 2013 16:47:41 +0000

> On Sun, Mar 10, 2013 at 05:12:38PM -0400, David Miller wrote:
>> From: Chen Gang <[email protected]>
>> Date: Sun, 10 Mar 2013 10:15:54 +0800
>>
>> >
>> > k is u32 which never < 0, need type cast, or cause issue.
>> >
>> > Signed-off-by: Chen Gang <[email protected]>
>>
>> Who will apply this, ARM folks or me?
>
> I'm happy if you wish to take the patch:
>
> Acked-by: Russell King <[email protected]>

Great, applied, thanks.