All of lore.kernel.org
 help / color / mirror / Atom feed
* CVE-2026-74479: net: pktgen: fix proc entry use-after-free
@ 2026-08-15 12:26 Greg Kroah-Hartman
  0 siblings, 0 replies; only message in thread
From: Greg Kroah-Hartman @ 2026-08-15 12:26 UTC (permalink / raw)
  To: linux-cve-announce; +Cc: Greg Kroah-Hartman

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

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

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

net: pktgen: fix proc entry use-after-free

pktgen_change_name() replaces pkt_dev->entry while holding t->if_lock.
pktgen_remove_device() removes the same entry before
_rem_dev_from_if_list() takes that lock.

This allows the following interleaving:

  CPU 0 (NETDEV_CHANGENAME)       CPU 1 (kpktgend)
  if_lock(t)
  proc_remove(pkt_dev->entry)
                                  proc_remove(pkt_dev->entry)
  pkt_dev->entry = proc_create_data(...)
  if_unlock(t)

The kthread can pass the stale proc_dir_entry to proc_remove() after the
rename path has freed it. A reproducer with a widened race window reports:

  BUG: KASAN: slab-use-after-free in proc_remove+0x78/0x80
  Read of size 8 at addr ffff8881478fea70 by task kpktgend_0/67
  Call Trace:
   proc_remove+0x78/0x80
   pktgen_remove_device.isra.0+0x11c/0x4c0
   pktgen_thread_worker+0x1214/0x6bc0
   kthread+0x2c6/0x3b0
  Allocated by task 95:
   __proc_create+0x204/0x790
   proc_create_data+0x72/0xe0
   pktgen_thread_write+0xd61/0x1510
  Freed by task 28:
   kmem_cache_free+0xcb/0x3d0
   proc_free_inode+0x5b/0x80
   rcu_core+0x50a/0x1850
  The buggy address belongs to the object at ffff8881478fea00
   which belongs to the cache proc_dir_entry of size 192

Move proc_remove() into the if_lock-protected list removal helper. Keep it
before list_del_rcu() to preserve the ordering required by add_device().
The rename path must then finish replacing the entry before removal, or
it observes that the device is no longer on the list.

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


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

	Issue introduced in 2.6.22 with commit 39df232f1a9ba48d41c68ee7d4046756e709cf91 and fixed in 6.18.44 with commit 4ef801b838d85c0ea5852c50667f7344ce3b6cd0
	Issue introduced in 2.6.22 with commit 39df232f1a9ba48d41c68ee7d4046756e709cf91 and fixed in 7.1.8 with commit b006a5404470bd3eb2aa0425fc447183032047ef
	Issue introduced in 2.6.22 with commit 39df232f1a9ba48d41c68ee7d4046756e709cf91 and fixed in 7.2-rc6 with commit 817ff6efdb7f484ea547218e11e17d8e43daa3b4

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-74479
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/core/pktgen.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/4ef801b838d85c0ea5852c50667f7344ce3b6cd0
	https://git.kernel.org/stable/c/b006a5404470bd3eb2aa0425fc447183032047ef
	https://git.kernel.org/stable/c/817ff6efdb7f484ea547218e11e17d8e43daa3b4

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-15 12:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-15 12:26 CVE-2026-74479: net: pktgen: fix proc entry use-after-free Greg Kroah-Hartman

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.