From de324cf51daf30ef7ec30f5e3eb1553034ecfb6a Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 22 Sep 2021 09:24:58 +0200 Subject: [PATCH] 4.14-stable patches added patches: s390-bpf-fix-64-bit-subtraction-of-the-0x80000000-constant.patch --- ..._eth-fix-freeing-wrong-tx-descriptor.patch | 9 +--- ...btraction-of-the-0x80000000-constant.patch | 41 +++++++++++++++++++ queue-4.14/series | 1 + 3 files changed, 44 insertions(+), 7 deletions(-) create mode 100644 queue-4.14/s390-bpf-fix-64-bit-subtraction-of-the-0x80000000-constant.patch diff --git a/queue-4.14/net-renesas-sh_eth-fix-freeing-wrong-tx-descriptor.patch b/queue-4.14/net-renesas-sh_eth-fix-freeing-wrong-tx-descriptor.patch index d9e23f53b5f..9238a35a46a 100644 --- a/queue-4.14/net-renesas-sh_eth-fix-freeing-wrong-tx-descriptor.patch +++ b/queue-4.14/net-renesas-sh_eth-fix-freeing-wrong-tx-descriptor.patch @@ -20,14 +20,12 @@ Signed-off-by: Yoshihiro Shimoda Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- - drivers/net/ethernet/renesas/sh_eth.c | 1 + + drivers/net/ethernet/renesas/sh_eth.c | 1 + 1 file changed, 1 insertion(+) -diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c -index 36f1019809ea..0fa6403ab085 100644 --- a/drivers/net/ethernet/renesas/sh_eth.c +++ b/drivers/net/ethernet/renesas/sh_eth.c -@@ -2442,6 +2442,7 @@ static int sh_eth_start_xmit(struct sk_buff *skb, struct net_device *ndev) +@@ -2442,6 +2442,7 @@ static int sh_eth_start_xmit(struct sk_b else txdesc->status |= cpu_to_le32(TD_TACT); @@ -35,6 +33,3 @@ index 36f1019809ea..0fa6403ab085 100644 mdp->cur_tx++; if (!(sh_eth_read(ndev, EDTRR) & sh_eth_get_edtrr_trns(mdp))) --- -2.30.2 - diff --git a/queue-4.14/s390-bpf-fix-64-bit-subtraction-of-the-0x80000000-constant.patch b/queue-4.14/s390-bpf-fix-64-bit-subtraction-of-the-0x80000000-constant.patch new file mode 100644 index 00000000000..fa01f777548 --- /dev/null +++ b/queue-4.14/s390-bpf-fix-64-bit-subtraction-of-the-0x80000000-constant.patch @@ -0,0 +1,41 @@ +From 6e61dc9da0b7a0d91d57c2e20b5ea4fd2d4e7e53 Mon Sep 17 00:00:00 2001 +From: Ilya Leoshkevich +Date: Tue, 7 Sep 2021 13:41:16 +0200 +Subject: s390/bpf: Fix 64-bit subtraction of the -0x80000000 constant + +From: Ilya Leoshkevich + +commit 6e61dc9da0b7a0d91d57c2e20b5ea4fd2d4e7e53 upstream. + +The JIT uses agfi for subtracting constants, but -(-0x80000000) cannot +be represented as a 32-bit signed binary integer. Fix by using algfi in +this particular case. + +Reported-by: Johan Almbladh +Fixes: 054623105728 ("s390/bpf: Add s390x eBPF JIT compiler backend") +Reviewed-by: Heiko Carstens +Signed-off-by: Ilya Leoshkevich +Signed-off-by: Vasily Gorbik +Signed-off-by: Greg Kroah-Hartman +--- + arch/s390/net/bpf_jit_comp.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +--- a/arch/s390/net/bpf_jit_comp.c ++++ b/arch/s390/net/bpf_jit_comp.c +@@ -626,8 +626,13 @@ static noinline int bpf_jit_insn(struct + case BPF_ALU64 | BPF_SUB | BPF_K: /* dst = dst - imm */ + if (!imm) + break; +- /* agfi %dst,-imm */ +- EMIT6_IMM(0xc2080000, dst_reg, -imm); ++ if (imm == -0x80000000) { ++ /* algfi %dst,0x80000000 */ ++ EMIT6_IMM(0xc20a0000, dst_reg, 0x80000000); ++ } else { ++ /* agfi %dst,-imm */ ++ EMIT6_IMM(0xc2080000, dst_reg, -imm); ++ } + break; + /* + * BPF_MUL diff --git a/queue-4.14/series b/queue-4.14/series index 019bac67968..6deb6699d46 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -214,3 +214,4 @@ net-dsa-b53-fix-calculating-number-of-switch-ports.patch netfilter-socket-icmp6-fix-use-after-scope.patch qlcnic-remove-redundant-unlock-in-qlcnic_pinit_from_.patch net-renesas-sh_eth-fix-freeing-wrong-tx-descriptor.patch +s390-bpf-fix-64-bit-subtraction-of-the-0x80000000-constant.patch -- 2.47.3