Netdev List
 help / color / mirror / Atom feed
From: shaos <shawnq1@163.com>
To: jhs@mojatatu.com
Cc: Jiri Pirko <jiri@resnulli.us>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	security@kernel.org
Subject: [BUG] net/sched: act_ife can emit uninitialized bytes for zero metadata
Date: Thu, 22 Oct 2026 14:47:39 +0000	[thread overview]
Message-ID: <20261022144739.61342-1-shawnq1@163.com> (raw)

Hello,

An attacker with only namespace-scoped CAP_NET_ADMIN and CAP_NET_RAW installs a matchall IFE encode action carrying a zero-valued skb mark in a fresh user/network namespace. The presence callback reserves an 8-byte TLV, but the encoder emits no value bytes. The resulting frame contains six bytes from a freed kmalloc object previously populated by a different UID.

HEAD commit:    c03c1a14507dfaf8b856c2608f9ac216021fc222
git tree:       30fd2ef82912c26cf3a58ad0ba6afc375fa851ac
source version: Linux 7.3.0, local master
compiler:       gcc 11.4.0, GNU ld 2.38

console output:
https://gist.githubusercontent.com/shaos26/ef81659b25f21284f8e947074fc2a249/raw/fed962675ff9018ab35483e75af1f64b349d0465/console-output.txt
kernel config:
https://gist.githubusercontent.com/shaos26/ef81659b25f21284f8e947074fc2a249/raw/cbbe560851613f20ee1d9893671a4bd8ab44c44b/kernel-config.txt
reproducer sources:
https://gist.githubusercontent.com/shaos26/5e309509387950d97539adf449e7f725/raw/d9a204d10cb437095253c4ff74675c99245a6a2c/poc.c
https://gist.githubusercontent.com/shaos26/5e309509387950d97539adf449e7f725/raw/a81c7411e6b232f24cd42ea4b88a2e84b66af4ba/ife_trace.c

Build the tested kernel with the attached configuration and boot a disposable QEMU guest with user/network namespaces, veth, packet sockets, matchall, and IFE skb-mark metadata support. The linked userspace sources reproduce the zero-mark and allocator-trace cases with separate victim and attacker identities.

Impact and prerequisites:
A UID 65534 attacker in a fresh user/network namespace repeatedly received six bytes from a freed kmalloc object populated by a UID 65533 helper, although the attacker could not read the helper's mode-0600 marker file. This is a cross-user information disclosure. User namespaces, network namespaces, CAP_NET_ADMIN, CAP_NET_RAW, veth, and IFE support are required; no privilege escalation or credential extraction is demonstrated.

Validation: Two fresh cross-UID boots reproduced the marker bytes; init_on_alloc=1 zeroed the TLV bytes, and the nonzero-mark control emitted a valid TLV.

Thanks,

shaos


             reply	other threads:[~2026-10-22 14:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-22 14:47 shaos [this message]
2026-10-22 14:56 ` [BUG] net/sched: act_ife can emit uninitialized bytes for zero metadata Greg KH

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=20261022144739.61342-1-shawnq1@163.com \
    --to=shawnq1@163.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=security@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