Skip to content

xen/trace: Fix leakage of uninitialised stack into the tracebuffer

Andrew Cooper xen-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest12 patches 39 repliesIn review
  2. v16 patches 12 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12xen/trace: Don't over-read trace objectsxen/arch/x86/hvm/hvm.c xen/common/sched/rt.c xen/common/trace.c+26 -2410 replies
2/12xen/memory: Remove tail padding from TRC_MEM_* recordstools/xentrace/formats tools/xentrace/xenalyze.c xen/arch/x86/mm/p2m-pod.c +1 more+21 -161 reply
3/12xen/credit2: Remove tail padding from TRC_CSCHED2_* recordsxen/common/sched/credit2.c+28 -191 reply
4/12x86/hvm: Reduce stack usage from HVMTRACE_ND()xen/arch/x86/hvm/svm/svm.c xen/arch/x86/hvm/vmx/vmx.c xen/include/asm-x86/hvm/trace.h+17 -283 replies
5/12x86/hvm: Remove duplicate calls caused by tracingxen/arch/x86/hvm/hpet.c xen/arch/x86/hvm/vlapic.c xen/arch/x86/hvm/vpic.c+29 -182 replies
6/12xen/credit2: Clean up trace handlingxen/common/sched/credit2.c+153 -1621 reply
7/12xen/rt: Clean up trace handlingxen/common/sched/rt.c+46 -511 reply
8/12xen/sched: Clean up trace handlingxen/common/sched/core.c xen/common/sched/credit.c xen/common/sched/null.c+45 -391 reply
9/12xen/trace: Minor code cleanupxen/common/trace.c xen/include/asm-x86/hvm/trace.h+16 -232 replies
10/12x86/pv: Move x86/trace.c to x86/pv/trace.cxen/arch/x86/Makefile xen/arch/x86/pv/Makefile xen/arch/x86/pv/emul-inv-op.c +7 more+17 -581 reply
11/12xen/arch: Drop asm-*/trace.hxen/common/trace.c xen/include/asm-arm/trace.h xen/include/asm-x86/trace.h +1 more+6 -252 replies
12/12x86/trace: Clean up trace handlingxen/arch/x86/irq.c xen/arch/x86/mm/p2m-pt.c xen/arch/x86/mm/shadow/multi.c +1 more+78 -932 replies

Reviews trailers per patch

All 12 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchJan BeulichDario FaggioliJulien Grall
SeriesA-b A-b R-b
1/12R-b
2/12R-b R-b
3/12R-b R-b
4/12R-b
5/12R-b
6/12R-b R-b
7/12R-b
8/12R-b
9/12R-b R-b
10/12R-b
11/12R-b A-b
12/12R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH v2 00/12] xen/trace: Fix leakage of uninitialised stack into the tracebuffer

Patches 1-3 fix bugs causing uninitialised stack to leak into the trace buffers. Xentrace is a developer/debugging activity restricted to fully privileged entities, so the leaking of uninitialised stack contents is not a security concern here.

Patches 4 and 5 are cleanup worthy of backporting, because their knock-on effects in release builds.

Patches 6 and later are cleanup and probably not for backporting. They convert all trace records to using fixed types, and move some PV-specifics to only be built for PV && TRACEBUFFER, and removing stub files from all architectures.

I have yet more cleanup in progress making most of the macros disappear, but this series is getting long enough already, (and taking time I don't really have).

Andrew Cooper (12):
xen/trace: Don't over-read trace objects xen/memory: Remove tail padding from TRC_MEM_* records xen/credit2: Remove tail padding from TRC_CSCHED2_* records x86/hvm: Reduce stack usage from HVMTRACE_ND() x86/hvm: Remove duplicate calls caused by tracing xen/credit2: Clean up trace handling
xen/rt: Clean up trace handling
xen/sched: Clean up trace handling
xen/trace: Minor code cleanup
x86/pv: Move x86/trace.c to x86/pv/trace.c xen/arch: Drop asm-*/trace.h
x86/trace: Clean up trace handling

 tools/xentrace/formats               |   4 +
 tools/xentrace/xenalyze.c            |  12 +-
 xen/arch/x86/Makefile                |   1 -
 xen/arch/x86/hvm/hpet.c              |  15 +-
 xen/arch/x86/hvm/hvm.c               |   5 +-
 xen/arch/x86/hvm/svm/svm.c           |   8 +-
 xen/arch/x86/hvm/vlapic.c            |  23 ++-
 xen/arch/x86/hvm/vmx/vmx.c           |   9 +-
 xen/arch/x86/hvm/vpic.c              |   9 +-
 xen/arch/x86/irq.c                   |   4 +-
 xen/arch/x86/mm/p2m-pod.c            |  17 +-
 xen/arch/x86/mm/p2m-pt.c             |   6 +-
 xen/arch/x86/mm/shadow/multi.c       |   2 +-
 xen/arch/x86/pv/Makefile             |   1 +
 xen/arch/x86/pv/emul-inv-op.c        |   2 +-
 xen/arch/x86/pv/emul-priv-op.c       |   1 +
 xen/arch/x86/pv/ro-page-fault.c      |   2 +-
 xen/arch/x86/pv/trace.c              | 141 ++++++++++++++
 xen/arch/x86/pv/traps.c              |   2 +-
 xen/arch/x86/trace.c                 | 159 ----------------
 xen/arch/x86/traps.c                 |   3 +-
 xen/common/memory.c                  |   4 +-
 xen/common/sched/core.c              |   4 +-
 xen/common/sched/credit.c            |  38 ++--
 xen/common/sched/credit2.c           | 344 +++++++++++++++++------------------
 xen/common/sched/null.c              |  42 +++--
 xen/common/sched/rt.c                | 121 ++++++------
 xen/common/trace.c                   |  60 +++---
 xen/include/asm-arm/trace.h          |  12 --
 xen/include/asm-x86/hvm/trace.h      |  30 ++-
 xen/include/asm-x86/{ => pv}/trace.h |   8 +-
 xen/include/xen/trace.h              |  13 +-
 32 files changed, 537 insertions(+), 565 deletions(-)
 create mode 100644 xen/arch/x86/pv/trace.c
 delete mode 100644 xen/arch/x86/trace.c
 delete mode 100644 xen/include/asm-arm/trace.h
 rename xen/include/asm-x86/{ => pv}/trace.h (92%)
Signature · 1 line
2.11.0