Commit Graph

2673 Commits

Author SHA1 Message Date
Chen Chengjun f8e4aefcca Add tmpfs support by wrapping ramfs 2025-08-29 15:45:20 +08:00
Zejun Zhao fc61f4d1b8 Use `IrqLine` abstraction for RISC-V timer interrupt 2025-08-29 10:49:48 +08:00
Yang Zhichao d84ad988d4 Implement `EnvironFileOps` to handle `/proc/[pid]/environ` 2025-08-29 10:07:29 +08:00
Zejun Zhao d3e27ae03a Use vDSO for fallback of user-provided sa_restorer on RISC-V platforms 2025-08-28 17:35:55 +08:00
Zejun Zhao aeaf103166 Add an explicit end of call stack for x86_64 2025-08-28 17:26:23 +08:00
Zejun Zhao 920ec7f521 Enable RISC-V stack unwinding on panic 2025-08-28 17:26:23 +08:00
Tao Su 05f053c56d Add signal & timer related syscall limitations to the book 2025-08-28 16:17:14 +08:00
jiangjianfeng 2098b11b68 Unify the implementation of /proc/[pid] and /proc/[pid]/task/[tid] 2025-08-27 15:22:08 +08:00
Arthur Paulino 888eecb350 Patch a futex vulnerability
If the futex wait operation was interrupted by a signal or timed out, the
`FutexItem` must be dequeued and dropped. Otherwise, malicious user programs
could repeatedly issue futex wait operations to exhaust kernel memory.

Due to asynchronicity, this removal can't be done by queue position nor by
futex key match up:
* The position might have changed during the pause as some earlier futex might
  have been dequeued
* If two futexes with the same key are enqueued and then one of them times out
  or is interrupted, a removal by key would likely dequeue the wrong futex

Therefore, we need to perform a removal by unique global futex ID.
2025-08-26 18:04:34 +08:00
Ruihan Li a6d37f0e79 Mark all kernel modules as private 2025-08-26 18:02:56 +08:00
Ruihan Li f35ae6fe1c Adjust visibility in `sem{,_set}.rs` 2025-08-26 18:02:56 +08:00
Ruihan Li 5c49142515 Remove `base` and `size` in `Vmar` 2025-08-26 18:02:56 +08:00
Ruihan Li a84897097e Remove `RangeLockItemBuilder` 2025-08-26 18:02:56 +08:00
Ruihan Li c9ac58e8df Remove unused "unregister" methods 2025-08-26 18:02:56 +08:00
Ruihan Li b2f17d11c6 Remove common enum suffixes 2025-08-26 18:02:56 +08:00
Ruihan Li 09e7355d87 Remove dead code in `file_table.rs` 2025-08-26 18:02:56 +08:00
Chen Chengjun b1bbd6c3fe Optimize the initialization logic during Asterinas init phase 2025-08-26 14:36:59 +08:00
Chen Chengjun 3882eb4000 Update docker version reference 2025-08-24 19:09:40 +08:00
Chen Chengjun a5c4566485 Include the VDSO library directly 2025-08-24 19:09:40 +08:00
Chen Chengjun 65344a187f Remove vDSO install in Nix 2025-08-24 19:09:40 +08:00
Zejun Zhao 0a126a0c8c Set correct default value for VdsoData::mask 2025-08-23 12:38:22 +08:00
Zejun Zhao 47b05143cf Correct vDSO data segment's permission 2025-08-23 12:38:22 +08:00
Zejun Zhao e68631d1b6 Implement arch-aware vDSO 2025-08-23 12:38:22 +08:00
Hsy-Intel 7fad653992 Use 6.16.0 Linux kernel for benchmark tests & Add Linux TDX benchmark tests 2025-08-22 17:20:14 +08:00
Chen Chengjun 8686d2b799 Bump the docker version for vDSO again 2025-08-22 17:16:40 +08:00
Ruihan Li a4aa745de1 Refine the lock usage in the vDSO module 2025-08-22 16:20:01 +08:00
Ruihan Li f457acdb8b Rewrite documentations in the vDSO module 2025-08-22 16:20:01 +08:00
Tate, Hongliang Tian 9ab035c654 Rename the docs directory to book 2025-08-21 19:16:12 +08:00
Qingsong Chen 1e675d4387 Replace stdenv with stdenvNoCC to optimize CI workflows 2025-08-21 17:34:39 +08:00
Chen Chengjun 92f36751d0 Bump the docker version for VDSO 2025-08-21 17:26:07 +08:00
Tao Su 605605cfc5 Add I/O control related syscall limitation to the book 2025-08-21 15:15:02 +08:00
Tao Su 9fe04c2294 Add mount-related syscall limitations to the book 2025-08-21 15:15:02 +08:00
Ruihan Li 924d87398a Introduce `first_context_switch` 2025-08-20 20:12:38 +08:00
Ruihan Li 2d3cfb53e0 Swap `context_switch` arguments 2025-08-20 20:12:38 +08:00
Tao Su 226ea2865c Resolve `semget01` failure by fixing key limit and adding `IPC_STAT` 2025-08-20 19:57:14 +08:00
Ruihan Li 85f17ff159 Replace `parse_u32` with `u32::from_str_radix` 2025-08-20 13:19:50 +08:00
Ruihan Li 6b6c64c591 Rename `atomic_update` to `atomic_fetch_update` 2025-08-20 13:17:57 +08:00
Arthur Paulino a73f210c7a Make `wake_robust_futex` atomic
Replace `VmWriter::atomic_update` with `VmWriter::atomic_compare_exchange`,
which takes the old value for comparison and new value instead of a
closure to compute it. This version has one less unsafe call.

