Skip to content

feat(rootfs): add /proc/self, /proc/1, /proc/uptime and /proc/mounts - #2570

Merged
chaliy merged 3 commits into
mainfrom
claude/proc-self
Oct 7, 2026
Merged

chaliy merged 3 commits into
mainfrom
claude/proc-self

Conversation

@chaliy

@chaliy chaliy commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Requested by Михайло · project thread

What changed

The rootfs now has a process view for the shell itself. /proc/self and /proc/1 hold identical static files:

  • status: uid/gid 1000, no capabilities
  • comm, cmdline, stat, cgroup (0::/), mounts
  • exe -> /bin/bash, fd/0..2 -> /dev/std*

/proc/uptime counts seconds since the filesystem was built. /proc/mounts lists the one bashkit-vfs root that df already shows. $BASHPID is now set to 1, the same as $$; before it was empty.

Why

Step 3 of the level-up roadmap ("OS shape"). Scripts probe /proc/self/status, /proc/1/cgroup (container detection), readlink /proc/self/exe and /proc/uptime, and they compare $BASHPID with $$. On bashkit these failed with "No such file", which real Linux never does.

Before / After

Before:

$ grep -E '^(Pid|Uid):' /proc/self/status; readlink /proc/self/exe; echo "[$BASHPID]"
grep: /proc/self/status: No such file or directory
[]

After:

$ grep -E '^(Pid|Uid):' /proc/self/status; readlink /proc/self/exe; echo "[$BASHPID]"
Pid:	1
Uid:	1000	1000	1000	1000
/bin/bash
[1]

Risk

  • Low
  • All content is static or computed from the virtual identity, never from the host, so TM-INF-003 still holds. There is still no environ.
  • The system layer is cached per identity, so startup cost is unchanged.
  • Three tests that asserted the old /proc listing were updated:
    • the threat-model probe now also checks the synthetic content
    • the snapshot diff prunes /proc/uptime, which changes on every read
    • L-PROC-003 checks that /proc/1/exe is the synthetic /bin/bash

Checklist

  • Tests added or updated (proc-self.test.sh, threat-model probe)
  • Backward compatibility considered

https://claude.ai/code/session_019aFikmptPc91Fj4N2iDXQA


Generated by Claude Code

@chaliy chaliy self-assigned this Oct 7, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
bashkit 37f874b Commit Preview URL

Branch Preview URL
Oct 07 2026, 05:36 PM

@chaliy
chaliy force-pushed the claude/proc-self branch 3 times, most recently from 5a93e7b to e4ec293 Compare October 7, 2026 16:34
chaliy added 3 commits October 7, 2026 17:35
The shell's own process gets a static synthetic view: status (uid 1000,
no capabilities), comm, cmdline, stat, cgroup, mounts, exe -> /bin/bash
and fd/0..2. /proc/uptime counts from filesystem build, /proc/mounts
lists the single bashkit-vfs root. $BASHPID is set (1, like $$); it was
empty. Never host data (TM-INF-003).

Claude-Session: https://claude.ai/code/session_019aFikmptPc91Fj4N2iDXQA
@chaliy
chaliy merged commit 1a8a5bc into main Oct 7, 2026
44 checks passed
@chaliy
chaliy deleted the claude/proc-self branch October 7, 2026 18:01
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