Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zero-initialize registers #37

Closed
wants to merge 1 commit into from

Conversation

jpsamaroo
Copy link

This ensures that return values of simple programs are predictable, and makes debugging a whole lot easier.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.005%) to 96.054% when pulling 6de5e56 on jpsamaroo:zero-init-reg into 089f627 on iovisor:master.

@qmonnet
Copy link

qmonnet commented Sep 28, 2020

Note that unless I'm mistaken, this may widen the gap between uBPF and kernel eBPF if programs start relying on 0-initialised registers (In the kernel, the verifier ensures that no register is used uninitialised). It may also introduce a divergence within uBPF between the VM and the JIT-compiler.

@jpsamaroo
Copy link
Author

It's also my intention to add support for verification similar to what the kernel does, which would give us the safety properties. But since we aren't currently checking for use of uninitialized registers, I don't see how this patch is in itself harmful.

I'll have to look into the JIT and see if I can add this zeroing behavior there as well. If not, then I can understand why this wouldn't be merge-worthy.

@jpsamaroo jpsamaroo marked this pull request as draft September 28, 2020 13:50
@jpsamaroo jpsamaroo mentioned this pull request Oct 28, 2020
@jpsamaroo
Copy link
Author

I think a verification pass is more than sufficient to check for use of uninitialized registers, so this PR is not needed.

@jpsamaroo jpsamaroo closed this Dec 17, 2020
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.

None yet

3 participants