Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp1336311ybj; Fri, 20 Sep 2019 08:51:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqwf8SCLFbzuIUR5CA0Sq5xDQJJNQ35/Nm+K2H8OyvG2seFAEcGbmwEHM363wYqWrMsJe9CG X-Received: by 2002:a17:906:c79a:: with SMTP id cw26mr19485964ejb.265.1568994668562; Fri, 20 Sep 2019 08:51:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568994668; cv=none; d=google.com; s=arc-20160816; b=r8iTt2zBMkvSPO8oZIhJnZw3/f5o6Vl4oV26ttfVpEl/jfPHeoAnzOnPAJ/fTqIF1/ GYXAlpS2PnnLol6X6tRYMUn5XnLu3AmCD6bhehjXVWpa4eYWni93ozM7HfSVNiKdyjDp uhA6fS9Ve5SfLrTiMHRIPWb/8fqVL+COIZMFOU+FCLSD+c1bshRq2B4E00aeCTTCxJtp o/jqRAysv+S/w+wkeUJGXKEK/wTauzYuQNFBr4UEs8hnpE5NHUmqKRC1bxgu84+PHgzG OWrH3BS+qZUHNFdO/zb+lJUQ9R0aB8UmqjbC3BIDz3Yhd3bGgYyMV5jj5LGhUGwZydpU gaeA== 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=Zpv3AODYt4jCKCiN5v2fv9wOhK/QMk8xE8gxGpURWFk=; b=CHCbeqxDQQQ0opuH7Dt6kSqHEcDY/7nhGfPJrxLJfh1DIgDi93nNGucnzGYP16d20c jOPskGu5+UfScgJuuBbxrnLhaDE6kUZlC2RxvlhBquWbgyQFaJo7MFQbu+MUVNUKSDeW sNoL9zeOJAu/WR5VeXN6Ww1wcOjiF1NIt2UzApxm+oR0o9lhMzZELWmC20gUgfEWE77x m+6T+RnXH7pgB75xJEeIhJG9n4LsH9zMVOf7IqqfXv4qgidtsUWTqFuVz0T/OpKBNnwQ G9RPgzx4zDiuUZq2+385zxHHogUAxp9CR0X9l/BWI+mH9+NcxjUAdXC0pLXnP3tlpaBg 0Ipw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZBRXdJP9; 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 h15si1581491eda.284.2019.09.20.08.50.45; Fri, 20 Sep 2019 08:51:08 -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=ZBRXdJP9; 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 S2407106AbfISWYG (ORCPT + 99 others); Thu, 19 Sep 2019 18:24:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:40038 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2407096AbfISWYD (ORCPT ); Thu, 19 Sep 2019 18:24:03 -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 3EF9021920; Thu, 19 Sep 2019 22:24:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568931841; bh=oAccNfbSXfw152/LAL/LhbXvHUYErX5skTH3a8n2azk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZBRXdJP9P+4gJGkzlk7xpRVpXpY1FrRnrR/brT7T4o5uaepfUbZPCibx6vtuwvjB+ fSvkESuc6aDcWWLEozbEhao9LavcTNvrnkETGbNlabefShg6fixRyL37LTxBkKbPGF SkaYZd56UnuDqf2/7/0JcH3/8BP+SuXV+X/Xjv3c= 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.4 35/56] s390/bpf: fix lcgr instruction encoding Date: Fri, 20 Sep 2019 00:04:16 +0200 Message-Id: <20190919214757.771079796@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190919214742.483643642@linuxfoundation.org> References: <20190919214742.483643642@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 727693e283da2..e53d410e88703 100644 --- a/arch/s390/net/bpf_jit_comp.c +++ b/arch/s390/net/bpf_jit_comp.c @@ -886,7 +886,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