From nobody Sun Feb 8 01:29:57 2026 Received: from mail-oo1-f72.google.com (mail-oo1-f72.google.com [209.85.161.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CF9F1350D44 for ; Wed, 28 Jan 2026 14:54:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769612063; cv=none; b=DiOb8bdToZUxRQDDuAnfhwtY6knu8fHQ+BMsMc2zRrN7ywfkNop7QPZ4IJDYcCyQp8uLAvZUEBeHs+zZjGoY+IkQHiJ/oiEEk9SStkr8p8eo84g+Ozze0f1v3g3gk0SHAVnNEWItI9cQbDYwSVj9Wbf5HvgiMplqBR5JaKm4QTQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769612063; c=relaxed/simple; bh=PTHbAAlEHstAIiqk3a+6yOs2ELqiMprDDBeOuBDUTYc=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=DFdVWw49yQN3wQmTaa8VkfvWmEUq/L/khx6MP7zV86HZluaxBmqubQWmYzIYWGvS2S53f+5cMSLkzsL/8taug9Ed1MFhTFanHjHnzU20lLF8sYwsCnj6WBcolIfwTLl4s8XvrcB6kric7jcr63R6NZlr4xaopUv49ZBIRK9ARsU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.161.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-oo1-f72.google.com with SMTP id 006d021491bc7-662b9af3a01so14696018eaf.2 for ; Wed, 28 Jan 2026 06:54:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769612060; x=1770216860; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=P5JWJuYoGtpPoCwS7/YKvFAAdKCI//9Bn6tEHnpUBbI=; b=dPQc7HpZ6/TVbwMJtHBjW2D6J2W+6UeVu4ZOaUhBBGkspy6M1SfqK0HI6VmdPDPsdl ZdFdQu6iYFLqwo8/FnnCfYbz0KDfZ5ajsM7OZCN+mRB+zH+QbyHHV6Zek21K598NEalQ 6vUnhLURG8DVTBkVwcylJ7uxohmmYoffbhJTCyvJtADLjo2zvIsPZZkyOxFSWVvvtYpy OfO/09+Bu2+eSMRz2rSHxRi52ilUsmwX278EGRFahPMABI3vYOxnkUNO7LdkQih047qi Mj4RHIFA2xy1ffGHlA8ImttVER4aFjkpApxVzy1Qxk+FJnkTBh4LSGkDE0wf/39mazQu IUKA== X-Gm-Message-State: AOJu0YyZo3/fBgFXsVKiehwZIgYbtWUL+DpMmDCV+3lJabIlI/FKDayx QyngV8kks9T14c0Y97nxf0bHf3OLgUlhexMIBYH8Z5hC55IOfee9T3dhxGUfSzRcVvUk8k8h3oX DGK4ktvI1bBsBKCCbWSJV6CDDaMAXdRWEx7tiwF38bMAFsfoGTevyYJjpEB4= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6820:80c9:b0:662:b8fe:20d with SMTP id 006d021491bc7-662f203dda3mr3427810eaf.21.1769612060716; Wed, 28 Jan 2026 06:54:20 -0800 (PST) Date: Wed, 28 Jan 2026 06:54:20 -0800 In-Reply-To: <6979fc44.050a0220.c9109.003b.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <697a231c.a70a0220.8545c.0002.GAE@google.com> Subject: Forwarded: [PATCH] netfilter: nf_tables: add missing RCU read lock in nf_tables_getsetelem From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: [PATCH] netfilter: nf_tables: add missing RCU read lock in nf_tabl= es_getsetelem Author: kartikey406@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.gi= t main Add RCU read-side critical section in nf_tables_getsetelem() to protect against concurrent element deletion by garbage collection. The function nf_tables_getsetelem() calls nft_get_set_elem() which eventually dereferences set elements through the rbtree lookup path. These elements can be freed by nft_trans_gc_trans_free() running in an RCU callback context while the lookup is in progress, leading to a use-after-free. The function nf_tables_getsetelem_reset() already has proper RCU protection around the same code path. This patch adds the missing RCU read lock to nf_tables_getsetelem() to match. Reported-by: syzbot+d417922a3e7935517ef6@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=3Dd417922a3e7935517ef6 Signed-off-by: Deepanshu Kartikey --- net/netfilter/nf_tables_api.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index be4924aeaf0e..00af242b1e62 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -6628,6 +6628,7 @@ static int nf_tables_getsetelem(struct sk_buff *skb, if (err) return err; =20 + rcu_read_lock(); nla_for_each_nested(attr, nla[NFTA_SET_ELEM_LIST_ELEMENTS], rem) { err =3D nft_get_set_elem(&dump_ctx.ctx, dump_ctx.set, attr, false); if (err < 0) { @@ -6635,6 +6636,7 @@ static int nf_tables_getsetelem(struct sk_buff *skb, break; } } + rcu_read_unlock(); =20 return err; } --=20 2.43.0