All of lore.kernel.org
 help / color / mirror / Atom feed
* NoisyTCP — CVE-2026-99288 (Was Re: [oss-security] Backports available - cBPF JIT spray hardening)
       [not found]     ` <2026073004-spruce-clambake-1785@gregkh>
@ 2026-11-19 23:25       ` Jose R Rodriguez
  2026-11-20  0:45         ` [oss-security] " Dominique Martinet
  0 siblings, 1 reply; 2+ messages in thread
From: Jose R Rodriguez @ 2026-11-19 23:25 UTC (permalink / raw)
  To: Greg KH; +Cc: oss-security, Edward Shishkin, Reiserfs Devel

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

On 2026-07-30 07:00, Greg KH wrote:
> On Wed, Jul 29, 2026 at 06:31:11PM -0700, Pawan Gupta wrote:
>> On Wed, Jul 29, 2026 at 05:15:46PM -0700, Jose R Rodriguez wrote:
>> > On 2026-07-29 13:04, Pawan Gupta wrote:
>> > > Hi All,
>> > >
>> > > This is an inform distro maintainers about recently upstreamed hardening
>> > > against speculative execution attacks using BPF JIT spraying.
>> > >
>> > > The backports are available here:
>> > >
>> > >   6.1  - https://lore.kernel.org/all/20260727-cbpf-jit-spray-hardening-6-1-y-v1-0-eb80dcf1eb6e@linux.intel.com
>> > >   6.6  - https://lore.kernel.org/all/20260717-cbpf-jit-spray-hardening-6-6-y-v1-0-e04f1b2893de@linux.intel.com
>> > >   6.12 - https://lore.kernel.org/all/20260715-cbpf-jit-spray-hardening-6-12-y-v1-0-d8585a9aed80@linux.intel.com
>> > >   6.18 - https://lore.kernel.org/all/20260713-cbpf-jit-spray-hardening-6-18-y-v1-0-755f60c55705@linux.intel.com
>> > >   7.1  - https://lore.kernel.org/all/20260709-cbpf-jit-spray-hardening-7-1-y-v1-0-5ac5a2d6797f@linux.intel.com
>> > >
>> > > 6.1 backport is queued. Others are part of LTS kernels.
>> > >
>> > > 5.15 and older do not support pack allocator for BPF on which the
>> > > hardening
>> > > is based on. So the series is not directly applicable to 5.15 and older,
>> > > and may need custom hardening patches.
>> >
>> > Any patches out there for kernel 5.17.15? Thanks in advance!
>> 
>> Pack allocator was first introduced in 5.18 by commit:
>> 
>>   57631054fae6 ("bpf: Introduce bpf_prog_pack allocator")
>> 
>> This means that 5.17 is in the same boat as 5.15, it does not support 
>> BPF
>> pack allocator, and these hardening patches dont apply.
>> 
>> Pack allocator makes the JIT spraying attacks easier, but this doesn't 
>> mean
>> that kernels withouth it are immune to such attacks. This needs a 
>> fresh
>> assessment and possibly a different hardening approach.
>> 
>> BTW, I am confused by the choice of distro kernel 5.17 which is not an 
>> LTS
>> kernel.
> 
> Yes, that's a very odd choice for anyone to run these days.  According
> to the cve tools:
> 	Total Vulnerable CVE's in 5.17.15 : 7035
> 
> That's a non-trivial amount...

Since the time of your comment I have been keeping up with reiser4 
-enhanced 5.15 LTS build iterations -- with the latest being 5.15.224. 
Notwithstanding, 'NoisyTCP — CVE-2026-99288' came along and the latest 
5.15.225 LTS iteration did not address the critical vulnerability. I 
have the 5.15 LTS kernel(s) deployed online and I got spooked. 
Accordingly, on a best effort basis, I backported the patch from 
upstream:

 From 0e5944a7abe777d2b8aad3604f7a7531966c06b1 Mon Sep 17 00:00:00 2001
 From: Metztli Information Technology <jose@moiocoiatzin.metztli.it>
Date: Thu, 19 Nov 2026 14:45:54 -0800
Subject: [PATCH] 
=?UTF-8?q?Best=20effort=205.15.225=20LTS=20backport=20pat?=
  =?UTF-8?q?ch=20against=20NoisyTCP=20=E2=80=94=20CVE-2026-99288?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
  include/linux/refcount.h        | 55 +++++++++++++++++++++++++++++++++
  net/core/filter.c               |  2 +-
  net/ipv4/inet_connection_sock.c | 16 ++++++----
  net/ipv4/inet_hashtables.c      |  7 +++--
  net/ipv4/inet_timewait_sock.c   |  4 +--
  net/ipv4/syncookies.c           |  4 ++-
  net/ipv4/tcp_fastopen.c         |  2 +-
  net/ipv4/tcp_input.c            |  4 ++-
  net/ipv6/inet6_hashtables.c     |  6 ++--
  9 files changed, 83 insertions(+), 17 deletions(-)

diff --git a/include/linux/refcount.h b/include/linux/refcount.h
index b8a6e387f8f9..43a29f15d09c 100644
--- a/include/linux/refcount.h
+++ b/include/linux/refcount.h
@@ -142,6 +142,10 @@ static inline void refcount_set(refcount_t *r, int 
n)
   *
   * Return: the refcount's value
   */
+static inline void refcount_set_release(refcount_t *r, int n)
+{
+	atomic_set_release(&r->refs, n);
+}
  static inline unsigned int refcount_read(const refcount_t *r)
  {
  	return atomic_read(&r->refs);
@@ -188,6 +192,48 @@ static inline __must_check bool 
refcount_add_not_zero(int i, refcount_t *r)
  	return __refcount_add_not_zero(i, r, NULL);
  }

+static inline __must_check
+bool __refcount_add_not_zero_limited_acquire(int i, refcount_t *r, int 
*oldp,
+					     int limit)
+{
+	int old = refcount_read(r);
+
+	do {
+		if (!old)
+			break;
+
+		if (i > limit - old) {
+			if (oldp)
+				*oldp = old;
+			return false;
+		}
+	} while (!atomic_try_cmpxchg_acquire(&r->refs, &old, old + i));
+
+	if (oldp)
+		*oldp = old;
+
+	if (unlikely(old < 0 || old + i < 0))
+		refcount_warn_saturate(r, REFCOUNT_ADD_NOT_ZERO_OVF);
+
+	return old;
+}
+
+static inline __must_check bool
+__refcount_inc_not_zero_limited_acquire(refcount_t *r, int *oldp, int 
limit)
+{
+	return __refcount_add_not_zero_limited_acquire(1, r, oldp, limit);
+}
+
+static inline __must_check
+bool __refcount_add_not_zero_acquire(int i, refcount_t *r, int *oldp)
+{
+	return __refcount_add_not_zero_limited_acquire(i, r, oldp, INT_MAX);
+}
+static inline __must_check bool refcount_add_not_zero_acquire(int i, 
refcount_t *r)
+{
+	return __refcount_add_not_zero_acquire(i, r, NULL);
+}
+
  static inline void __refcount_add(int i, refcount_t *r, int *oldp)
  {
  	int old = atomic_fetch_add_relaxed(i, &r->refs);
@@ -245,6 +291,15 @@ static inline __must_check bool 
refcount_inc_not_zero(refcount_t *r)
  	return __refcount_inc_not_zero(r, NULL);
  }

+static inline __must_check bool 
__refcount_inc_not_zero_acquire(refcount_t *r, int *oldp)
+{
+	return __refcount_add_not_zero_acquire(1, r, oldp);
+}
+static inline __must_check bool 
refcount_inc_not_zero_acquire(refcount_t *r)
+{
+	return __refcount_inc_not_zero_acquire(r, NULL);
+}
+
  static inline void __refcount_inc(refcount_t *r, int *oldp)
  {
  	__refcount_add(1, r, oldp);
diff --git a/net/core/filter.c b/net/core/filter.c
index f4a6ca23eef5..8de20ec6c5f0 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -7197,7 +7197,7 @@ BPF_CALL_3(bpf_sk_assign, struct sk_buff *, skb, 
struct sock *, sk, u64, flags)
  	if (sk_unhashed(sk))
  		return -EOPNOTSUPP;
  	if (sk_is_refcounted(sk) &&
-	    unlikely(!refcount_inc_not_zero(&sk->sk_refcnt)))
+	    unlikely(!refcount_inc_not_zero_acquire(&sk->sk_refcnt)))
  		return -ENOENT;

  	skb_orphan(skb);
diff --git a/net/ipv4/inet_connection_sock.c 
b/net/ipv4/inet_connection_sock.c
index ac9f18861aa7..3681198e43d9 100644
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -863,8 +863,8 @@ static void reqsk_timer_handler(struct timer_list 
*t)
  		 * hold another count to prevent use-after-free and
  		 * call reqsk_put() just before return.
  		 */
-		refcount_set(&nreq->rsk_refcnt, 2 + 1);
  		timer_setup(&nreq->rsk_timer, reqsk_timer_handler, TIMER_PINNED);
+		refcount_set_release(&nreq->rsk_refcnt, 2 + 1);
  		reqsk_queue_migrated(&inet_csk(nsk)->icsk_accept_queue, req);

  		req = nreq;
@@ -939,10 +939,14 @@ static void reqsk_timer_handler(struct timer_list 
*t)
  	 */
  	if (nreq) {
  		__NET_INC_STATS(net, LINUX_MIB_TCPMIGRATEREQFAILURE);
+		/* The timer was not armed, drop its reference here. */
+		reqsk_put(nreq);
  no_ownership:
  		reqsk_migrate_reset(nreq);
  		reqsk_queue_removed(queue, nreq);
-		__reqsk_free(nreq);
+		/* Drop the temporary reference and the one reserved for ehash. */
+		reqsk_put(nreq);
+		reqsk_put(nreq);
  	}

  drop:
@@ -1216,7 +1220,7 @@ struct sock *inet_csk_complete_hashdance(struct 
sock *sk, struct sock *child,
  				goto child_put;
  			}

-			refcount_set(&nreq->rsk_refcnt, 1);
+			refcount_set_release(&nreq->rsk_refcnt, 1);
  			if (inet_csk_reqsk_queue_add(sk, nreq, child)) {
  				__NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPMIGRATEREQSUCCESS);
  				reqsk_migrate_reset(req);
@@ -1226,7 +1230,7 @@ struct sock *inet_csk_complete_hashdance(struct 
sock *sk, struct sock *child,

  			__NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPMIGRATEREQFAILURE);
  			reqsk_migrate_reset(nreq);
-			__reqsk_free(nreq);
+			reqsk_put(nreq);
  		} else if (inet_csk_reqsk_queue_add(sk, req, child)) {
  			return child;
  		}
@@ -1270,7 +1274,7 @@ void inet_csk_listen_stop(struct sock *sk)
  		if (nsk) {
  			nreq = inet_reqsk_clone(req, nsk);
  			if (nreq) {
-				refcount_set(&nreq->rsk_refcnt, 1);
+				refcount_set_release(&nreq->rsk_refcnt, 1);

  				rcu_read_lock();
  				if (inet_csk_reqsk_queue_add(nsk, nreq, child)) {
@@ -1282,7 +1286,7 @@ void inet_csk_listen_stop(struct sock *sk)
  					__NET_INC_STATS(sock_net(nsk),
  							LINUX_MIB_TCPMIGRATEREQFAILURE);
  					reqsk_migrate_reset(nreq);
-					__reqsk_free(nreq);
+					reqsk_put(nreq);
  				}
  				rcu_read_unlock();

diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c
index a7d11b82fe64..dc7ab92c8978 100644
--- a/net/ipv4/inet_hashtables.c
+++ b/net/ipv4/inet_hashtables.c
@@ -381,10 +381,11 @@ struct sock *__inet_lookup_established(struct net 
*net,
  		if (sk->sk_hash != hash)
  			continue;
  		if (likely(INET_MATCH(net, sk, acookie, ports, dif, sdif))) {
-			if (unlikely(!refcount_inc_not_zero(&sk->sk_refcnt)))
+			if (unlikely(!refcount_inc_not_zero_acquire(&sk->sk_refcnt)))
  				goto out;
-			if (unlikely(!INET_MATCH(net, sk, acookie,
-						 ports, dif, sdif))) {
+			if (unlikely(hlist_nulls_unhashed_lockless(&sk->sk_nulls_node) ||
+				     !INET_MATCH(net, sk, acookie, ports, dif,
+						 sdif))) {
  				sock_gen_put(sk);
  				goto begin;
  			}
diff --git a/net/ipv4/inet_timewait_sock.c 
b/net/ipv4/inet_timewait_sock.c
index 25809e06f111..aae056089157 100644
--- a/net/ipv4/inet_timewait_sock.c
+++ b/net/ipv4/inet_timewait_sock.c
@@ -137,7 +137,7 @@ void inet_twsk_hashdance(struct inet_timewait_sock 
*tw, struct sock *sk,
  	 * Also note that after this point, we lost our implicit reference
  	 * so we are not allowed to use tw anymore.
  	 */
-	refcount_set(&tw->tw_refcnt, 3);
+	refcount_set_release(&tw->tw_refcnt, 3);
  }
  EXPORT_SYMBOL_GPL(inet_twsk_hashdance);

@@ -278,7 +278,7 @@ void inet_twsk_purge(struct inet_hashinfo *hashinfo, 
int family)
  			    refcount_read(&sock_net(sk)->ns.count))
  				continue;

-			if (unlikely(!refcount_inc_not_zero(&sk->sk_refcnt)))
+			if (unlikely(!refcount_inc_not_zero_acquire(&sk->sk_refcnt)))
  				continue;

  			if (unlikely(sk->sk_family != family ||
diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c
index 5a61f9a364ad..ee39ec6452e3 100644
--- a/net/ipv4/syncookies.c
+++ b/net/ipv4/syncookies.c
@@ -203,7 +203,7 @@ struct sock *tcp_get_cookie_sock(struct sock *sk, 
struct sk_buff *skb,
  	child = icsk->icsk_af_ops->syn_recv_sock(sk, skb, req, dst,
  						 NULL, &own_req, NULL);
  	if (child) {
-		refcount_set(&req->rsk_refcnt, 1);
+		refcount_set_release(&req->rsk_refcnt, 1);
  		tcp_sk(child)->tsoffset = tsoff;
  		sock_rps_save_rxhash(child, skb);

@@ -217,6 +217,8 @@ struct sock *tcp_get_cookie_sock(struct sock *sk, 
struct sk_buff *skb,

  		bh_unlock_sock(child);
  		sock_put(child);
+		reqsk_put(req);
+		return NULL;
  	}
  	__reqsk_free(req);

diff --git a/net/ipv4/tcp_fastopen.c b/net/ipv4/tcp_fastopen.c
index f3ed7d5ff7ef..ffa975ceb946 100644
--- a/net/ipv4/tcp_fastopen.c
+++ b/net/ipv4/tcp_fastopen.c
@@ -281,7 +281,7 @@ static struct sock *tcp_fastopen_create_child(struct 
sock *sk,
  	inet_csk_reset_xmit_timer(child, ICSK_TIME_RETRANS,
  				  TCP_TIMEOUT_INIT, TCP_RTO_MAX);

-	refcount_set(&req->rsk_refcnt, 2);
+	refcount_set_release(&req->rsk_refcnt, 2);

  	/* Now finish processing the fastopen child socket. */
  	tcp_init_transfer(child, BPF_SOCK_OPS_PASSIVE_ESTABLISHED_CB, skb);
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 4a481dd4579b..8b8c892810ee 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -7069,7 +7069,9 @@ int tcp_conn_request(struct request_sock_ops 
*rsk_ops,
  		if (!inet_csk_reqsk_queue_add(sk, req, fastopen_sk)) {
  			bh_unlock_sock(fastopen_sk);
  			sock_put(fastopen_sk);
-			goto drop_and_free;
+			/* tcp_disconnect() already dropped one reqsk ref. */
+			reqsk_put(req);
+			goto drop;
  		}
  		sk->sk_data_ready(sk);
  		bh_unlock_sock(fastopen_sk);
diff --git a/net/ipv6/inet6_hashtables.c b/net/ipv6/inet6_hashtables.c
index 869173f176cc..a23cade5fb83 100644
--- a/net/ipv6/inet6_hashtables.c
+++ b/net/ipv6/inet6_hashtables.c
@@ -74,10 +74,12 @@ struct sock *__inet6_lookup_established(struct net 
*net,
  			continue;
  		if (!inet6_match(net, sk, saddr, daddr, ports, dif, sdif))
  			continue;
-		if (unlikely(!refcount_inc_not_zero(&sk->sk_refcnt)))
+		if (unlikely(!refcount_inc_not_zero_acquire(&sk->sk_refcnt)))
  			goto out;

-		if (unlikely(!inet6_match(net, sk, saddr, daddr, ports, dif, sdif))) 
{
+		if (unlikely(hlist_nulls_unhashed_lockless(&sk->sk_nulls_node) ||
+			     !inet6_match(net, sk, saddr, daddr, ports, dif,
+					  sdif))) {
  			sock_gen_put(sk);
  			goto begin;
  		}
-- 
2.47.3

patching 5.15.225 LTS -- which I am currently running online.

> 
> good luck!
> 
> greg k-h

-- 
Best Professional Regards.

--
Jose R R
http://metztli.it
---------------------------------------------------------------------------------------------
Download Metztli Reiser4: Debian Trixie w/ Linux 5.17.15-3 AMD64
---------------------------------------------------------------------------------------------
feats ZSTD compression https://sf.net/projects/metztli-reiser4/
-------------------------------------------------------------------------------------------
Official current Reiser4 resources: https://reiser4.wiki.kernel.org/

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: metztli-5_15_225-LTS-NoisyTCP.patch --]
[-- Type: text/x-diff; name=metztli-5_15_225-LTS-NoisyTCP.patch, Size: 10148 bytes --]

From 0e5944a7abe777d2b8aad3604f7a7531966c06b1 Mon Sep 17 00:00:00 2001
From: Metztli Information Technology <jose@moiocoiatzin.metztli.it>
Date: Thu, 19 Nov 2026 14:45:54 -0800
Subject: [PATCH] =?UTF-8?q?Best=20effort=205.15.225=20LTS=20backport=20pat?=
 =?UTF-8?q?ch=20against=20NoisyTCP=20=E2=80=94=20CVE-2026-99288?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 include/linux/refcount.h        | 55 +++++++++++++++++++++++++++++++++
 net/core/filter.c               |  2 +-
 net/ipv4/inet_connection_sock.c | 16 ++++++----
 net/ipv4/inet_hashtables.c      |  7 +++--
 net/ipv4/inet_timewait_sock.c   |  4 +--
 net/ipv4/syncookies.c           |  4 ++-
 net/ipv4/tcp_fastopen.c         |  2 +-
 net/ipv4/tcp_input.c            |  4 ++-
 net/ipv6/inet6_hashtables.c     |  6 ++--
 9 files changed, 83 insertions(+), 17 deletions(-)

diff --git a/include/linux/refcount.h b/include/linux/refcount.h
index b8a6e387f8f9..43a29f15d09c 100644
--- a/include/linux/refcount.h
+++ b/include/linux/refcount.h
@@ -142,6 +142,10 @@ static inline void refcount_set(refcount_t *r, int n)
  *
  * Return: the refcount's value
  */
+static inline void refcount_set_release(refcount_t *r, int n)
+{
+	atomic_set_release(&r->refs, n);
+}
 static inline unsigned int refcount_read(const refcount_t *r)
 {
 	return atomic_read(&r->refs);
@@ -188,6 +192,48 @@ static inline __must_check bool refcount_add_not_zero(int i, refcount_t *r)
 	return __refcount_add_not_zero(i, r, NULL);
 }
 
+static inline __must_check
+bool __refcount_add_not_zero_limited_acquire(int i, refcount_t *r, int *oldp,
+					     int limit)
+{
+	int old = refcount_read(r);
+
+	do {
+		if (!old)
+			break;
+
+		if (i > limit - old) {
+			if (oldp)
+				*oldp = old;
+			return false;
+		}
+	} while (!atomic_try_cmpxchg_acquire(&r->refs, &old, old + i));
+
+	if (oldp)
+		*oldp = old;
+
+	if (unlikely(old < 0 || old + i < 0))
+		refcount_warn_saturate(r, REFCOUNT_ADD_NOT_ZERO_OVF);
+
+	return old;
+}
+
+static inline __must_check bool
+__refcount_inc_not_zero_limited_acquire(refcount_t *r, int *oldp, int limit)
+{
+	return __refcount_add_not_zero_limited_acquire(1, r, oldp, limit);
+}
+
+static inline __must_check
+bool __refcount_add_not_zero_acquire(int i, refcount_t *r, int *oldp)
+{
+	return __refcount_add_not_zero_limited_acquire(i, r, oldp, INT_MAX);
+}
+static inline __must_check bool refcount_add_not_zero_acquire(int i, refcount_t *r)
+{
+	return __refcount_add_not_zero_acquire(i, r, NULL);
+}
+
 static inline void __refcount_add(int i, refcount_t *r, int *oldp)
 {
 	int old = atomic_fetch_add_relaxed(i, &r->refs);
@@ -245,6 +291,15 @@ static inline __must_check bool refcount_inc_not_zero(refcount_t *r)
 	return __refcount_inc_not_zero(r, NULL);
 }
 
+static inline __must_check bool __refcount_inc_not_zero_acquire(refcount_t *r, int *oldp)
+{
+	return __refcount_add_not_zero_acquire(1, r, oldp);
+}
+static inline __must_check bool refcount_inc_not_zero_acquire(refcount_t *r)
+{
+	return __refcount_inc_not_zero_acquire(r, NULL);
+}
+
 static inline void __refcount_inc(refcount_t *r, int *oldp)
 {
 	__refcount_add(1, r, oldp);
diff --git a/net/core/filter.c b/net/core/filter.c
index f4a6ca23eef5..8de20ec6c5f0 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -7197,7 +7197,7 @@ BPF_CALL_3(bpf_sk_assign, struct sk_buff *, skb, struct sock *, sk, u64, flags)
 	if (sk_unhashed(sk))
 		return -EOPNOTSUPP;
 	if (sk_is_refcounted(sk) &&
-	    unlikely(!refcount_inc_not_zero(&sk->sk_refcnt)))
+	    unlikely(!refcount_inc_not_zero_acquire(&sk->sk_refcnt)))
 		return -ENOENT;
 
 	skb_orphan(skb);
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
index ac9f18861aa7..3681198e43d9 100644
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -863,8 +863,8 @@ static void reqsk_timer_handler(struct timer_list *t)
 		 * hold another count to prevent use-after-free and
 		 * call reqsk_put() just before return.
 		 */
-		refcount_set(&nreq->rsk_refcnt, 2 + 1);
 		timer_setup(&nreq->rsk_timer, reqsk_timer_handler, TIMER_PINNED);
+		refcount_set_release(&nreq->rsk_refcnt, 2 + 1);
 		reqsk_queue_migrated(&inet_csk(nsk)->icsk_accept_queue, req);
 
 		req = nreq;
@@ -939,10 +939,14 @@ static void reqsk_timer_handler(struct timer_list *t)
 	 */
 	if (nreq) {
 		__NET_INC_STATS(net, LINUX_MIB_TCPMIGRATEREQFAILURE);
+		/* The timer was not armed, drop its reference here. */
+		reqsk_put(nreq);
 no_ownership:
 		reqsk_migrate_reset(nreq);
 		reqsk_queue_removed(queue, nreq);
-		__reqsk_free(nreq);
+		/* Drop the temporary reference and the one reserved for ehash. */
+		reqsk_put(nreq);
+		reqsk_put(nreq);
 	}
 
 drop:
@@ -1216,7 +1220,7 @@ struct sock *inet_csk_complete_hashdance(struct sock *sk, struct sock *child,
 				goto child_put;
 			}
 
-			refcount_set(&nreq->rsk_refcnt, 1);
+			refcount_set_release(&nreq->rsk_refcnt, 1);
 			if (inet_csk_reqsk_queue_add(sk, nreq, child)) {
 				__NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPMIGRATEREQSUCCESS);
 				reqsk_migrate_reset(req);
@@ -1226,7 +1230,7 @@ struct sock *inet_csk_complete_hashdance(struct sock *sk, struct sock *child,
 
 			__NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPMIGRATEREQFAILURE);
 			reqsk_migrate_reset(nreq);
-			__reqsk_free(nreq);
+			reqsk_put(nreq);
 		} else if (inet_csk_reqsk_queue_add(sk, req, child)) {
 			return child;
 		}
@@ -1270,7 +1274,7 @@ void inet_csk_listen_stop(struct sock *sk)
 		if (nsk) {
 			nreq = inet_reqsk_clone(req, nsk);
 			if (nreq) {
-				refcount_set(&nreq->rsk_refcnt, 1);
+				refcount_set_release(&nreq->rsk_refcnt, 1);
 
 				rcu_read_lock();
 				if (inet_csk_reqsk_queue_add(nsk, nreq, child)) {
@@ -1282,7 +1286,7 @@ void inet_csk_listen_stop(struct sock *sk)
 					__NET_INC_STATS(sock_net(nsk),
 							LINUX_MIB_TCPMIGRATEREQFAILURE);
 					reqsk_migrate_reset(nreq);
-					__reqsk_free(nreq);
+					reqsk_put(nreq);
 				}
 				rcu_read_unlock();
 
diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c
index a7d11b82fe64..dc7ab92c8978 100644
--- a/net/ipv4/inet_hashtables.c
+++ b/net/ipv4/inet_hashtables.c
@@ -381,10 +381,11 @@ struct sock *__inet_lookup_established(struct net *net,
 		if (sk->sk_hash != hash)
 			continue;
 		if (likely(INET_MATCH(net, sk, acookie, ports, dif, sdif))) {
-			if (unlikely(!refcount_inc_not_zero(&sk->sk_refcnt)))
+			if (unlikely(!refcount_inc_not_zero_acquire(&sk->sk_refcnt)))
 				goto out;
-			if (unlikely(!INET_MATCH(net, sk, acookie,
-						 ports, dif, sdif))) {
+			if (unlikely(hlist_nulls_unhashed_lockless(&sk->sk_nulls_node) ||
+				     !INET_MATCH(net, sk, acookie, ports, dif,
+						 sdif))) {
 				sock_gen_put(sk);
 				goto begin;
 			}
diff --git a/net/ipv4/inet_timewait_sock.c b/net/ipv4/inet_timewait_sock.c
index 25809e06f111..aae056089157 100644
--- a/net/ipv4/inet_timewait_sock.c
+++ b/net/ipv4/inet_timewait_sock.c
@@ -137,7 +137,7 @@ void inet_twsk_hashdance(struct inet_timewait_sock *tw, struct sock *sk,
 	 * Also note that after this point, we lost our implicit reference
 	 * so we are not allowed to use tw anymore.
 	 */
-	refcount_set(&tw->tw_refcnt, 3);
+	refcount_set_release(&tw->tw_refcnt, 3);
 }
 EXPORT_SYMBOL_GPL(inet_twsk_hashdance);
 
@@ -278,7 +278,7 @@ void inet_twsk_purge(struct inet_hashinfo *hashinfo, int family)
 			    refcount_read(&sock_net(sk)->ns.count))
 				continue;
 
-			if (unlikely(!refcount_inc_not_zero(&sk->sk_refcnt)))
+			if (unlikely(!refcount_inc_not_zero_acquire(&sk->sk_refcnt)))
 				continue;
 
 			if (unlikely(sk->sk_family != family ||
diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c
index 5a61f9a364ad..ee39ec6452e3 100644
--- a/net/ipv4/syncookies.c
+++ b/net/ipv4/syncookies.c
@@ -203,7 +203,7 @@ struct sock *tcp_get_cookie_sock(struct sock *sk, struct sk_buff *skb,
 	child = icsk->icsk_af_ops->syn_recv_sock(sk, skb, req, dst,
 						 NULL, &own_req, NULL);
 	if (child) {
-		refcount_set(&req->rsk_refcnt, 1);
+		refcount_set_release(&req->rsk_refcnt, 1);
 		tcp_sk(child)->tsoffset = tsoff;
 		sock_rps_save_rxhash(child, skb);
 
@@ -217,6 +217,8 @@ struct sock *tcp_get_cookie_sock(struct sock *sk, struct sk_buff *skb,
 
 		bh_unlock_sock(child);
 		sock_put(child);
+		reqsk_put(req);
+		return NULL;
 	}
 	__reqsk_free(req);
 
diff --git a/net/ipv4/tcp_fastopen.c b/net/ipv4/tcp_fastopen.c
index f3ed7d5ff7ef..ffa975ceb946 100644
--- a/net/ipv4/tcp_fastopen.c
+++ b/net/ipv4/tcp_fastopen.c
@@ -281,7 +281,7 @@ static struct sock *tcp_fastopen_create_child(struct sock *sk,
 	inet_csk_reset_xmit_timer(child, ICSK_TIME_RETRANS,
 				  TCP_TIMEOUT_INIT, TCP_RTO_MAX);
 
-	refcount_set(&req->rsk_refcnt, 2);
+	refcount_set_release(&req->rsk_refcnt, 2);
 
 	/* Now finish processing the fastopen child socket. */
 	tcp_init_transfer(child, BPF_SOCK_OPS_PASSIVE_ESTABLISHED_CB, skb);
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 4a481dd4579b..8b8c892810ee 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -7069,7 +7069,9 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops,
 		if (!inet_csk_reqsk_queue_add(sk, req, fastopen_sk)) {
 			bh_unlock_sock(fastopen_sk);
 			sock_put(fastopen_sk);
-			goto drop_and_free;
+			/* tcp_disconnect() already dropped one reqsk ref. */
+			reqsk_put(req);
+			goto drop;
 		}
 		sk->sk_data_ready(sk);
 		bh_unlock_sock(fastopen_sk);
diff --git a/net/ipv6/inet6_hashtables.c b/net/ipv6/inet6_hashtables.c
index 869173f176cc..a23cade5fb83 100644
--- a/net/ipv6/inet6_hashtables.c
+++ b/net/ipv6/inet6_hashtables.c
@@ -74,10 +74,12 @@ struct sock *__inet6_lookup_established(struct net *net,
 			continue;
 		if (!inet6_match(net, sk, saddr, daddr, ports, dif, sdif))
 			continue;
-		if (unlikely(!refcount_inc_not_zero(&sk->sk_refcnt)))
+		if (unlikely(!refcount_inc_not_zero_acquire(&sk->sk_refcnt)))
 			goto out;
 
-		if (unlikely(!inet6_match(net, sk, saddr, daddr, ports, dif, sdif))) {
+		if (unlikely(hlist_nulls_unhashed_lockless(&sk->sk_nulls_node) ||
+			     !inet6_match(net, sk, saddr, daddr, ports, dif,
+					  sdif))) {
 			sock_gen_put(sk);
 			goto begin;
 		}
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [oss-security] NoisyTCP — CVE-2026-99288 (Was Re: [oss-security] Backports available - cBPF JIT spray hardening)
  2026-11-19 23:25       ` NoisyTCP — CVE-2026-99288 (Was Re: [oss-security] Backports available - cBPF JIT spray hardening) Jose R Rodriguez
