Skip to content

bbssd: add deleted-data-remanence experiment logging#190

Open
NiceGuy1313 wants to merge 1 commit into
MoatLab:masterfrom
NiceGuy1313:experiment/data-remanence-logging
Open

bbssd: add deleted-data-remanence experiment logging#190
NiceGuy1313 wants to merge 1 commit into
MoatLab:masterfrom
NiceGuy1313:experiment/data-remanence-logging

Conversation

@NiceGuy1313

Copy link
Copy Markdown

Add debug-only instrumentation to the BBSSD FTL to study whether deleted data survives in the emulated device. FTL behavior is unchanged: every addition is gated on the FEMU_EXP_LOG / FEMU_SECRET env vars and only emits logs (to stderr, so it survives the tee pipe unbuffered).

ftl.c:

  • EXP_LOG macro + PPA_FMT/PPA_ARG human-readable PPA formatting
  • femu_dbg_dump_lpn(): hex/ascii dump of a logical page from the DRAM backend (data lives at LBA offset in mbe->logical_space, not at a PPA)
  • femu_dbg_scan_secret(): scan the whole backend for FEMU_SECRET
  • content-based watch list so only the secret-bearing LPN/block is logged
  • log points: [WRITE] [INVALIDATE:overwrite] [INVALIDATE:trim] [GC_MOVE] [ERASE], plus [SCAN:after_trim] and FEMU_DUMP_LPN-triggered [DUMP]

femu-scripts/run-blackbox.sh:

  • forward FEMU_EXP_LOG/FEMU_SECRET/FEMU_DUMP_LPN through sudo (sudo otherwise strips them so getenv() returns NULL inside qemu)

Description

Brief description of changes made.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Code refactoring

Testing

  • I have tested my changes locally
  • I have added tests that prove my fix is effective or that my feature works
  • All existing tests pass
  • I have tested across multiple FEMU modes (if applicable)

FEMU Modes Tested

  • BlackBox SSD (BBSSD)
  • WhiteBox SSD (OCSSD)
  • Zoned Namespace SSD (ZNSSD)
  • NoSSD
  • Not applicable

Platform Testing

  • Ubuntu 20.04/22.04
  • Other distributions (specify): ___________
  • Build verification completed

Checklist

  • My code follows QEMU coding standards
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new compiler warnings
  • I have updated documentation if necessary
  • No trailing whitespace or C++ style comments in C files

Related Issues

Fixes #(issue number)

Additional Notes

Any additional information, configuration changes, or notes for reviewers.

Add debug-only instrumentation to the BBSSD FTL to study whether deleted
data survives in the emulated device. FTL behavior is unchanged: every
addition is gated on the FEMU_EXP_LOG / FEMU_SECRET env vars and only emits
logs (to stderr, so it survives the tee pipe unbuffered).

ftl.c:
- EXP_LOG macro + PPA_FMT/PPA_ARG human-readable PPA formatting
- femu_dbg_dump_lpn(): hex/ascii dump of a logical page from the DRAM
  backend (data lives at LBA offset in mbe->logical_space, not at a PPA)
- femu_dbg_scan_secret(): scan the whole backend for FEMU_SECRET
- content-based watch list so only the secret-bearing LPN/block is logged
- log points: [WRITE] [INVALIDATE:overwrite] [INVALIDATE:trim] [GC_MOVE]
  [ERASE], plus [SCAN:after_trim] and FEMU_DUMP_LPN-triggered [DUMP]

femu-scripts/run-blackbox.sh:
- forward FEMU_EXP_LOG/FEMU_SECRET/FEMU_DUMP_LPN through sudo (sudo
  otherwise strips them so getenv() returns NULL inside qemu)
@NiceGuy1313 NiceGuy1313 force-pushed the experiment/data-remanence-logging branch from c7aa2ec to 29e927a Compare June 20, 2026 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant