summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/bin/flamegraph-record
diff options
context:
space:
mode:
authorXiang Mei (Microsoft) <xmei5@asu.edu>2026-07-29 20:06:21 +0000
committerJakub Kicinski <kuba@kernel.org>2026-08-04 16:29:51 -0700
commit1a930d5734b77ceb0813bb7ecf99d1a89fbe0164 (patch)
tree1f59152dc9622d9c47ac36969bbab5791264d306 /tools/perf/scripts/python/bin/flamegraph-record
parent95a390ce6aee1a3927523d5221d290a71b514f7e (diff)
macvlan: require init-userns CAP_NET_ADMIN to raise bc_queue_len
IFLA_MACVLAN_BC_QUEUE_LEN accepts any u32 and becomes port->bc_queue_len_used, the only bound on port->bc_queue. rtnetlink checks CAP_NET_ADMIN against the target netns only, so a user who unshares a user+net namespace, creates a veth and puts a macvlan on it can set the backlog to 0xffffffff and flood broadcast frames until the host dies: Out of memory: Killed process 141 (su) UID:0 Kernel panic - not syncing: System is deadlocked on memory Call Trace: vpanic (kernel/panic.c:650) panic (kernel/panic.c:787) out_of_memory (mm/oom_kill.c:1166) __alloc_frozen_pages_noprof (mm/page_alloc.c:4914) alloc_pages_mpol (mm/mempolicy.c:2490) folio_alloc_noprof (mm/mempolicy.c:2591) filemap_fault (mm/filemap.c:3565) A fixed upper bound does not work. Deployments carrying 600-800 real-time audio streams run bc_queue_len=100000, and no constant serves both cases: the queue counts skbs, not bytes, and the frame size is attacker-chosen too (up to ETH_MAX_MTU on a veth the caller creates). Gate the elevated range on CAP_NET_ADMIN in the initial user namespace instead. A backlog of that size is a host-wide tuning decision, and an unprivileged owner of a namespace it created itself should not be able to make it; privileged configurations keep working unchanged.. Cc: stable+noautosel@kernel.org # local DoS by userns are a dime a dozen Reported-by: AutonomousCodeSecurity@microsoft.com Link: https://lore.kernel.org/r/20260706212556.3199234-1-xmei5@asu.edu Signed-off-by: Xiang Mei (Microsoft) <xmei5@asu.edu> Link: https://patch.msgid.link/20260729200621.2521588-1-xmei5@asu.edu Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/bin/flamegraph-record')
0 files changed, 0 insertions, 0 deletions