Linux kernel CVE announcements
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-cve-announce@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@kernel.org>
Subject: CVE-2026-64177: phonet/pep: disable BH around forwarded sk_receive_skb()
Date: Sun, 19 Jul 2026 17:40:39 +0200	[thread overview]
Message-ID: <2026071937-CVE-2026-64177-79cf@gregkh> (raw)

From: Greg Kroah-Hartman <gregkh@kernel.org>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

phonet/pep: disable BH around forwarded sk_receive_skb()

The networking receive path is usually run from softirq context, but
protocols that take the socket lock may have packets stored in the
backlog and processed later from process context. In that case
release_sock() -> __release_sock() drops the slock with spin_unlock_bh()
and then calls sk->sk_backlog_rcv() with bottom halves enabled.

Typical sk_backlog_rcv handlers process the socket whose backlog is
being drained, so the BH state at entry is irrelevant for the slocks
they touch. pep_do_rcv() is different: when the inbound skb targets an
existing PEP pipe, it forwards the skb to a different *child* socket
via sk_receive_skb(). That helper takes the child slock with
bh_lock_sock_nested(), which is just spin_lock_nested() and assumes BH
is already off. The same child slock therefore ends up acquired with
BH on (process path) and with BH off (softirq path):

  process context                   softirq context
  ---------------                   ---------------
  release_sock(listener)            __netif_receive_skb()
   __release_sock()                  phonet_rcv()
    spin_unlock_bh()                  __sk_receive_skb(listener)
    [BH now ENABLED]                  [BH already disabled]
    sk_backlog_rcv:                   sk_backlog_rcv:
     pep_do_rcv()                      pep_do_rcv()
      sk_receive_skb(child)             sk_receive_skb(child)
       bh_lock_sock_nested(child)        bh_lock_sock_nested(child)
       => SOFTIRQ-ON-W                   => IN-SOFTIRQ-W

Lockdep flags this as inconsistent lock state, and it can become a real
self-deadlock if a softirq on the same CPU tries to receive to the same
child socket while its slock is held in the BH-enabled path:

  WARNING: inconsistent lock state
  inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage.
   (slock-AF_PHONET/1){+.?.}-{3:3}, at: __sk_receive_skb+0x1cf/0x900
    __sk_receive_skb              net/core/sock.c:563
    sk_receive_skb                include/net/sock.h:2022 [inline]
    pep_do_rcv                    net/phonet/pep.c:675
    sk_backlog_rcv                include/net/sock.h:1190
    __release_sock                net/core/sock.c:3216
    release_sock                  net/core/sock.c:3815
    pep_sock_accept               net/phonet/pep.c:879

Wrap the forwarded sk_receive_skb() in local_bh_disable() /
local_bh_enable() so the child slock is always acquired with BH off.
local_bh_disable() nests safely on the softirq path.

Discovered via in-house syzkaller fuzzing; the same root cause also
on the linux-6.1.y syzbot dashboard as extid 44f0626dd6284f02663c.
Reproduced under KASAN + LOCKDEP + PROVE_LOCKING, reproducer:
https://pastebin.com/A3t8xzCR

The Linux kernel CVE team has assigned CVE-2026-64177 to this issue.


Affected and fixed versions
===========================

	Issue introduced in 2.6.28 with commit 9641458d3ec42def729fde64669abf07f3220cd5 and fixed in 5.10.258 with commit f08c45076e4fd8b0adbc5eb186d6e6a3e7350d7b
	Issue introduced in 2.6.28 with commit 9641458d3ec42def729fde64669abf07f3220cd5 and fixed in 5.15.209 with commit b2606c302d7f2b4ee48da05e32ed60aed1b0cd53
	Issue introduced in 2.6.28 with commit 9641458d3ec42def729fde64669abf07f3220cd5 and fixed in 6.1.175 with commit 02c04df84de709060f63e1d52ec67488c4f6f212
	Issue introduced in 2.6.28 with commit 9641458d3ec42def729fde64669abf07f3220cd5 and fixed in 6.6.142 with commit 8420aa4900417797323dd567ba9d1512280c2dc3
	Issue introduced in 2.6.28 with commit 9641458d3ec42def729fde64669abf07f3220cd5 and fixed in 6.12.92 with commit bd795f106b3889fb0706c6e4831c4b27e2b5666b
	Issue introduced in 2.6.28 with commit 9641458d3ec42def729fde64669abf07f3220cd5 and fixed in 6.18.34 with commit 84bc87beb4cd77670939b446326788e4c9b3db37
	Issue introduced in 2.6.28 with commit 9641458d3ec42def729fde64669abf07f3220cd5 and fixed in 7.0.11 with commit a3fc8f2dacd1c37325977fc1fbbf3d52141df99e
	Issue introduced in 2.6.28 with commit 9641458d3ec42def729fde64669abf07f3220cd5 and fixed in 7.1 with commit dbc81608e3a653dea6cf403f20cae35468b8ab9c

Please see https://www.kernel.org for a full list of currently supported
kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to
older supported kernel versions.  The official CVE entry at
	https://cve.org/CVERecord/?id=CVE-2026-64177
will be updated if fixes are backported, please check that for the most
up to date information about this issue.


Affected files
==============

The file(s) affected by this issue are:
	net/phonet/pep.c


Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest
stable kernel version for this, and many other bugfixes.  Individual
changes are never tested alone, but rather are part of a larger kernel
release.  Cherry-picking individual commits is not recommended or
supported by the Linux kernel community at all.  If however, updating to
the latest release is impossible, the individual changes to resolve this
issue can be found at these commits:
	https://git.kernel.org/stable/c/f08c45076e4fd8b0adbc5eb186d6e6a3e7350d7b
	https://git.kernel.org/stable/c/b2606c302d7f2b4ee48da05e32ed60aed1b0cd53
	https://git.kernel.org/stable/c/02c04df84de709060f63e1d52ec67488c4f6f212
	https://git.kernel.org/stable/c/8420aa4900417797323dd567ba9d1512280c2dc3
	https://git.kernel.org/stable/c/bd795f106b3889fb0706c6e4831c4b27e2b5666b
	https://git.kernel.org/stable/c/84bc87beb4cd77670939b446326788e4c9b3db37
	https://git.kernel.org/stable/c/a3fc8f2dacd1c37325977fc1fbbf3d52141df99e
	https://git.kernel.org/stable/c/dbc81608e3a653dea6cf403f20cae35468b8ab9c

                 reply	other threads:[~2026-07-19 15:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=2026071937-CVE-2026-64177-79cf@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=cve@kernel.org \
    --cc=gregkh@kernel.org \
    --cc=linux-cve-announce@vger.kernel.org \
    --cc=linux-kernel@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