Message ID | 20220426081731.882026527@linuxfoundation.org |
---|---|
State | New |
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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 49EBFC433F5 for <stable@archiver.kernel.org>; Tue, 26 Apr 2022 08:23:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344653AbiDZI0l (ORCPT <rfc822;stable@archiver.kernel.org>); Tue, 26 Apr 2022 04:26:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344618AbiDZI0k (ORCPT <rfc822;stable@vger.kernel.org>); Tue, 26 Apr 2022 04:26:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0484C3A70A; Tue, 26 Apr 2022 01:23:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7FB0F6179E; Tue, 26 Apr 2022 08:23:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85024C385AE; Tue, 26 Apr 2022 08:23:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650961380; bh=b36//AFiKMB+JyNbPfsDFlxmv59m57iQXgWwjXEm3UQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qVVAljsRGdfIK2IlHHg8PFmJvfjgVm5SfRgNAXVispQanNT5An0KlbpnjTzrWwHuB 24b6+6PTGad9NuyTQYz6nCwu1F76siNxNY+K0D4tSS+5p4GvZXP3Yt++gtHCDicdUv Q2Ef2UrHh9u/rJBZcRVJ7v29n1vxw1pBMksAjrIU= From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, Paolo Valerio <pvalerio@redhat.com>, Eelco Chaudron <echaudro@redhat.com>, "David S. Miller" <davem@davemloft.net> Subject: [PATCH 4.9 17/24] openvswitch: fix OOB access in reserve_sfa_size() Date: Tue, 26 Apr 2022 10:21:11 +0200 Message-Id: <20220426081731.882026527@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220426081731.370823950@linuxfoundation.org> References: <20220426081731.370823950@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/net/openvswitch/flow_netlink.c +++ b/net/openvswitch/flow_netlink.c @@ -1863,7 +1863,7 @@ static struct nlattr *reserve_sfa_size(s new_acts_size = max(next_offset + req_size, ksize(*sfa) * 2); if (new_acts_size > MAX_ACTIONS_BUFSIZE) { - if ((MAX_ACTIONS_BUFSIZE - next_offset) < req_size) { + if ((next_offset + req_size) > MAX_ACTIONS_BUFSIZE) { OVS_NLERR(log, "Flow action size exceeds max %u", MAX_ACTIONS_BUFSIZE); return ERR_PTR(-EMSGSIZE);