From 2bf875778039830335b23507fc35bf8a92b868b2 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 22 Sep 2021 09:25:15 +0200 Subject: [PATCH] 4.19-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.19/series | 1 + 3 files changed, 44 insertions(+), 7 deletions(-) create mode 100644 queue-4.19/s390-bpf-fix-64-bit-subtraction-of-the-0x80000000-constant.patch diff --git a/queue-4.19/net-renesas-sh_eth-fix-freeing-wrong-tx-descriptor.patch b/queue-4.19/net-renesas-sh_eth-fix-freeing-wrong-tx-descriptor.patch index eac06ccdd59..3738b63cf5a 100644 --- a/queue-4.19/net-renesas-sh_eth-fix-freeing-wrong-tx-descriptor.patch +++ b/queue-4.19/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 394ab9cdfe2c..c44aea47c120 100644 --- a/drivers/net/ethernet/renesas/sh_eth.c +++ b/drivers/net/ethernet/renesas/sh_eth.c -@@ -2547,6 +2547,7 @@ static int sh_eth_start_xmit(struct sk_buff *skb, struct net_device *ndev) +@@ -2547,6 +2547,7 @@ static int sh_eth_start_xmit(struct sk_b else txdesc->status |= cpu_to_le32(TD_TACT); @@ -35,6 +33,3 @@ index 394ab9cdfe2c..c44aea47c120 100644 mdp->cur_tx++; if (!(sh_eth_read(ndev, EDTRR) & mdp->cd->edtrr_trns)) --- -2.30.2 - diff --git a/queue-4.19/s390-bpf-fix-64-bit-subtraction-of-the-0x80000000-constant.patch b/queue-4.19/s390-bpf-fix-64-bit-subtraction-of-the-0x80000000-constant.patch new file mode 100644 index 00000000000..eb7d59a7581 --- /dev/null +++ b/queue-4.19/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 +@@ -595,8 +595,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.19/series b/queue-4.19/series index ede42a5bcc8..fc45da72f24 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -291,3 +291,4 @@ fq_codel-reject-silly-quantum-parameters.patch qlcnic-remove-redundant-unlock-in-qlcnic_pinit_from_.patch ip_gre-validate-csum_start-only-on-pull.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