Message ID | 20210319121747.889614823@linuxfoundation.org |
---|---|
State | Superseded |
Headers | show
Return-Path: <stable-owner@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB2D6C43333 for <stable@archiver.kernel.org>; Fri, 19 Mar 2021 12:22:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8861764F79 for <stable@archiver.kernel.org>; Fri, 19 Mar 2021 12:22:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231368AbhCSMVx (ORCPT <rfc822;stable@archiver.kernel.org>); Fri, 19 Mar 2021 08:21:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:60476 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231492AbhCSMVe (ORCPT <rfc822;stable@vger.kernel.org>); Fri, 19 Mar 2021 08:21:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E2E8964F78; Fri, 19 Mar 2021 12:21:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1616156494; bh=iFnsLUmsfMqS12sCw6XbUg0R64wS1TBt045tHe0NMtU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=13TnhMr6Ocqu5VHp97b18KyTGzVwaq1AgKzgLI6KtmBg3Rfo9Hn/OmVfAWo7k+HkA R3xknxU5wtIZqxKIV1zqkbDviAYv+yIX9FQfTYwQu7GrzqeX6Bi/v4GF+Tzc+Pk4Uj CQbTkHY+3hK5sDiB67QJPNj8GtBuXGD5yoX7jlDI= From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, Piotr Krysiuk <piotras@gmail.com>, Daniel Borkmann <daniel@iogearbox.net>, Alexei Starovoitov <ast@kernel.org> Subject: [PATCH 5.11 21/31] bpf: Fix off-by-one for area size in creating mask to left Date: Fri, 19 Mar 2021 13:19:15 +0100 Message-Id: <20210319121747.889614823@linuxfoundation.org> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20210319121747.203523570@linuxfoundation.org> References: <20210319121747.203523570@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: <stable.vger.kernel.org> X-Mailing-List: stable@vger.kernel.org |
Series |
None
|
expand
|
--- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -5398,13 +5398,13 @@ static int retrieve_ptr_limit(const stru */ off = ptr_reg->off + ptr_reg->var_off.value; if (mask_to_left) - *ptr_limit = MAX_BPF_STACK + off; + *ptr_limit = MAX_BPF_STACK + off + 1; else *ptr_limit = -off; return 0; case PTR_TO_MAP_VALUE: if (mask_to_left) { - *ptr_limit = ptr_reg->umax_value + ptr_reg->off; + *ptr_limit = ptr_reg->umax_value + ptr_reg->off + 1; } else { off = ptr_reg->smin_value + ptr_reg->off; *ptr_limit = ptr_reg->map_ptr->value_size - off;