[4.2.y-ckt stable] Patch "arm64: bpf: fix div-by-zero case" has been added to staging queue

2016-01-04 Thread Kamal Mostafa
This is a note to let you know that I have just added a patch titled arm64: bpf: fix div-by-zero case to the linux-4.2.y-queue branch of the 4.2.y-ckt extended stable tree which can be found at: http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-4.2.y-queue This patch is schedu

[3.19.y-ckt stable] Patch "arm64: bpf: fix div-by-zero case" has been added to staging queue

2015-11-30 Thread Kamal Mostafa
This is a note to let you know that I have just added a patch titled arm64: bpf: fix div-by-zero case to the linux-3.19.y-queue branch of the 3.19.y-ckt extended stable tree which can be found at: http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-3.19.y-queue This patch is sch

Re: [PATCH] arm64: bpf: fix div-by-zero case

2015-11-04 Thread Daniel Borkmann
On 11/04/2015 07:41 PM, Shi, Yang wrote: ... Agreed, and we may need add one more test cases in test_bpf module to cover MOD? Let me know if you have a test case ready :) Does the below change look like a valid test? + "MOD default X", + .u.insns = { +

Re: [PATCH] arm64: bpf: fix div-by-zero case

2015-11-04 Thread Z Lim
On Wed, Nov 4, 2015 at 10:21 AM, Shi, Yang wrote: > On 11/3/2015 11:04 PM, Xi Wang wrote: >> >> On Tue, Nov 3, 2015 at 10:56 PM, Zi Shen Lim wrote: >>> >>> case BPF_ALU | BPF_DIV | BPF_X: >>> case BPF_ALU64 | BPF_DIV | BPF_X: >>> + { >>> + const u8 r0 = bpf2a

Re: [PATCH] arm64: bpf: fix div-by-zero case

2015-11-04 Thread Shi, Yang
On 11/4/2015 10:25 AM, Z Lim wrote: On Wed, Nov 4, 2015 at 10:21 AM, Shi, Yang wrote: On 11/3/2015 11:04 PM, Xi Wang wrote: On Tue, Nov 3, 2015 at 10:56 PM, Zi Shen Lim wrote: case BPF_ALU | BPF_DIV | BPF_X: case BPF_ALU64 | BPF_DIV | BPF_X: + { + co

Re: [PATCH] arm64: bpf: fix div-by-zero case

2015-11-04 Thread Shi, Yang
On 11/3/2015 11:04 PM, Xi Wang wrote: On Tue, Nov 3, 2015 at 10:56 PM, Zi Shen Lim wrote: case BPF_ALU | BPF_DIV | BPF_X: case BPF_ALU64 | BPF_DIV | BPF_X: + { + const u8 r0 = bpf2a64[BPF_REG_0]; + + /* if (src == 0) return 0 */ +

Re: [PATCH] arm64: bpf: fix div-by-zero case

2015-11-04 Thread Shi, Yang
On 11/3/2015 10:56 PM, Zi Shen Lim wrote: In the case of division by zero in a BPF program: A = A / X; (X == 0) the expected behavior is to terminate with return value 0. This is confirmed by the test case introduced in commit 86bf1721b226 ("test_bpf: add tests checking that JIT/interpr

Re: [PATCH] arm64: bpf: fix div-by-zero case

2015-11-03 Thread Xi Wang
On Tue, Nov 3, 2015 at 10:56 PM, Zi Shen Lim wrote: > case BPF_ALU | BPF_DIV | BPF_X: > case BPF_ALU64 | BPF_DIV | BPF_X: > + { > + const u8 r0 = bpf2a64[BPF_REG_0]; > + > + /* if (src == 0) return 0 */ > + jmp_offset = 3; /* skip ahe

[PATCH] arm64: bpf: fix div-by-zero case

2015-11-03 Thread Zi Shen Lim
In the case of division by zero in a BPF program: A = A / X; (X == 0) the expected behavior is to terminate with return value 0. This is confirmed by the test case introduced in commit 86bf1721b226 ("test_bpf: add tests checking that JIT/interpreter sets A and X to 0."). Reported-by: Shi