Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp1269702ybj; Fri, 20 Sep 2019 07:49:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqw5OnrTdu00mHgUWUKVIXEEDTImzIjnOleaxzdcCm8fV7GwwWGudtyraXNIvDSwXT0TjFGC X-Received: by 2002:a50:fd10:: with SMTP id i16mr20027918eds.239.1568990982458; Fri, 20 Sep 2019 07:49:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568990982; cv=none; d=google.com; s=arc-20160816; b=SDbFo1SL14KNUkUfCS81l6h/YrROebnfryiHI+P+wV/Ig0Rbb4XHSdxc7BqaKyanGx qJE3LfKvG2NoXBdG7vLsC6wG+QhJd0CRB34phOR9wIwk7UfJE475Jx9YRlxokMthBhiy cIg6S5YA1meORLcu43LQwDaH/XNq9jqaZiBY1v7JkvgidBY0gU3nR95H7JACkTY9CnUp kGAZYfzhp6Bs+jZWT5FiQOfh++xEWxugTYQT8vcgJA7n640oiIonOiT06QKNUNQNL8Bn xWr24iN707sq+XUS9wULcf2KTG/eMhu3ODCeg6kxvTAFMuZcBBuD1PRX9DMj4FS+sgQv 56ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=jDhRTeDAP0ggPdBJfkwqQAT4VCsNuuo8uyYKpCy974M=; b=uMnPq1+5i8iEULYMt72GEi3gk5v3YPrKx3GpUD3/qdjKSVa0c2Bix25DNjzwHfbV5B BU8yFJIm5GIYZtMLyFIXtuQxU6lwe/SvzzPVEdeIeb7pDgIqi43LRAYZmsNFMl3shP7M wzVhFk35MndzfeaN05Eq3gMgDvoweWiSfSIYJVRZS50+yNIuY/ya/nLUwyBbVjl9Qwiy rfEwS/sUfc99ANL4r0fXtPIRIKZvEAotNRB0Iz8sjQr/kTODZCXFPlGhPIfUQkqEFNic +jaF5Mkg4jN3+i9fxbhyQ5DFy9+siJXmVdoMRYbN1swtEtTO4uasq6ODOxICA0ncY0wh d8kA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KrIOCHMg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n3si1199367ejd.71.2019.09.20.07.49.19; Fri, 20 Sep 2019 07:49:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KrIOCHMg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403816AbfISWUF (ORCPT + 99 others); Thu, 19 Sep 2019 18:20:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:33782 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390487AbfISWT6 (ORCPT ); Thu, 19 Sep 2019 18:19:58 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D5BD921A49; Thu, 19 Sep 2019 22:19:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568931597; bh=2ibOJCskqyyIBOusPY1iCMu2HpaNxbbIeVYJZPmsBhE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KrIOCHMgqjcJf0AkPmF+2rPZ7VEi/2SxVm9u3tqzWS2CfAJUDvTO7TAYZPEiNg5a5 rbBN/14n6AItaCj12i91mRrgnX1CuWnH4D0Zf8Uriee173R0q4KnZDBvYR4lxSmqjx Yi/SM5wgf9JnpMovO07U5yAtJgFxHqa/mcYsadBY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ilya Leoshkevich , Vasily Gorbik , Daniel Borkmann , Sasha Levin Subject: [PATCH 4.9 45/74] s390/bpf: fix lcgr instruction encoding Date: Fri, 20 Sep 2019 00:03:58 +0200 Message-Id: <20190919214809.196831790@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190919214800.519074117@linuxfoundation.org> References: <20190919214800.519074117@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ilya Leoshkevich [ Upstream commit bb2d267c448f4bc3a3389d97c56391cb779178ae ] "masking, test in bounds 3" fails on s390, because BPF_ALU64_IMM(BPF_NEG, BPF_REG_2, 0) ignores the top 32 bits of BPF_REG_2. The reason is that JIT emits lcgfr instead of lcgr. The associated comment indicates that the code was intended to emit lcgr in the first place, it's just that the wrong opcode was used. Fix by using the correct opcode. Fixes: 054623105728 ("s390/bpf: Add s390x eBPF JIT compiler backend") Signed-off-by: Ilya Leoshkevich Acked-by: Vasily Gorbik Signed-off-by: Daniel Borkmann Signed-off-by: Sasha Levin --- arch/s390/net/bpf_jit_comp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c index 896344b6e0363..e4616090732a4 100644 --- a/arch/s390/net/bpf_jit_comp.c +++ b/arch/s390/net/bpf_jit_comp.c @@ -881,7 +881,7 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i break; case BPF_ALU64 | BPF_NEG: /* dst = -dst */ /* lcgr %dst,%dst */ - EMIT4(0xb9130000, dst_reg, dst_reg); + EMIT4(0xb9030000, dst_reg, dst_reg); break; /* * BPF_FROM_BE/LE -- 2.20.1