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

`qrexec-client-vm \$dispvm` loses stderr, while `qrexec-client-vm dispN` works fine #2181

Closed
rustybird opened this Issue Jul 18, 2016 · 5 comments

Comments

Projects
None yet
2 participants
@rustybird

Qubes OS version:

Affected TemplateVMs:

fedora-23


Using the following qubes.StderrTest RPC service:

#!/bin/sh
set -e

echo stderr okay >&2
echo stdout okay
xterm  # for convenience (does not make a difference)

If I run qrexec-client-vm \$dispvm qubes.StderrTest to launch a new dvm, the "stderr okay" message is missing.

But it is present, as it should be, for any other remote VM. Curiously, this works even for an explicitly named, already running dvm (e.g. disp12).

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jul 18, 2016

Member

This is caused by the way how DispVM is started in Qubes 3.x. Basically opening DispVM is a service call to dom0, then dom0 calls a service in newly created DispVM. And services called to dom0 do not return stderr, to not leak any sensitive data by mistake.
While it is possible to fix this, I'd say the fix is too intrusive to do it in stable release. But in Qubes 4.0 I think we can change this to be direct VM-VM connection.

Member

marmarek commented Jul 18, 2016

This is caused by the way how DispVM is started in Qubes 3.x. Basically opening DispVM is a service call to dom0, then dom0 calls a service in newly created DispVM. And services called to dom0 do not return stderr, to not leak any sensitive data by mistake.
While it is possible to fix this, I'd say the fix is too intrusive to do it in stable release. But in Qubes 4.0 I think we can change this to be direct VM-VM connection.

@marmarek marmarek added this to the Release 4.0 milestone Jul 18, 2016

@rustybird

This comment has been minimized.

Show comment
Hide comment
@rustybird

rustybird Jul 18, 2016

Is there by any chance a workaround if stderr is supposed to end up in dom0 anyway? I'm (essentially) doing the following in dom0 for split dm-crypt:

outer_dvm=$(qfile-daemon-dvm LAUNCH dom0 '' red)
...
qvm-run --pass-io "$outer_dvm" 'qrexec-client-vm \$dispvm getKeyFromLuksHeader <header >key'

So the outer dvm receives the dm-crypt key from the inner dvm, while dom0 is supposed to see the inner dvm's cryptsetup prompts etc. on stderr as they happen.

Is there by any chance a workaround if stderr is supposed to end up in dom0 anyway? I'm (essentially) doing the following in dom0 for split dm-crypt:

outer_dvm=$(qfile-daemon-dvm LAUNCH dom0 '' red)
...
qvm-run --pass-io "$outer_dvm" 'qrexec-client-vm \$dispvm getKeyFromLuksHeader <header >key'

So the outer dvm receives the dm-crypt key from the inner dvm, while dom0 is supposed to see the inner dvm's cryptsetup prompts etc. on stderr as they happen.

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jul 18, 2016

Member

If you're doing it from dom0 anyway, you can split the operation into steps:

qvm-run --pass-io "$outer_dvm" 'cat header' | qfile-daemon-dvm getKeyFromLuksHeader $outer_dvm '' red | qvm-run --pass-io "$outer_dvm" 'cat > key'
Member

marmarek commented Jul 18, 2016

If you're doing it from dom0 anyway, you can split the operation into steps:

qvm-run --pass-io "$outer_dvm" 'cat header' | qfile-daemon-dvm getKeyFromLuksHeader $outer_dvm '' red | qvm-run --pass-io "$outer_dvm" 'cat > key'
@rustybird

This comment has been minimized.

Show comment
Hide comment
@rustybird

rustybird Jul 18, 2016

Thanks, that's probably the sanest way.

Thanks, that's probably the sanest way.

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jul 13, 2017

Member

Done (for Qubes 4.0)

Member

marmarek commented Jul 13, 2017

Done (for Qubes 4.0)

@marmarek marmarek closed this Jul 13, 2017

@rustybird rustybird referenced this issue in rustybird/qubes-split-dm-crypt Jul 30, 2017

Closed

Use TRESOR in-VM to protect against attacks on vRAM #2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment