From patchwork Sat Sep 16 00:48:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cengiz Can X-Patchwork-Id: 1835336 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RnXfL62Zzz1ygG for ; Sat, 16 Sep 2023 10:55:22 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1qhJaU-0003AO-CK; Sat, 16 Sep 2023 00:55:08 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1qhJXW-0000CZ-7a for kernel-team@lists.ubuntu.com; Sat, 16 Sep 2023 00:52:03 +0000 Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 80B253F627 for ; Sat, 16 Sep 2023 00:52:01 +0000 (UTC) Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-1c0aaf4caaaso23612075ad.2 for ; Fri, 15 Sep 2023 17:52:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694825519; x=1695430319; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0Vq+SWo5EJjLE6cRv/AtRrEv5dYRq5CP/e//gFd8QYQ=; b=euKjcK1TjbZaV84kXFkeaqfnZdBnpaeX9R9rZIRIa9z3oWoD4uHupuDUGYonMaJ6tG jVaHxrrBAgCrCmY8ebSac2HMn2D1e9BgzBSnB79aff9bnyQjm/tMMLjZy1g18P9G06T2 Ue2WY08yASCQeaFgKSb2j9rJE1JWqzqv7sbQ3JNXU8MHOxEOdq1I+lMIK/yMwOupgXZn XIV46C5ZNgScFhXi3kAStB+nPkC3SdWCFL0h+eSML9G1koV24nGxKnHR1OZf57uZLU9t GSjkyUBbKLtLUa31sqPlzNRpA9dXb8CUt+N7zAoM3GOwsrHn+WFTlDcVusEGqPQxYSiA Ktzg== X-Gm-Message-State: AOJu0YxBj86h1pWPmuantmlC3OVUYnzr0iwlatf5qJJ5OQpfDLeRnTxv l2K0NDKKhHqJVWspWzAYuBEnJ4Irlz7gxy6kCzK29UxBiImpwhiXYqvf04fOPnLXF7+qfUZvzAz Fn4bTg5UyoS9E+deEvK54GygBySjNNCztjjKpxeIl9Koq1pID6w/W X-Received: by 2002:a17:902:e805:b0:1c0:6e92:8cc5 with SMTP id u5-20020a170902e80500b001c06e928cc5mr3795604plg.17.1694825519398; Fri, 15 Sep 2023 17:51:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGQnrv0kB91Fa07ra+7ct+OuJtWb0HVckBPZWwmm8IbEqF5UUVkyZURzlo7uGk5fHVEZgtbSA== X-Received: by 2002:a17:902:e805:b0:1c0:6e92:8cc5 with SMTP id u5-20020a170902e80500b001c06e928cc5mr3795597plg.17.1694825519097; Fri, 15 Sep 2023 17:51:59 -0700 (PDT) Received: from localhost (uk.sesame.canonical.com. [185.125.190.60]) by smtp.gmail.com with ESMTPSA id ix11-20020a170902f80b00b001c3a7fbf96fsm330471plb.216.2023.09.15.17.51.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 17:51:58 -0700 (PDT) From: Cengiz Can To: kernel-team@lists.ubuntu.com Subject: [SRU Jammy, OEM-6.0, OEM-6.1, Lunar] netfilter: nft_dynset: disallow object maps Date: Sat, 16 Sep 2023 03:48:39 +0300 Message-Id: <20230916004839.706452-30-cengiz.can@canonical.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230916004839.706452-1-cengiz.can@canonical.com> References: <20230916004839.706452-1-cengiz.can@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Pablo Neira Ayuso Do not allow to insert elements from datapath to objects maps. Fixes: 8aeff920dcc9 ("netfilter: nf_tables: add stateful object reference to set elements") Signed-off-by: Pablo Neira Ayuso Signed-off-by: Florian Westphal (cherry picked from commit 23185c6aed1ffb8fc44087880ba2767aba493779) CVE-2023-4244 Signed-off-by: Cengiz Can --- net/netfilter/nft_dynset.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/netfilter/nft_dynset.c b/net/netfilter/nft_dynset.c index e65a83328b55..cf9a1ae87d9b 100644 --- a/net/netfilter/nft_dynset.c +++ b/net/netfilter/nft_dynset.c @@ -191,6 +191,9 @@ static int nft_dynset_init(const struct nft_ctx *ctx, if (IS_ERR(set)) return PTR_ERR(set); + if (set->flags & NFT_SET_OBJECT) + return -EOPNOTSUPP; + if (set->ops->update == NULL) return -EOPNOTSUPP;