Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp987765ybj; Fri, 20 Sep 2019 03:17:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqzEDVEtPk89P7ej17EHDzkRFwIMuRV2SLhD2LOGtY2ys8ArcXU4dgt4cuCi5N6Hc1g8oTfl X-Received: by 2002:a50:d089:: with SMTP id v9mr21650081edd.54.1568974673375; Fri, 20 Sep 2019 03:17:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568974673; cv=none; d=google.com; s=arc-20160816; b=enltpaZx22RpCVMyO5ThKJ6E5/CboQcYdJsAxcuETHQ8e/fF/kUFhBcVpKXe7qQTZn ej66u8V1eOdevwQsPTDVXvY8JdVo01GaTL4fCdLJtGGMQkhVyjn87Nt10Y1pWQr5R/mg sgUDhtsuh1xFUqxtKNXYDWkoEhVZSUqiwxEaE608asU1gC7sG+nlXhIemOf5JKKfVOOS ey/qvQL/T6kXtB+SD5zRgbXxBNEWoFLeOLSZYUKkLTGI9w3Lj2D+/UTLgKwu/0y/wZ+j UDYUy9Jl0gYGQUXy1iRWV1dnmcFkzb79kzfwBAsJRkPBk+DdmisozipXkEB2818Px5kI wytw== 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=z8rVIFlW7DUSSDDRCecPVCZCOcJOPqzPW5+B1TKWYbc=; b=Sb3ObVRsP5OdXgVpIFZfyM3TwHtaRXVZeh0lsChn37VsSsJvW0/IR6uqx1ixOmX1Ff S4FHx83qyfh2lfCazCUM4XTDoyJ6DBSoQ0UPh/0VmyEQXKTmUaihAoQAo6YTbB2giQjs u8zT007y8zpg3feNYqJJgq9sQeCTuSOvrG6Ypum3+C0Wen66r/yHyQqAbqrsuW0oiO9X 7/tfcIc52Dg68JN6RZkRA5RXzbQalZO1cRAxeYuCDPLx2wVcgfVlf0mfk/K/TgAq/v9B Hu46eNBCLcwLOlqxcNS8WTTl0fkMokR+iwa7n/2k4loKMSAaxJZAdfWLqnptt3PSZg29 XxIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VcfpkDdi; 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 i38si1067935eda.64.2019.09.20.03.17.14; Fri, 20 Sep 2019 03:17:53 -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=VcfpkDdi; 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 S2393669AbfISWMm (ORCPT + 99 others); Thu, 19 Sep 2019 18:12:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:51648 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393646AbfISWMk (ORCPT ); Thu, 19 Sep 2019 18:12:40 -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 8FB1D218AF; Thu, 19 Sep 2019 22:12:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568931160; bh=vRRFaWWGUOYTPrur3oc3/d02XUTCjrwdPwVR3rAWPoo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VcfpkDdikl/ANLluzWygUrSd9ksADgPT5Nntyqu/fHsU15ujgpiZ6okwRpclwSCWb M/ls7/0bMc7is4JtbERFhakxezam0+dYn/hwgpBWT6N7KqxnUo8dFQ26+Azr9p7n8A zuEsxCP/0rKZJ5elc2ANfmNS69Of9WAy7nmYNf74= 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.19 24/79] s390/bpf: fix lcgr instruction encoding Date: Fri, 20 Sep 2019 00:03:09 +0200 Message-Id: <20190919214810.111207626@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190919214807.612593061@linuxfoundation.org> References: <20190919214807.612593061@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 d7052cbe984f8..a3ce1fdc3d802 100644 --- a/arch/s390/net/bpf_jit_comp.c +++ b/arch/s390/net/bpf_jit_comp.c @@ -841,7 +841,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