-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
Unicode EM DASH and "░░▒▓█" symbols corrupted when copying #2845
Comments
I'm seeing this issue too and it seems that the data goes correctly to dom0, and the problem lies in pasting. In particular, as strange as it looks, it seems that the Xutf8TextListToTextProperty function in Xlib is just broken. Here's a test program:
$ ./a.out abcdefghij 0 10 10 246 8 10 $ ./a.out abcdefghij$'\xe2\x80\x94' 0 13 10 246 8 10 So it just silently drops some UTF-8 characters for no reason, despite the fact that it should be doing no conversion at all! This is with the Xlib shipped in Ubuntu 17.04 It seems that GTK does not use Xlib to convert text, and instead does nothing for UTF-8 -> UTF-8, while for STRING it does not convert to Latin-1, but rather treats STRING as Compound Text and thus removes C0 and C1 characters. The simplest thing for Qubes is probably to only support the UTF8_STRING target and just copy the data verbatim there. |
|
On R4.0 this is not copied properly either for me. @andrewdavidwong can you please update the issue to reflect this? |
Updated. By the way, I'm not familiar with these symbols, and searching didn't turn up any useful results. What are they? |
Looking up using
Useful for e.g. gradients from one color to another. |
Thank you. I believe these symbols are used to make GUI in console, e.g. in interface (and copying progress bar in particular) in |
Ah, interesting. Thanks for the explanation. |
The bug is indeed in Since the clipboard often contains sensitive data such as passwords, a constant-time check is strongly preferred. Anyone an expert in bitsliced algorithms? |
Is it really observable by potential attacker? I think it can be observed only by:
|
As for UTF-8 validation, we already have such code in gui-daemon: https://github.com/QubesOS/qubes-gui-daemon/blob/master/gui-daemon/xside.c#L1994-L2077 |
The latency isn’t observable, but the cache impact is. |
I will move this into a library routine so the agent can use it as well. I checked to see if dom0 validates UTF-8 already; it does not. However, I did find a different bug: strings containing NUL characters are truncated. The X |
libX11 claims to have Xutf8TextListToTextProperty for handling UTF-8 text, but it is just broken and winds up mangling the text instead. Instead, use XStringListToTextProperty and validate UTF-8 validity ourselves. (cherry picked from commit febd112) Fix indentation and segfault GCC doesn’t warn about `char **ptr = { NULL };`, even though it is the same bug as `char *ptr = ""` 😞 (cherry picked from commit b873646) Fixes QubesOS/qubes-issues#2845
Automated announcement from builder-github The package
|
Automated announcement from builder-github The package
|
Automated announcement from builder-github The component
|
Automated announcement from builder-github The package
|
Automated announcement from builder-github The package
|
Automated announcement from builder-github The component
|
Qubes OS version:
R3.2
Affected TemplateVMs:
fedora-23, debian-8
Expected behavior:
I copied and pasted a text that includes "—" symbol (hex "e2 80 94") using Ctrl+Shift+C and Ctrl+Shift+V. I expected my text to be pasted as-is, but the dash symbol corrupted (see below).
Actual behavior:
The symbol was pasted as "�" (hex "c3 a2 c2 80 c2 94").
Steps to reproduce the behavior:
In one VM:
select the symbol with mouse, click right mouse button, choose "Copy". Then press Ctrl+Shift+C.
In another VM: press Ctrl+Shift+V. Open a terminal or a text editor (gedit), click right mouse button, choose "Paste". The symbol pasted corrupted:
General notes:
Info about the symbol:
See also http://www.fileformat.info/info/unicode/char/2014/index.htm
The text was updated successfully, but these errors were encountered: