Commit Graph

20 Commits

Author SHA1 Message Date
Red Bear OS 7d40dff006 base: fix round-8 deferred stubs in initfs, randd, ptyd
initfs/tools: buffer inode table writes in memory and flush with a
  single write_all_at instead of one syscall per inode header.

randd: build a proper entropy pool using SHA-256 that mixes hardware RNG
  (RDRAND/RNDRRS) with timing-derived entropy. The pool is re-seeded
  every 4096 reads and on every write. User-supplied entropy from writes
  is added to the pool rather than directly replacing the PRNG state.

ptyd: VLNEXT now properly quotes the next input byte — sets a flag that
  causes the next byte to bypass all control-character processing and be
  pushed directly to the line buffer. VDISCARD now flushes the cooked
  input buffer instead of being a silent no-op.
2026-07-27 09:16:33 +09:00
Red Bear OS 9bbdc2cafa Merge upstream/main (59cf8189) into submodule/base
Sync the base fork with 13 upstream commits (xhci event-processing
dedup + IRQ race fix, randd permission simplification, nvmed TimeSpec
fix, /dev/ptmx, fpath legacy-path cleanup, dynamically-linked init
fix, and more). Brings process_one_event into the tree, satisfying the
verify-fork-functions gate for base.

Conflicts resolved (3 of 8 overlapping files; 5 auto-merged):

- drivers/usb/xhcid/src/xhci/irq_reactor.rs: took upstream's
  process_one_event/EventProcessResult refactor (b2ed85ea) including
  the a01d3ce6 race fix (process events between NoEvent and
  unmasking), and re-applied the Red Bear SPURIOUS_REBOOT quirk on the
  NoEvent warning (downgrade to debug when quirked).

- randd/src/main.rs: took upstream's permission-handling
  simplification (e26db606); re-applied the RB fcntl improvement
  (F_GETFL/F_GETFD/F_SETFL/F_SETFD handling, Linux random_fops xref)
  and the is_cpu_feature_detected early-return cleanup. Dropped
  test_scheme_perms (deleted by upstream's simplification).

- Makefile: kept upstream's new /dev symlink block (dev/null, ptmx,
  random, urandom, zero, tty, stdin/stdout/stderr).

Verified: cargo check clean; 57/57 tests pass (xhcid 35, usbhubd 14,
xhci trb 8); verify-fork-functions.sh --no-fetch base reports all
upstream functions present.
2026-07-19 05:47:27 +09:00
bjorn3 e26db606d1 randd: Significantly simplify file permission handling
There isn't really a need to support chown/chmod of the rand scheme. It
adds a fair bit of complexity without adding any security over
unconditionally allowing reads by anyone and writes by root. If we want
to restore support for chown/chmod, we should probably do so in a
generic way that covers all device schemes.
2026-07-16 18:19:44 +02:00
Red Bear OS bd595851e2 base: apply Red Bear patches on latest upstream/main
251 files: init, acpid, ipcd, netcfg, ihdgd, virtio-gpud, scheme-utils,
inputd, block driver, ptyd, ramfs, randd, initfs bootstrap, path deps,
version +rb0.3.1, author attribution
2026-07-11 11:39:24 +03:00
Wildan M d75260e0d8 randd: Fix ARM hardware seed detection 2026-07-05 11:07:37 +07:00
Ibuki Omatsu 372b200f26 refactor: Adapt to userspace fd allocation 2026-07-01 08:20:05 -06:00
bjorn3 daf726c30d scheme-utils: Have FpathWriter handle writing the scheme name 2026-04-19 19:07:41 +02:00
bjorn3 64d23e9e05 scheme-utils: Introduce FpathWriter helper 2026-04-19 19:07:41 +02:00
bjorn3 28900f7c49 scheme-utils: Introduce Blocking as counterpart to ReadinessBased for blocking schemes 2026-04-19 11:05:04 +02:00
bjorn3 317a0178b6 Introduce scheme-utils crate and HandleMap type
HandleMap deduplicates the id assignment for handles and unlike most
existing implementations handles overflow just fine.
2026-04-13 22:19:07 +02:00
Philipp Bartsch 32995d5c68 randd: Add hardware randomness source for aarch64
Currently feature detection via
std::arch::is_aarch64_feature_detected!("rand") always returns false.

Closes: https://gitlab.redox-os.org/redox-os/base/-/issues/11
2026-03-29 22:22:16 +02:00
Ibuki Omatsu 2738f69224 feat: Implement std_fs_call handling to initfs, ramfs, acpi and xhci 2026-02-28 08:15:16 -07:00
bjorn3 7ebeceb41d init: Allow init to register the scheme for a daemon
Unfortunately the scheme still has to be created by the daemon due to a
kernel bug, but once that is fixed, it would allow delayed spawning of
scheme daemons.
2026-02-18 22:40:09 +01:00
Ibuki Omatsu 334928f151 feat: Introduce userspace namespace manager and adapt all schemes. 2026-01-20 20:56:58 -07:00
bjorn3 c574eda94a randd: Update to redox-scheme 0.8 2025-12-13 13:06:02 +01:00
bjorn3 f1057b6750 daemon: Abort on errors
All users did this anyway. And handling it inside the daemon crate
allows avoiding a panic of the parent process when the child process
panicked.
2025-12-03 21:55:47 +01:00
bjorn3 54d81e7423 Merge redox-daemon into this repo 2025-12-03 21:07:13 +01:00
bjorn3 582005fbbe Remove the socket field of RandScheme
No code inside RandScheme needs it. And the main function can access the
socket it opened directly. This also fixes running tests for randd.
2025-07-04 21:58:29 +02:00
bjorn3 ef7154ee72 Fix a bunch of warnings 2025-04-06 16:19:49 +02:00
bjorn3 f25ddc236b Add 'randd/' from commit '80e27cb3d923e3a2c91b59122376e18233111a99'
git-subtree-dir: randd
git-subtree-mainline: 2179992ac3
git-subtree-split: 80e27cb3d9
2025-02-18 21:32:14 +01:00