Then use `atomic_compare_exchange` to reimplement the looping logic
of `wake_robust_futex` and make it atomic.
2025-08-19 19:22:12 +08:00
Chen Chengjun fc5a12356a Fix LOONGARCH clippy warnings 2025-08-19 19:20:54 +08:00
Chen Chengjun 9507475102 Fix RISCV clippy warnings 2025-08-19 19:20:54 +08:00
Chen Chengjun a049717813 Add documents for environment variables in the Book 2025-08-19 19:20:54 +08:00
Chen Chengjun bf5360d721 Enable arch-aware make check 2025-08-19 19:20:54 +08:00
Zhang Junyang 1452aab69c Optimize the space for `TlbFlushOp`s 2025-08-16 22:09:29 +08:00
Zhang Junyang d0b98130cf Don't use `map` to return values 2025-08-16 22:09:29 +08:00
Hsy-Intel e725bf4ab8 Update Docker image references to remove '-tdx' suffix for consistency 2025-08-16 09:17:44 +08:00
Hsy-Intel a67df5fa3b Switch to a new Docker image 2025-08-16 09:17:44 +08:00
Arthur Paulino c31c6110f6 chore: use `jhash` to compute the `FutexKey` hash
This patch pays the price of making the instantiation of `FutexKey`
more expensive to achieve two goals:
* Minor: make `match_up` slightly faster
* Major: make futex bucket allocation balancing more robust
2025-08-16 09:16:50 +08:00
Arthur Paulino 91351e338f fix: avoid distribution skew in `FutexBucketVec::get_bucket`
Doing `addr / self.size()` before masking with `(self.size() - 1)`
removes the low bits entirely, which causes adjacent addresses
(modulo `self.size()`) to map to the same bucket, entailing bad
load balance. This patch solves that.

Further, make `FutexBucketVec::new` and `FutexBucketVec::get_bucket`
private, as they only make sense within the scope of `futex.rs`,
where the invariant of `size` being a power of two is guaranteed to
hold via `get_bucket_count` (which is also private).
2025-08-16 09:16:50 +08:00
Arthur Paulino c345876bc0 chore: avoid several `FutexKey` copies
Use shared references instead of copied objects on some functions
that don't necessarily require ownership of `FutexKey`.

Remove the `Copy` derivation of `FutexKey` to discourage suboptimal
copies.
2025-08-16 09:16:50 +08:00
Hsy-Intel 35ac8a407b Bump the Docker image version 2025-08-15 15:27:09 +08:00