Skip to content

Conversation

@sirtimid
Copy link
Contributor

@sirtimid sirtimid commented May 5, 2025

This PR re-enables hardening for the Kernel class, which was previously disabled to facilitate testing. With the recent architectural improvements that split out components like KernelQueue, we can now properly test the Kernel without compromising security. The PR adopts a dependency-based mocking approach (properly mocking KernelQueue via vi.hoisted, injecting mock databases, etc.) instead of attempting to modify hardened objects directly. This ensures tests respect object capability security principles while still providing comprehensive coverage. Several new tests have been added for previously untested methods.

@sirtimid sirtimid requested a review from a team as a code owner May 5, 2025 17:42
@sirtimid sirtimid force-pushed the sirtimid/harden-kernel branch from a184280 to d0ebe2e Compare May 6, 2025 09:16
return this.queueMessage(bootstrapRoot, 'bootstrap', [roots]);
}
const bootstrapRoot = rootIds[config.bootstrap];
if (bootstrapRoot) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The isClusterConfig(config) above makes bootstrap required so this is not needed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this apply to the if (config.bootstrap && !config.vats[config.bootstrap]) check above, too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeap. Fixed

@sirtimid sirtimid force-pushed the sirtimid/harden-kernel branch from 42247fa to dc5bddd Compare May 6, 2025 13:55
@sirtimid sirtimid requested a review from grypez May 6, 2025 13:58
Copy link
Member

@rekmarks rekmarks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@sirtimid sirtimid enabled auto-merge (squash) May 6, 2025 14:15
@sirtimid sirtimid merged commit 9501597 into main May 6, 2025
22 checks passed
@sirtimid sirtimid deleted the sirtimid/harden-kernel branch May 6, 2025 14:16
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.

4 participants