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

kernel_lockdown denies iopl calls #6

Open
cgwalters opened this issue Sep 10, 2020 · 4 comments
Open

kernel_lockdown denies iopl calls #6

cgwalters opened this issue Sep 10, 2020 · 4 comments

Comments

@cgwalters
Copy link
Member

See https://bugzilla.redhat.com/show_bug.cgi?id=1862851
specifically: https://bugzilla.redhat.com/show_bug.cgi?id=1862851#c7

Basically in Secure Boot mode iopl() isn't accessible to userspace. Is there a non-iopl() mechanism to talk to the hypervisor? If not, we may need a kernel module to proxy this.

@lucab
Copy link
Contributor

lucab commented Sep 11, 2020

Thanks for forwarding this.
I've started digging through but I'm a bit puzzled as this is a straightforward port of the same logic in Go (which is used by Ignition) which is also going through iopl: https://github.com/vmware/vmw-guestinfo/blob/25eff159a728be87e103a0b8045e08273f4dbec4/vmcheck/vmcheck_linux.go#L19-L22

@lucab lucab changed the title Fails in Secure Boot mode kernel_lockdown denies iopl calls Sep 11, 2020
@lucab
Copy link
Contributor

lucab commented Sep 11, 2020

Indeed the Go logic seems to be broken in the same way, coreos/ignition#1092.

Without going to kernel modules, I think there is a vsock-based alternative: https://github.com/vmware/open-vm-tools/blob/f72e314e8b0df4e80c6b5f9b0c66ad2e9ce02e19/open-vm-tools/lib/rpcChannel/vsockChannel.c.

However I still need to check details, hw-version compatibility and any other caveat for that transport.

@cgwalters
Copy link
Member Author

Based on web searches I'm not finding anyone saying that open-vm-tools fails in this scenario, so we likely need to do the same thing indeed.

(It'd be nice to share code here between ignition and afterburn...dunno how easily we could expose a C library that go could link to that just does what ignition needs)

@lucab
Copy link
Contributor

lucab commented Oct 8, 2020

https://github.com/lucab/vmw_backdoor-rs/pull/8 introduced a dual privileged/unprivileged path in 0.2.0 which should be enough to bypass this iopl() failure via a fallback approach. I'm keeping this ticket open in case we consider implementing the vsock approach at some point in the future.

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

No branches or pull requests

2 participants