@ 2026-11-20  0:45         ` Dominique Martinet
  0 siblings, 0 replies; 2+ messages in thread
From: Dominique Martinet @ 2026-11-20  0:45 UTC (permalink / raw)
  To: Jose R Rodriguez, oss-security; +Cc: Greg KH, Edward Shishkin, Reiserfs Devel

Hi Jose,

(not sure why this comes as a reply to the bpf hardening CVE..)

Jose R Rodriguez wrote on Thu, Nov 19, 2026 at 03:25:25PM -0800:
> Since the time of your comment I have been keeping up with reiser4 -enhanced
> 5.15 LTS build iterations -- with the latest being 5.15.224.
> Notwithstanding, 'NoisyTCP — CVE-2026-99288' came along and the latest
> 5.15.225 LTS iteration did not address the critical vulnerability. I have
> the 5.15 LTS kernel(s) deployed online and I got spooked. Accordingly, on a
> best effort basis, I backported the patch from upstream:

The patch "inet: reject unhashed sockets during established lookups"
marked as fixing this CVE already has been backported to older trees,
including 5.15 already and is in the 5.15.226-rc1 (which will likely be
released today (11/20) or tomorrow)

You can already pull the patch from
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
if you want to rebuild your own kernel early


OTOH if you want quick fixes it's best to upgrade to a newer release if
possible - except for embedded or platforms with specific hardware it's
generally not too hard to switch to the latest LTS.

-- 
Dominique Martinet | Asmadeus

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-20  0:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <dzp2vbih7jcsxjmcnxnefgi435b7re4kwxvxmvlxrmkra2p5br@vv5ckstkijym>
     [not found] ` <14ad9b085cb3fb4b3a9fc091dde74540@metztli.com>
     [not found]   ` <6mqqzqzujeduybqeojfh7tmblksmqjksocri5ayeudze6l4fqm@ijx64jfxrwbt>
     [not found]     ` <2026073004-spruce-clambake-1785@gregkh>
2026-11-19 23:25       ` NoisyTCP — CVE-2026-99288 (Was Re: [oss-security] Backports available - cBPF JIT spray hardening) Jose R Rodriguez
2026-11-20  0:45         ` [oss-security] " Dominique Martinet

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.