feat: re-instrument per STUB rules - all silent placeholders now panic

- PE-E03 pe_loader.c: unsupported base-reloc type silently skipped -> panic
- PE-E04 pe_shim.c ReadFile: fake TRUE+0-bytes ("pretend EOF") -> panic
- PE-E05 pe_shim.c CreateFileA: no file backend -> panic (no honest-failure excuse)
- PE-E06/E07 x86emu32.c: emu IAT unimplemented API / shim index OOB -> panic
- NETST-E01 net.c: netdev stats all-zero placeholder ("lying zero traffic") -> panic
- apic.c comment: SIPI reserved now points to DKM-E03 skeleton
- pe_dll_manager comments: circular-dep stub call now documented as PE-E01
- virtio_blk.c: capacity declaration marked as instrumentation whitelist
- QEMU verify: wizard -> Save -> verify ok -> login success -> desktop ready,
  zero spurious panics

[STUB] P1/UTSM/pe+net re-instrument sweep | 剩余STUB命中=101 (全部为 panic 坐标注释 /
IDT halt-stub 防御术语 / 白名单) | “未成之物,不留活口”
This commit is contained in:
Linehu
2026-10-03 12:44:57 +08:00
parent cd39caa10c
commit 301006d611
13 changed files with 78 additions and 18 deletions
+7 -5
View File
@@ -1,5 +1,6 @@
#include <utsm/net.h>
#include <utsm/log.h>
#include <utsm/panic.h>
/*
* 最小 netdev 注册表:
@@ -92,14 +93,15 @@ static int net_is_wireless_impl(u32 index) {
}
/* 统计查询:返回驱动层累计的收发统计。
* 当前实现为占位:返回全零统计。
* 后续由驱动在 tx/rx 回调内更新共享统计区,此处直接读取。
* 驱动层的本地统计(如 e1000 的 g_stat_tx_ok 等)与 netdev 层统计
* 通过 driver_ctx 统一后即可返回精确值。 */
* 严格错误策略插桩:全零统计占位 = 向上层谎报"网卡零流量",
* 零降级 panic(NETST-E01)。驱动层统计区接入(driver_ctx 共享统计)
* 后才能提供真实语义。 */
static int net_device_stats_impl(u32 index, dkm_net_stats *out) {
if (!out) return -1;
if (index >= g_net_device_count) return -2;
/* 占位:全零。后续由驱动填充实际统计。 */
(void)index;
panic_full("NETST-E01 NET STATS NOT IMPLEMENTED",
"netdev stats placeholder returns all-zero: driver stats wiring not implemented", 0);
for (u32 i = 0; i < sizeof(dkm_net_stats); i++)
((u8 *)out)[i] = 0;
return 0;