mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Siddh Raman Pant <siddh.raman.pant@oracle.com>
To: "stable@vger.kernel.org" <stable@vger.kernel.org>,
	"pablo@netfilter.org" <pablo@netfilter.org>
Cc: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"netfilter-devel@vger.kernel.org"
	<netfilter-devel@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: CVE-2024-39503: netfilter: ipset: Fix race between namespace cleanup and gc in the list:set type
Date: Wed, 7 Aug 2024 06:42:14 +0000	[thread overview]
Message-ID: <c44971f608d7d1d2733757112ef6fca87b004d17.camel@oracle.com> (raw)
In-Reply-To: <2024071204-CVE-2024-39503-e604@gregkh>

[-- Attachment #1: Type: text/plain, Size: 1521 bytes --]

On Fri, 12 Jul 2024 14:21:09 +0200, Greg Kroah-Hartman wrote:
> In the Linux kernel, the following vulnerability has been resolved:
> 
> netfilter: ipset: Fix race between namespace cleanup and gc in the list:set type
> 
> Lion Ackermann reported that there is a race condition between namespace cleanup
> in ipset and the garbage collection of the list:set type. The namespace
> cleanup can destroy the list:set type of sets while the gc of the set type is
> waiting to run in rcu cleanup. The latter uses data from the destroyed set which
> thus leads use after free. The patch contains the following parts:
> 
> - When destroying all sets, first remove the garbage collectors, then wait
>   if needed and then destroy the sets.
> - Fix the badly ordered "wait then remove gc" for the destroy a single set
>   case.
> - Fix the missing rcu locking in the list:set type in the userspace test
>   case.
> - Use proper RCU list handlings in the list:set type.
> 
> The patch depends on c1193d9bbbd3 (netfilter: ipset: Add list flush to cancel_gc).

This commit does not exist in stable kernels. Please backport it.

	netfilter: ipset: Add list flush to cancel_gc
	
	Flushing list in cancel_gc drops references to other lists right away,
	without waiting for RCU to destroy list. Fixes race when referenced
	ipsets can't be destroyed while referring list is scheduled for destroy.

Since this is missing, the CVE fix potentially introduced new races as
it makes use of RCU.

Thanks,
Siddh

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

       reply	other threads:[~2024-08-07  6:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <2024071204-CVE-2024-39503-e604@gregkh>
2024-08-07  6:42 ` Siddh Raman Pant [this message]
2024-08-07 13:27   ` Sasha Levin

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=c44971f608d7d1d2733757112ef6fca87b004d17.camel@oracle.com \
    --to=siddh.raman.pant@oracle.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --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

all inboxes | Powered by JetHome®