mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [BUG] net/sched: act_ife can emit uninitialized bytes for zero metadata
@ 2026-10-22 14:47 shaos
  2026-10-22 14:56 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: shaos @ 2026-10-22 14:47 UTC (permalink / raw)
  To: jhs
  Cc: Jiri Pirko, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Simon Horman, netdev, linux-kernel, security

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


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

* Re: [BUG] net/sched: act_ife can emit uninitialized bytes for zero metadata
  2026-10-22 14:47 [BUG] net/sched: act_ife can emit uninitialized bytes for zero metadata shaos
@ 2026-10-22 14:56 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2026-10-22 14:56 UTC (permalink / raw)
  To: shaos
  Cc: jhs, Jiri Pirko, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Simon Horman, netdev, linux-kernel, security

On Thu, Oct 22, 2026 at 02:47:39PM +0000, shaos wrote:
> 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.

You sent these all to public mailing lists, and you seem to have
forgotten to include a patch for them?  Please do so.

thanks,

greg k-h

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

end of thread, other threads:[~2026-10-22 14:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-22 14:47 [BUG] net/sched: act_ife can emit uninitialized bytes for zero metadata shaos
2026-10-22 14:56 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®