We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
XGETBV
SIGILL
Create a VM with AVX/AVX2 support while XGETBV is disabled
AVX
AVX2
$ cpuid -1 | grep -E 'AVX2?:|OS-enabled XSAVE/XSTOR' OS-enabled XSAVE/XSTOR = false AVX: advanced vector extensions = true AVX2: advanced vector extensions 2 = true
Download latest insider CLI and run ./code-insiders --verbose --log trace tunnel
./code-insiders --verbose --log trace tunnel
Try connecting to the server with Remote - Tunnels extension or https://insiders.vscode.dev
Remote - Tunnels
Remote tunnel service exit with Illegal Instruction (SIGILL)
Illegal Instruction
$ target/debug/code --verbose --log trace tunnel * * Visual Studio Code Server * * By using the software, you agree to * the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and * the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement). * [2023-07-08 13:44:47] debug Starting tunnel with `code-insiders repos/vscode/cli/target/debug/code --verbose --log trace tunnel` [2023-07-08 13:44:47] debug starting as new singleton [2023-07-08 13:44:47] debug Using file keychain storage due to: error reading keyring: Platform secure storage failure: zbus error: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.secrets was not provided by any .service files [2023-07-08 13:44:47] trace No token in keyring, getting a new one [2023-07-08 13:44:47] debug [reqwest::connect] starting new connection: https://github.com/ To grant access to the server, please log into https://github.com/login/device and use code 72ED-1B12 [2023-07-08 13:44:53] trace refresh poll failed, retrying: Error getting authorization: authorization_pending The authorization request is still pending. [2023-07-08 13:44:59] trace refresh poll failed, retrying: Error getting authorization: authorization_pending The authorization request is still pending. [2023-07-08 13:45:04] trace refresh poll failed, retrying: Error getting authorization: authorization_pending The authorization request is still pending. [2023-07-08 13:45:10] debug [reqwest::connect] starting new connection: https://asse.rel.tunnels.api.visualstudio.com/ [2023-07-08 13:45:13] trace Found token in keyring [2023-07-08 13:45:13] debug [reqwest::connect] starting new connection: https://api.github.com/ [2023-07-08 13:45:15] debug Starting tunnel to server... [2023-07-08 13:45:15] trace Found token in keyring [2023-07-08 13:45:17] debug [tungstenite::handshake::client] Client handshake done. [2023-07-08 13:45:17] debug [russh::ssh_read] read_ssh_id: reading [2023-07-08 13:45:17] debug [russh::ssh_read] read 39 [2023-07-08 13:45:17] debug [russh::ssh_read] Ok("SSH-2.0-Microsoft.DevTunnels.Ssh_3.11\r\n") [2023-07-08 13:45:17] debug [russh::client] writing 352 bytes [2023-07-08 13:45:17] debug [russh::ssh_read] id 39 39 [2023-07-08 13:45:17] debug [russh::client::kex] extending [] [2023-07-08 13:45:17] debug [russh::client::kex] algo = Names { kex: Name("none"), key: Name("none"), cipher: Name("none"), client_mac: Name("none"), server_mac: Name("none"), server_compression: None, client_compression: None, ignore_guessed: false } [2023-07-08 13:45:17] debug [russh::client::kex] write = [] [2023-07-08 13:45:17] debug [russh::client::kex] i0 = 342 [2023-07-08 13:45:17] debug [russh::client::kex] moving to kexdhdone, exchange = Exchange { client_id: CryptoVec { p: 0x7ff40c0ed2d0, size: 20, capacity: 32 }, server_id: CryptoVec { p: 0x7ff40c061a20, size: 37, capacity: 64 }, client_kex_init: CryptoVec { p: 0x7ff40c0efeb0, size: 342, capacity: 512 }, server_kex_init: CryptoVec { p: 0x7ff40c0e5430, size: 94, capacity: 128 }, client_ephemeral: CryptoVec { p: 0x1, size: 0, capacity: 0 }, server_ephemeral: CryptoVec { p: 0x1, size: 0, capacity: 0 } } [2023-07-08 13:45:17] debug [tunnels::connections::relay_tunnel_host] established host relay primary session [2023-07-08 13:45:17] debug Connected to tunnel endpoint: TunnelRelayTunnelEndpoint { base: TunnelEndpoint { connection_mode: TunnelRelay, host_id: "9784ed3c-0333-4b88-a6dd-7b14c405a32b", host_public_keys: [], port_uri_format: Some("https://vb2bdgrj-{port}.asse.devtunnels.ms/"), tunnel_uri: Some("https://vb2bdgrj.asse.devtunnels.ms/"), port_ssh_command_format: Some("ssh vb2bdgrj-{port}@ssh.asse.devtunnels.ms"), tunnel_ssh_command: Some("ssh [email protected]"), ssh_gateway_public_key: None }, host_relay_uri: Some("wss://asse-data.rel.tunnels.api.visualstudio.com/api/v1/Host/Connect/vb2bdgrj"), client_relay_uri: Some("wss://asse-data.rel.tunnels.api.visualstudio.com/api/v1/Client/Connect/vb2bdgrj") } [2023-07-08 13:45:17] debug Visual Studio Code Server is listening for incoming connections Open this link in your browser https://insiders.vscode.dev/tunnel/cce-cangjie-controller [2023-07-08 13:45:17] trace Found token in keyring [2023-07-08 13:45:18] debug [russh::client::encrypted] confirming channel: OpenChannelMessage { typ: Unknown { typ: [99, 108, 105, 101, 110, 116, 45, 115, 115, 104, 45, 115, 101, 115, 115, 105, 111, 110, 45, 115, 116, 114, 101, 97, 109] }, recipient_channel: 0, recipient_window_size: 5242880, recipient_maximum_packet_size: 32768 } [2023-07-08 13:45:18] info [tunnels::connections::relay_tunnel_host] Opened new client on channel 2 [2023-07-08 13:45:18] debug [tunnels::connections::relay_tunnel_host] starting to serve host relay client session [2023-07-08 13:45:18] info [russh::server] wrote id [2023-07-08 13:45:18] debug [russh::ssh_read] read_ssh_id: reading [2023-07-08 13:45:18] debug [russh::client::encrypted] channel_close [2023-07-08 13:45:18] error [tunnels::connections::relay_tunnel_host] error handshaking session: EOF [2023-07-08 13:45:40] debug [russh::client::encrypted] confirming channel: OpenChannelMessage { typ: Unknown { typ: [99, 108, 105, 101, 110, 116, 45, 115, 115, 104, 45, 115, 101, 115, 115, 105, 111, 110, 45, 115, 116, 114, 101, 97, 109] }, recipient_channel: 1, recipient_window_size: 5242880, recipient_maximum_packet_size: 32768 } [2023-07-08 13:45:40] info [tunnels::connections::relay_tunnel_host] Opened new client on channel 3 [2023-07-08 13:45:40] debug [tunnels::connections::relay_tunnel_host] starting to serve host relay client session [2023-07-08 13:45:40] info [russh::server] wrote id [2023-07-08 13:45:40] debug [russh::ssh_read] read_ssh_id: reading [2023-07-08 13:45:40] debug [russh::ssh_read] read 32 [2023-07-08 13:45:40] debug [russh::ssh_read] Ok("SSH-2.0-dev-tunnels-ssh_3.10.6\r\n") [2023-07-08 13:45:40] debug [russh::server::kex] server kex init: [20, 185, 181, 105, 92, 24, 49, 104, 10, 44, 183, 222, 94, 56, 181, 84, 47, 0, 0, 0, 95, 100, 105, 102, 102, 105, 101, 45, 104, 101, 108, 108, 109, 97, 110, 45, 103, 114, 111, 117, 112, 49, 52, 45, 115, 104, 97, 50, 53, 54, 44, 100, 105, 102, 102, 105, 101, 45, 104, 101, 108, 108, 109, 97, 110, 45, 103, 114, 111, 117, 112, 49, 52, 45, 115, 104, 97, 49, 44, 100, 105, 102, 102, 105, 101, 45, 104, 101, 108, 108, 109, 97, 110, 45, 103, 114, 111, 117, 112, 49, 45, 115, 104, 97, 49, 44, 101, 120, 116, 45, 105, 110, 102, 111, 45, 115, 0, 0, 0, 25, 114, 115, 97, 45, 115, 104, 97, 50, 45, 50, 53, 54, 44, 114, 115, 97, 45, 115, 104, 97, 50, 45, 53, 49, 50, 0, 0, 0, 32, 97, 101, 115, 50, 53, 54, 45, 99, 116, 114, 44, 97, 101, 115, 49, 57, 50, 45, 99, 116, 114, 44, 97, 101, 115, 49, 50, 56, 45, 99, 116, 114, 0, 0, 0, 32, 97, 101, 115, 50, 53, 54, 45, 99, 116, 114, 44, 97, 101, 115, 49, 57, 50, 45, 99, 116, 114, 44, 97, 101, 115, 49, 50, 56, 45, 99, 116, 114, 0, 0, 0, 128, 104, 109, 97, 99, 45, 115, 104, 97, 50, 45, 53, 49, 50, 45, 101, 116, 109, 64, 111, 112, 101, 110, 115, 115, 104, 46, 99, 111, 109, 44, 104, 109, 97, 99, 45, 115, 104, 97, 50, 45, 50, 53, 54, 45, 101, 116, 109, 64, 111, 112, 101, 110, 115, 115, 104, 46, 99, 111, 109, 44, 104, 109, 97, 99, 45, 115, 104, 97, 50, 45, 53, 49, 50, 44, 104, 109, 97, 99, 45, 115, 104, 97, 50, 45, 50, 53, 54, 44, 104, 109, 97, 99, 45, 115, 104, 97, 49, 45, 101, 116, 109, 64, 111, 112, 101, 110, 115, 115, 104, 46, 99, 111, 109, 44, 104, 109, 97, 99, 45, 115, 104, 97, 49, 44, 110, 111, 110, 101, 0, 0, 0, 128, 104, 109, 97, 99, 45, 115, 104, 97, 50, 45, 53, 49, 50, 45, 101, 116, 109, 64, 111, 112, 101, 110, 115, 115, 104, 46, 99, 111, 109, 44, 104, 109, 97, 99, 45, 115, 104, 97, 50, 45, 50, 53, 54, 45, 101, 116, 109, 64, 111, 112, 101, 110, 115, 115, 104, 46, 99, 111, 109, 44, 104, 109, 97, 99, 45, 115, 104, 97, 50, 45, 53, 49, 50, 44, 104, 109, 97, 99, 45, 115, 104, 97, 50, 45, 50, 53, 54, 44, 104, 109, 97, 99, 45, 115, 104, 97, 49, 45, 101, 116, 109, 64, 111, 112, 101, 110, 115, 115, 104, 46, 99, 111, 109, 44, 104, 109, 97, 99, 45, 115, 104, 97, 49, 44, 110, 111, 110, 101, 0, 0, 0, 26, 122, 108, 105, 98, 44, 122, 108, 105, 98, 64, 111, 112, 101, 110, 115, 115, 104, 46, 99, 111, 109, 44, 110, 111, 110, 101, 0, 0, 0, 26, 122, 108, 105, 98, 44, 122, 108, 105, 98, 64, 111, 112, 101, 110, 115, 115, 104, 46, 99, 111, 109, 44, 110, 111, 110, 101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] [2023-07-08 13:45:40] info [russh::server] read other id [2023-07-08 13:45:40] info [russh::server] session is running [2023-07-08 13:45:40] debug [russh::ssh_read] id 32 32 [2023-07-08 13:45:40] debug [russh::client::encrypted] channel_window_adjust [2023-07-08 13:45:40] debug [russh::client::encrypted] amount: 4194326 [2023-07-08 13:45:41] debug [russh::server::kex] server kexdhdone.exchange = Exchange { client_id: CryptoVec { p: 0x7ff40c0f5b40, size: 30, capacity: 32 }, server_id: CryptoVec { p: 0x7ff40c0263b0, size: 20, capacity: 32 }, client_kex_init: CryptoVec { p: 0x7ff40c0ff2c0, size: 483, capacity: 512 }, server_kex_init: CryptoVec { p: 0x7ff40c0f7050, size: 554, capacity: 1024 }, client_ephemeral: CryptoVec { p: 0x7ff40c0ff730, size: 257, capacity: 512 }, server_ephemeral: CryptoVec { p: 0x7ff40c0ffc80, size: 257, capacity: 512 } } [2023-07-08 13:45:41] debug [russh::server::kex] exchange hash: CryptoVec { p: 0x7ff40c097210, size: 32, capacity: 32 } [2023-07-08 13:45:41] debug [russh::server::kex] signing with key 0 [2023-07-08 13:45:41] debug [russh::server::kex] hash: CryptoVec { p: 0x7ff40c097210, size: 32, capacity: 32 } [2023-07-08 13:45:41] debug [russh::server::kex] key: RSA { (hidden) } Illegal instruction (core dumped)
$ gdb repos/vscode/cli/target/debug/code core.tokio-runtime-w.849822 GNU gdb (Debian 13.1-3) 13.1 Copyright (C) 2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <https://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from repos/vscode/cli/target/debug/code... [New LWP 849826] [New LWP 849823] [New LWP 849824] [New LWP 849825] [New LWP 849822] [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Core was generated by `repos/vscode/cli/target/debug/code --verbose --log trace tunnel'. Program terminated with signal SIGILL, Illegal instruction. #0 0x000055ad3eda4673 in sha2::sha512::x86::sha512_compress_x86_64_avx (state=0x7ff423c0c490, block=0x7ff423c0c3f8 b"HP\217|D\211\302\362l\244\020\266\260\340I\313U\336\231?N\r\355\020\234\035\322\204\271\254\n\21549\211\004/[\223\351\334B\020\377\316\215\273J[\325\310\343\vSi\3341\366\031,3\216\r\227", '6' <repeats 64 times>) at src/sha512/x86.rs:59 59 let mut ms = [_mm_setzero_si128(); 8]; [Current thread is 1 (Thread 0x7ff423c1b6c0 (LWP 849826))] warning: Missing auto-load script at offset 0 in section .debug_gdb_scripts of file /home/z00637057/repos/vscode/cli/target/debug/code. Use `info auto-load python-scripts [REGEXP]' to list them. (gdb) (gdb) (gdb) bt 10 #0 0x000055ad3eda4673 in sha2::sha512::x86::sha512_compress_x86_64_avx (state=0x7ff423c0c490, block=0x7ff423c0c3f8 b"HP\217|D\211\302\362l\244\020\266\260\340I\313U\336\231?N\r\355\020\234\035\322\204\271\254\n\21549\211\004/[\223\351\334B\020\377\316\215\273J[\325\310\343\vSi\3341\366\031,3\216\r\227", '6' <repeats 64 times>) at src/sha512/x86.rs:59 #1 sha2::sha512::x86::sha512_compress_x86_64_avx2 (state=0x7ff423c0c490, blocks=...) at src/sha512/x86.rs:33 #2 0x000055ad3eda4555 in sha2::sha512::x86::compress (state=0x7ff423c0c490, blocks=...) at src/sha512/x86.rs:21 #3 0x000055ad3ed9d3dc in sha2::sha512::compress512 (state=0x7ff423c0c490, blocks=...) at src/sha512.rs:34 #4 0x000055ad3ec9ec8c in sha2::core_api::{impl#11}::update_blocks (self=0x7ff423c0c490, blocks=...) at /home/z00637057/.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/sha2-0.10.6/src/core_api.rs:109 #5 0x000055ad3ecc3e97 in digest::core_api::ct_variable::{impl#3}::update_blocks<sha2::core_api::Sha512VarCore, typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UTerm, typenum::bit::B1>, typenum::bit::B0>, typenum::bit::B0>, typenum::bit::B0>, typenum::bit::B0>, typenum::bit::B0>, typenum::bit::B0>, sha2::OidSha512> (self=0x7ff423c0c490, blocks=...) at /home/z00637057/.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/digest-0.10.5/src/core_api/ct_variable.rs:79 #6 0x000055ad3ecf030c in hmac::optim::{impl#6}::new_from_slice<digest::core_api::wrapper::CoreWrapper<digest::core_api::ct_variable::CtVariableCoreWrapper<sha2::core_api::Sha512VarCore, typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UTerm, typenum::bit::B1>, typenum::bit::B0>, typenum::bit::B0>, typenum::bit::B0>, typenum::bit::B0>, typenum::bit::B0>, typenum::bit::B0>, sha2::OidSha512>>> (key=...) at /home/z00637057/.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/hmac-0.12.1/src/optim.rs:158 #7 digest::core_api::wrapper::{impl#5}::new_from_slice<hmac::optim::HmacCore<digest::core_api::wrapper::CoreWrapper<digest::core_api::ct_variable::CtVariableCoreWrapper<sha2::core_api::Sha512VarCore, typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UTerm, typenum::bit::B1>, typenum::bit::B0>, typenum::bit::B0>, typenum::bit::B0>, typenum::bit::B0>, typenum::bit::B0>, typenum::bit::B0>, sha2::OidSha512>>>> (key=...) at /home/z00637057/.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/digest-0.10.5/src/core_api/wrapper.rs:109 #8 0x000055ad3ecec855 in digest::mac::{impl#0}::new_from_slice<digest::core_api::wrapper::CoreWrapper<hmac::optim::HmacCore<digest::core_api::wrapper::CoreWrapper<digest::core_api::ct_variable::CtVariableCoreWrapper<sha2::core_api::Sha512VarCore, typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UTerm, typenum::bit::B1>, typenum::bit::B0>, typenum::bit::B0>, typenum::bit::B0>, typenum::bit::B0>, typenum::bit::B0>, typenum::bit::B0>, sha2::OidSha512>>>>> ( key=...) at /home/z00637057/.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/digest-0.10.5/src/mac.rs:96 #9 russh::mac::crypto::{impl#1}::compute<digest::core_api::wrapper::CoreWrapper<hmac::optim::HmacCore<digest::core_api::wrapper::CoreWrapper<digest::core_api::ct_variable::CtVariableCoreWrapper<sha2::core_api::Sha512VarCore, typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UTerm, typenum::bit::B1>, typenum::bit::B0>, typenum::bit::B0>, typenum::bit::B0>, typenum::bit::B0>, typenum::bit::B0>, typenum::bit::B0>, sha2::OidSha512>>>>, typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UTerm, typenum::bit::B1>, typenum::bit::B0>, typenum::bit::B0>, typenum::bit::B0>, typenum::bit::B0>, typenum::bit::B0>, typenum::bit::B0>> ( self=0x7ff40c06da00, sequence_number=3, payload=..., output=...) at src/mac/crypto.rs:47 (More stack frames follow...) (gdb) l 54 } 55 } 56 57 #[inline(always)] 58 unsafe fn sha512_compress_x86_64_avx(state: &mut [u64; 8], block: &[u8; 128]) { 59 let mut ms = [_mm_setzero_si128(); 8]; 60 let mut x = [_mm_setzero_si128(); 8]; 61 62 // Reduced to single iteration 63 let mut current_state = *state; (gdb) f 1 #1 sha2::sha512::x86::sha512_compress_x86_64_avx2 (state=0x7ff423c0c490, blocks=...) at src/sha512/x86.rs:33 33 sha512_compress_x86_64_avx(state, &blocks[0]); (gdb) l 28 #[target_feature(enable = "avx2")] 29 unsafe fn sha512_compress_x86_64_avx2(state: &mut [u64; 8], blocks: &[[u8; 128]]) { 30 let mut start_block = 0; 31 32 if blocks.len() & 0b1 != 0 { 33 sha512_compress_x86_64_avx(state, &blocks[0]); 34 start_block += 1; 35 } 36 37 let mut ms: MsgSchedule = [_mm_setzero_si128(); 8]; (gdb) f 2 #2 0x000055ad3eda4555 in sha2::sha512::x86::compress (state=0x7ff423c0c490, blocks=...) at src/sha512/x86.rs:21 21 sha512_compress_x86_64_avx2(state, blocks); (gdb) l 16 pub fn compress(state: &mut [u64; 8], blocks: &[[u8; 128]]) { 17 // TODO: Replace with https://github.com/rust-lang/rfcs/pull/2725 18 // after stabilization 19 if avx2_cpuid::get() { 20 unsafe { 21 sha512_compress_x86_64_avx2(state, blocks); 22 } 23 } else { 24 super::soft::compress(state, blocks); 25
RustCrypto/utils#793
The text was updated successfully, but these errors were encountered:
fix: update cpufeatures from v0.2.5 to v0.2.8 (microsoft#187343)
f808d3b
Fix: Remote tunnel service running on VM with XGETBV disabled exit wi…
b062048
…th SIGILL when being connected (#187345) fix: update cpufeatures from v0.2.5 to v0.2.8 (#187343)
connor4312
Successfully merging a pull request may close this issue.
Does this issue occur when all extensions are disabled?: Yes
Steps to Reproduce:
Create a VM with
AVX
/AVX2
support whileXGETBV
is disabledDownload latest insider CLI and run
./code-insiders --verbose --log trace tunnel
Try connecting to the server with
Remote - Tunnels
extension or https://insiders.vscode.devRemote tunnel service exit with
Illegal Instruction
(SIGILL
)console output
stack trace
Related Issue
RustCrypto/utils#793
The text was updated successfully, but these errors were encountered: