public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	patches@lists.linux.dev, Dan Carpenter <dan.carpenter@linaro.org>,
	Florian Westphal <fw@strlen.de>,
	Pablo Neira Ayuso <pablo@netfilter.org>,
	Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH 6.11 07/12] netfilter: nft_socket: Fix a NULL vs IS_ERR() bug in nft_socket_cgroup_subtree_level()
Date: Fri, 27 Sep 2024 14:24:10 +0200	[thread overview]
Message-ID: <20240927121715.557785873@linuxfoundation.org> (raw)
In-Reply-To: <20240927121715.213013166@linuxfoundation.org>

6.11-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Dan Carpenter <dan.carpenter@linaro.org>

commit 7052622fccb1efb850c6b55de477f65d03525a30 upstream.

The cgroup_get_from_path() function never returns NULL, it returns error
pointers.  Update the error handling to match.

Fixes: 7f3287db6543 ("netfilter: nft_socket: make cgroupsv2 matching work with namespaces")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Acked-by: Florian Westphal <fw@strlen.de>
Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
Link: https://patch.msgid.link/bbc0c4e0-05cc-4f44-8797-2f4b3920a820@stanley.mountain
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/netfilter/nft_socket.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/net/netfilter/nft_socket.c
+++ b/net/netfilter/nft_socket.c
@@ -61,8 +61,8 @@ static noinline int nft_socket_cgroup_su
 	struct cgroup *cgrp = cgroup_get_from_path("/");
 	int level;
 
-	if (!cgrp)
-		return -ENOENT;
+	if (IS_ERR(cgrp))
+		return PTR_ERR(cgrp);
 
 	level = cgrp->level;
 



  parent reply	other threads:[~2024-09-27 12:30 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-27 12:24 [PATCH 6.11 00/12] 6.11.1-rc1 review Greg Kroah-Hartman
2024-09-27 12:24 ` [PATCH 6.11 01/12] drm: Use XArray instead of IDR for minors Greg Kroah-Hartman
2024-09-27 12:24 ` [PATCH 6.11 02/12] accel: " Greg Kroah-Hartman
2024-09-27 12:24 ` [PATCH 6.11 03/12] drm: Expand max DRM device number to full MINORBITS Greg Kroah-Hartman
2024-09-27 12:24 ` [PATCH 6.11 04/12] powercap/intel_rapl: Add support for AMD family 1Ah Greg Kroah-Hartman
2024-09-27 12:24 ` [PATCH 6.11 05/12] powercap/intel_rapl: Fix the energy-pkg event for AMD CPUs Greg Kroah-Hartman
2024-09-27 12:24 ` [PATCH 6.11 06/12] cpufreq/amd-pstate: Add the missing cpufreq_cpu_put() Greg Kroah-Hartman
2024-09-27 12:24 ` Greg Kroah-Hartman [this message]
2024-09-27 12:24 ` [PATCH 6.11 08/12] Bluetooth: btintel_pcie: Allocate memory for driver private data Greg Kroah-Hartman
2024-09-27 12:24 ` [PATCH 6.11 09/12] ASoC: amd: acp: add ZSC control register programming sequence Greg Kroah-Hartman
2024-09-27 12:24 ` [PATCH 6.11 10/12] nvme-pci: qdepth 1 quirk Greg Kroah-Hartman
2024-09-27 12:24 ` [PATCH 6.11 11/12] USB: serial: pl2303: add device id for Macrosilicon MS3020 Greg Kroah-Hartman
2024-09-27 12:24 ` [PATCH 6.11 12/12] USB: usbtmc: prevent kernel-usb-infoleak Greg Kroah-Hartman
2024-09-27 17:46 ` [PATCH 6.11 00/12] 6.11.1-rc1 review Peter Schneider
2024-09-27 18:36 ` Jon Hunter
2024-09-27 18:51 ` Justin Forbes
2024-09-27 19:38 ` Christian Heusel
2024-09-27 19:53 ` Florian Fainelli
2024-09-28 13:42 ` Naresh Kamboju
2024-09-28 15:06 ` Allen
2024-09-28 17:15 ` Shuah Khan
2024-09-29  8:20 ` Ron Economos
2024-09-29 10:58 ` Kexy Biscuit
2024-09-29 11:32 ` Muhammad Usama Anjum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240927121715.557785873@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=dan.carpenter@linaro.org \
    --cc=fw@strlen.de \
    --cc=kuba@kernel.org \
    --cc=pablo@netfilter.org \
    --cc=patches@lists.linux.dev \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox