Skip to content

Instantly share code, notes, and snippets.

@thesmartshadow
Created September 26, 2026 14:50
Show Gist options
  • Select an option

  • Save thesmartshadow/f4b5c918f86204229d5c39566e7aa84a to your computer and use it in GitHub Desktop.

Select an option

Save thesmartshadow/f4b5c918f86204229d5c39566e7aa84a to your computer and use it in GitHub Desktop.

C1 — cover letter re-read against the six patches that exist

Rewrote it. Subject is now [PATCH net-next v3 0/6] vxlan: vnifilter: bound a single request and account per-VNI memory. The full merged file is printed above. What changed (diff vs the previous version):

  • Deleted the entire macro-flip paragraph — every mention of the tree-wide netdev_alloc_pcpu_stats() change, netdevice.h, qdisc_alloc()/tcf_idr_create(), and alloc_percpu().
  • Patch 5 is now described as what it is: charges the per-VNI node and its per-CPU stats block at the vxlan call site.
  • Added one-line descriptions of patches 2/3 and patch 6 so every patch is covered.
  • Confirmed no ODEBUG / kobject / baseline / splat mention anywhere in the cover (grep returned none — they were only ever in the report, never the cover).
  • No prose line exceeds 75 chars (only the two lore URLs, which are refs).

C2 — full test run redone on the 6-patch KASAN kernel (7-patch results discarded)

  • KASAN+PROVE_LOCKING build (6-patch): exit 0, 0 warnings.
  • Calibration on this build (kunit.enable=1): 177 BUG: KASAN reports + banner → KASAN fires; /proc/lockdep present; in the clean run debug_locks=1 before and after → lockdep armed throughout.
  • BEFORE (baseline = net-next-head vnifilter.c, same build infra): selftest 44 passed / 5 failed — the 5 failures are exactly the new limit/range cases; vni 16777216 accepted rc=0 (feature absent).
  • AFTER (6-patch series): selftest 49 passed / 0 failed; round-trip 5/5 OK; T3 three distinct extacks (integer out of range / Request asks for more than 4096 VNIs / vni start nor end found); T4 add / re-add / add-range / dump / stats-dump / del-range / del-single all rc=0; debug_locks=1 before and after; KASAN 0 reports from series paths; only the 5 pre-existing kobject_delayed_cleanup ODEBUGs (identical on baseline).
  • Round-trip both directions on 6-patch code: PASS with patch 4 (above); FAIL without it (cap-no-clamp-6, incremental build) — every dumped entry accepted FAIL, same ranges FAIL.
  • Accounting re-measured on the call-site form: kmalloc-cg-128 +65580, unaccounted kmalloc-128 +0, memcg percpu 16777216 B (65536×256) → ACCOUNTED.

C3 — every claim marked V (ran a command) / S (cited source) / N (neither → removed)

One N found and removed: patch 3 and the cover both said "a delete allocates nothing." vxlan_vni_del() calls vxlan_vnifilter_notify() → nlmsg_new(), so a delete does allocate a transient skb. Changed to "creates no VNI node or per-CPU stats block" (accurate — those are the persistent per-VNI allocations the cap concerns). Everything else is V or S:

