Received: by 10.213.65.68 with SMTP id h4csp482511imn; Fri, 16 Mar 2018 09:06:05 -0700 (PDT) X-Google-Smtp-Source: AG47ELuBiZhTTh0W6doAOj/w1WTs4maNQOLQQoIYX0OJMFNV1LT+jigyftiT3a8y1z9TTkPa1C+u X-Received: by 10.98.246.16 with SMTP id x16mr1999390pfh.81.1521216365826; Fri, 16 Mar 2018 09:06:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521216365; cv=none; d=google.com; s=arc-20160816; b=DWRDiJbtUw97A8EjTGitmydzepVDetgtv7DhIoVVVzTalScI+M1e9mh3yqat57NP4y 9AZ9bDPnaWU9mRiIzHJcQjUcQGA+NYR7rDdvtozc+hhe79QNc6+iJclSv041+wbzW6W+ 9qBZBplxyYx61SxkeVVnJKZw9DfHc8JnxtRqtOP6G2LiuIH3Ly+j8Vz41lrNcafBKlUz 2dCJJ7LuD+qlxFxxTuJqHbnHUxK5ultI/fIB79jJG6kK5cAkxR9my+gEgp0rnOOvxgj6 Mren3PvTeq+hD7sTJgohPnQ+JfELqihUNSCB3OSKWkMnsB0Ice8u3d6nN3PNVQFGOh3I IgeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=E4WtrVqh9br/TJ1Y/xoVKIuaOhb+6lQYpXWMlJG3Lz4=; b=pdmSO4tKaYS0gXZPvEaFOlzZ8/7MwebDqM3Xnr38KGD5asNKCrtNVbjqQERzRy6jjY h9u8K+5NktgKmBSSwM09EI35Gd6aS2GEESocr+NstzIyZ113cI1x2WUddDjPk2P4+ZCt BgPmtIjrv1WeBi2XJ3kXaBrZntVVfSM6sy5Kqg8uQNKL0kSEGpoa7NMW+9vCmYdywmRA PibYMeCnC14z8MFsYqPqQdJqwk9Gth1xJUaeqdDF5R7S46E4y5yHVgAd2Fb2Y9NHWqs/ 5+jnIS2PqdR9tMiTxoTrO8EDlS8RRvSyBXIycX32ajpWpauu75BUb1+G8wCECvo1ty+H iXMQ== ARC-Authentication-Results: i=1; mx.google.com; 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 s3-v6si6347327plb.4.2018.03.16.09.05.51; Fri, 16 Mar 2018 09:06:05 -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; 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 S1754888AbeCPPmV (ORCPT + 99 others); Fri, 16 Mar 2018 11:42:21 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:44380 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754849AbeCPPmM (ORCPT ); Fri, 16 Mar 2018 11:42:12 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 35CE2E98; Fri, 16 Mar 2018 15:42:11 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexei Starovoitov , John Fastabend , Daniel Borkmann , Sasha Levin Subject: [PATCH 4.15 067/128] bpf: fix stack state printing in verifier log Date: Fri, 16 Mar 2018 16:23:28 +0100 Message-Id: <20180316152340.081730873@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180316152336.199007505@linuxfoundation.org> References: <20180316152336.199007505@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Alexei Starovoitov [ Upstream commit 12a3cc8424fe1237aaeb982dec4f0914ddd22f3e ] fix incorrect stack state prints in print_verifier_state() Fixes: 638f5b90d460 ("bpf: reduce verifier memory consumption") Signed-off-by: Alexei Starovoitov Acked-by: John Fastabend Acked-by: Daniel Borkmann Signed-off-by: Daniel Borkmann Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- kernel/bpf/verifier.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -279,7 +279,7 @@ static void print_verifier_state(struct for (i = 0; i < state->allocated_stack / BPF_REG_SIZE; i++) { if (state->stack[i].slot_type[0] == STACK_SPILL) verbose(env, " fp%d=%s", - -MAX_BPF_STACK + i * BPF_REG_SIZE, + (-i - 1) * BPF_REG_SIZE, reg_type_str[state->stack[i].spilled_ptr.type]); } verbose(env, "\n");