Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp883637yba; Thu, 18 Apr 2019 11:09:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqzlTHAjaA3TSSXTWUj2troaM0dqO362AyxgVh//XI8kHUUCMGPZK8WyzZo0dlGX87kuVcAN X-Received: by 2002:a63:4c:: with SMTP id 73mr52018834pga.210.1555610992814; Thu, 18 Apr 2019 11:09:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555610992; cv=none; d=google.com; s=arc-20160816; b=Chk+ax5LLjy1jYpkdOY1eW/qT1nK4vG7M4wTuk9TucAuMKjtsfs39+jCpndqqabMuq BEoT8AEf7N9EcqS/pEgu0F9ZUlKoR2OmfrYd92ubj3fLUq8pUmi+vTpS3TM9Z51msm9t GOd+RGot8FjRbaEh/wxAHTfZ1k8cm1dNenq7romMIrNxu1IGF+fj7qi5pV++SiUqMsMl iazCuC32KTaL6e7H/6JRNQi3KRQ/GKzitXH4IKhJN1sSvLN7KYVLtA5dZ04uYyRABNRB fuOZcSBPXCFawnnAfKnmfushA6nwGzj095ui7mzZdPieuDDFivM7duZpF+zb4tDPrtqI 1lTw== 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=6R5zvjLbP4UTJ1uk/uTwQo+sbvtIN5KrZpx2aq5v/GI=; b=qzcsQl7KcfDyqeo6MiwHnAV6kRtbUiAPPvY/It4xUUgnX3f1Eqctp5d/T2I/H3YFkX A9gLF7Sd9JYkElPCX7ugibubGm+dOqnthLAsXfk7vEAtxKJDkpemlXADB1/SB+FwjYAX dKezWVNPja+d0DwqxcJq4zi/SXpZ3QvJwLcqAFyGI8HevYs+PIe/gRAwsg2L1KPw4Uxz zvrUJ4Knzs9ULeHde9BbuNiK9TkGBLE6viCQfmfbE3uiCApaAkAJ9/LyvGvM1pxW59lZ 70IjzKHoQfWsYRhPDAyAUV+hgEUwrBsUxanNzF855HfFpi52Yya8vN11qrFQS4aQwX9M K8rQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cBxNInE+; 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 f12si2683010plt.418.2019.04.18.11.09.38; Thu, 18 Apr 2019 11:09:52 -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=cBxNInE+; 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 S2403811AbfDRSGo (ORCPT + 99 others); Thu, 18 Apr 2019 14:06:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:36580 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391139AbfDRSGk (ORCPT ); Thu, 18 Apr 2019 14:06: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 A1517206B6; Thu, 18 Apr 2019 18:06:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555610800; bh=NdzKe5BDkBRIabUE+og0H+eosUElUxR8hVa0HSawUPQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cBxNInE+PKdGjL7Nv4JQ81QNQMuCxJotKdqQ71YLeGcu/EPURGDMIFq8IwlAPuX3g xIw1eUPZxOHr/XzdVwCzw2jQ+zxA7jWtDlk0Pf6uTtwjQErasSHGRst4LGwlCD/lKe gPJQkfPS4Q6DG73hkYduZMkQmO4tc9cP2vn89sJU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Balbir Singh Subject: [PATCH 4.14 89/92] bpf: Fix selftests are changes for CVE 2019-7308 Date: Thu, 18 Apr 2019 19:57:47 +0200 Message-Id: <20190418160438.269695961@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190418160430.325165109@linuxfoundation.org> References: <20190418160430.325165109@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: Balbir Singh The changes to fix the CVE 2019-7308 make the bpf verifier stricter with respect to operations that were allowed earlier in unprivileged mode. Fixup the test cases so that the error messages now correctly reflect pointer arithmetic going out of range for tests. Signed-off-by: Balbir Singh Signed-off-by: Greg Kroah-Hartman --- tools/testing/selftests/bpf/test_verifier.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/tools/testing/selftests/bpf/test_verifier.c +++ b/tools/testing/selftests/bpf/test_verifier.c @@ -1860,6 +1860,7 @@ static struct bpf_test tests[] = { }, .result = REJECT, .errstr = "invalid stack off=-79992 size=8", + .errstr_unpriv = "R1 stack pointer arithmetic goes out of range", }, { "PTR_TO_STACK store/load - out of bounds high", @@ -2243,6 +2244,8 @@ static struct bpf_test tests[] = { BPF_EXIT_INSN(), }, .result = ACCEPT, + .result_unpriv = REJECT, + .errstr_unpriv = "R1 stack pointer arithmetic goes out of range", }, { "unpriv: cmp of stack pointer", @@ -7013,6 +7016,7 @@ static struct bpf_test tests[] = { }, .fixup_map1 = { 3 }, .errstr = "pointer offset 1073741822", + .errstr_unpriv = "R0 pointer arithmetic of map value goes out of range", .result = REJECT }, { @@ -7034,6 +7038,7 @@ static struct bpf_test tests[] = { }, .fixup_map1 = { 3 }, .errstr = "pointer offset -1073741822", + .errstr_unpriv = "R0 pointer arithmetic of map value goes out of range", .result = REJECT }, { @@ -7203,6 +7208,7 @@ static struct bpf_test tests[] = { BPF_EXIT_INSN() }, .errstr = "fp pointer offset 1073741822", + .errstr_unpriv = "R1 stack pointer arithmetic goes out of range", .result = REJECT }, {