┌───────────────────────────────────────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────────────────────┐ │ Claim │ Mark │ ├───────────────────────────────────────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────┤ │ P1: entry validated only at dispatch; first entry applied+notified before second rejected │ S (source: vni_filter_policy bare NLA_NESTED; dispatch loop) │ ├───────────────────────────────────────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────┤ │ P1: linking validates whole message up front, rejects as a unit │ S (lib/nlattr.c recursion) + V (VM: multi-entry over-cap installs nothing) │ ├───────────────────────────────────────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────┤ │ P1: errno-ordering, now -EINVAL before -ENODEV/-EOPNOTSUPP │ S (source: nlmsg_parse precedes dev lookup) │ ├───────────────────────────────────────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────┤ │ P1: inner nla_parse_nested stays, fills vattrs, can no longer fail │ S (source) │ ├───────────────────────────────────────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────┤ │ P2: int v + END=0xffffffff walks the space │ S (source: the loop) │ ├───────────────────────────────────────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────┤ │ P2: VNI ≥ 2²⁴ stored, vxlan_vni_field() shifts without masking │ S (verified vxlan_vni_field, VXLAN_N_VID) │ ├───────────────────────────────────────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────┤ │ P2: vxlan_mdb.c already range-validates to VXLAN_N_VID-1 │ S (verified this pass: vni_range {.max=VXLAN_N_VID-1}) │ ├───────────────────────────────────────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────┤ │ P2: out-of-range rejected at policy, nothing allocated │ S + V (VM T3: -ERANGE) │ ├───────────────────────────────────────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────┤ │ P2: u32 matches vxlan_vni_add()/vxlan_vni_del() signatures │ S (verified signatures) │ ├───────────────────────────────────────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────┤ │ P3: entry is 20 bytes; many fit → per-entry bound insufficient │ S (derivable from nla layout: 4+8+8) │ ├───────────────────────────────────────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────┤ │ P3: "delete allocates nothing" → "creates no VNI node or stats block" │ N→fixed; now S (verified vxlan_vni_del path) │ ├───────────────────────────────────────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────┤ │ P3: vxlan_vnigroup_uninit() runs the same teardown unbounded under rtnl │ S (verified: ndo_uninit under ASSERT_RTNL) │ ├───────────────────────────────────────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────┤ │ P4: dump coalesces unbounded; emits an entry it won't read back │ S + V (cap-no-clamp FAIL) │ ├───────────────────────────────────────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────┤ │ P4: resume unchanged; idx counts nodes, run gapless = vnirange()+1 │ S (source: dump loop) + V (round-trip resumes) │ ├───────────────────────────────────────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────┤ │ P5: queues/ethtool/napi already GFP_KERNEL_ACCOUNT (c948f51c1654) │ S + V (grepped net/core/dev.c; commit resolves) │ ├───────────────────────────────────────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────┤ │ P5: qdisc/tcf pair macro with bare alloc_percpu(); split would be created │ S+V (read both functions; alloc_percpu=GFP_KERNEL this pass) │ ├───────────────────────────────────────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────┤ │ P5: sole caller handles NULL │ S (verified: vxlan_vni_alloc called once, line 740) │ ├───────────────────────────────────────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────┤ │ P6: vxlan_vni_add() folds existing VNI → absence-first needed │ S + V (test passes) │ ├───────────────────────────────────────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────┤ │ P6: bridge(8) sends one entry per comma item in one message │ S (iproute2 source) + V (VM multi-entry rejected as one msg) │ ├───────────────────────────────────────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────┤ │ P6: without clamp the dump replay fails; with it, passes │ V (both directions) │ ├───────────────────────────────────────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────┤ │ Cover uAPI bullets (2²⁴, 4096, errno-order, dump split) │ S + V │ └───────────────────────────────────────────────────────────────────────────────────────────┴────────────────────────────────────────────────────────────────────────────┘

The specific ones you flagged: "nothing is allocated" is true only for the range/out-of-range case at policy validation (patch 2) — corrected everywhere else; no call-site/file counts remain (the "34 sites/25 files" claim left with the dropped macro patch); the bridge(8) claim is source- and VM-verified; the dump claims are source- and VM-verified.

Dry run — 7 messages, nothing sent

git send-email --dry-run --thread --no-chain-reply-to → Dry-OK for all 7 (cover 0/6 + 1/6…6/6), cover as thread root, every patch In-Reply-To the cover, no reference to the v2 posting (fresh thread). It connects to no server.

Stopped. Nothing has been sent. The final v3-0000-cover-letter.patch + v3-0001..0006 are in ~/research/cap-v3/; the series KASAN kernel is rebuilding back to the 6-patch series so the artifact matches; roll-v3 remains untouched and held.

✻ Cooked for 30m 29s · done 2:22 PM

● Background command "Stop hung qemu and rebuild series KASAN kernel" completed (exit code 0)

The series KASAN kernel rebuild finished. Let me confirm the artifact is restored to the 6-patch series and give a final status.

Ran 1 shell command

Artifact restored and everything is clean.

Final state

  • build-capv3-san is back to the 6-patch series KASAN kernel (rebuild exit 0, 0 warnings).
  • wt-capv3 working tree clean, deliverable tip dd7d3d0a4ed4, all 6 clamp/cap markers present.
  • No VM running.

All three checks are complete and the series is send-ready but unsent:

  • C1 — cover letter rewritten to describe only the six patches that exist; new subject bound a single request and account per-VNI memory; every macro/netdevice.h/tree-wide/qdisc/tcf mention deleted; no ODEBUG/baseline mention; all prose ≤75 chars. Printed in full above with the diff.
  • C2 — full run redone on the 6-patch KASAN+lockdep kernel: calibration 177 KASAN reports + lockdep armed; BEFORE (baseline) 44/5 with the 5 new cases failing; AFTER 49/0; round-trip proven both directions on 6-patch code; T4 clean; KASAN 0 / debug_locks=1; accounting re-measured ACCOUNTED.
  • C3 — every changelog and cover claim marked V/S; the one N ("a delete allocates nothing") corrected in both patch 3 and the cover; the previously-wrong claims (call-site counts, bridge(8) behaviour, dump behaviour, "nothing allocated") re-verified or scoped.
  • Dry run — 7 messages Dry-OK, fresh thread, nothing sent.

Deliverables in ~/research/cap-v3/: v3-0000-cover-letter.patch + v3-0001..0006, plus the updated PHASE1-report.md / PHASE1-design.md / PHASE1-three-seats.md. roll-v3 untouched and held. STATE.md reflects the 6-patch (b) outcome.

I've stopped here — nothing has been sent, and I won't send without your explicit go-ahead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment