softfido icon indicating copy to clipboard operation
softfido copied to clipboard

Server crashes with "failed to fill whole buffer" when attaching kernel module

Open estan opened this issue 7 months ago • 10 comments

@ellerh Hey, I tried following the instructions in the README, but when attaching the kernel module to the server with usbip attach -r 127.0.0.1 -d 1-1 the server crashes with:

estan@edison:~/orexplore/softfido$ target/debug/softfido --token-label softfido
softfido::crypto: Found secret key.
softfido::crypto: Found token counter. (0)
Softfido server running.
New connection Ok(TcpStream { addr: 127.0.0.1:3240, peer: 127.0.0.1:38300, fd: 5 })

OP_REQ_IMPORT
busid: 1-1
import request busid 1-1 complete
thread 'main' panicked at src/main.rs:47:52:
called `Result::unwrap()` on an `Err` value: Error { kind: UnexpectedEof, message: "failed to fill whole buffer" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
estan@edison:~/orexplore/softfido$

Running with RUST_BACKTRACE=full, the backtrace is:

estan@edison:~/orexplore/softfido$ RUST_BACKTRACE=full target/debug/softfido --token-label softfido
softfido::crypto: Found secret key.
softfido::crypto: Found token counter. (2)
Softfido server running.
New connection Ok(TcpStream { addr: 127.0.0.1:3240, peer: 127.0.0.1:44466, fd: 5 })

OP_REQ_IMPORT
busid: 1-1
import request busid 1-1 complete
thread 'main' panicked at src/main.rs:47:52:
called `Result::unwrap()` on an `Err` value: Error { kind: UnexpectedEof, message: "failed to fill whole buffer" }
stack backtrace:
   0:     0x5566754d6f7c - std::backtrace_rs::backtrace::libunwind::trace::hccf3cfe599d26745
                               at /rustc/f967532a47eb728ada44473a5c4c2eca1a45fe30/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x5566754d6f7c - std::backtrace_rs::backtrace::trace_unsynchronized::hd3d8077f873485f2
                               at /rustc/f967532a47eb728ada44473a5c4c2eca1a45fe30/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x5566754d6f7c - std::sys_common::backtrace::_print_fmt::h182daaf98b25bd14
                               at /rustc/f967532a47eb728ada44473a5c4c2eca1a45fe30/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x5566754d6f7c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h4b6a846227d97bb7
                               at /rustc/f967532a47eb728ada44473a5c4c2eca1a45fe30/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x556675502140 - core::fmt::rt::Argument::fmt::h9766ef94e9786c29
                               at /rustc/f967532a47eb728ada44473a5c4c2eca1a45fe30/library/core/src/fmt/rt.rs:142:9
   5:     0x556675502140 - core::fmt::write::hb46e4cb217dc2581
                               at /rustc/f967532a47eb728ada44473a5c4c2eca1a45fe30/library/core/src/fmt/mod.rs:1120:17
   6:     0x5566754d436f - std::io::Write::write_fmt::h0e754bba34fa795b
                               at /rustc/f967532a47eb728ada44473a5c4c2eca1a45fe30/library/std/src/io/mod.rs:1810:15
   7:     0x5566754d6d64 - std::sys_common::backtrace::_print::h73ad48f083423281
                               at /rustc/f967532a47eb728ada44473a5c4c2eca1a45fe30/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x5566754d6d64 - std::sys_common::backtrace::print::h394692fca6f2f34a
                               at /rustc/f967532a47eb728ada44473a5c4c2eca1a45fe30/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x5566754d8367 - std::panicking::default_hook::{{closure}}::haa3c8a2ef3bd08de
  10:     0x5566754d80cf - std::panicking::default_hook::h37c8166f13b8b27c
                               at /rustc/f967532a47eb728ada44473a5c4c2eca1a45fe30/library/std/src/panicking.rs:292:9
  11:     0x5566754d87e8 - std::panicking::rust_panic_with_hook::h71d389cf21201b59
                               at /rustc/f967532a47eb728ada44473a5c4c2eca1a45fe30/library/std/src/panicking.rs:779:13
  12:     0x5566754d86ce - std::panicking::begin_panic_handler::{{closure}}::h655372ff562611b4
                               at /rustc/f967532a47eb728ada44473a5c4c2eca1a45fe30/library/std/src/panicking.rs:657:13
  13:     0x5566754d7446 - std::sys_common::backtrace::__rust_end_short_backtrace::h0e91de37c406f2fe
                               at /rustc/f967532a47eb728ada44473a5c4c2eca1a45fe30/library/std/src/sys_common/backtrace.rs:171:18
  14:     0x5566754d8432 - rust_begin_unwind
                               at /rustc/f967532a47eb728ada44473a5c4c2eca1a45fe30/library/std/src/panicking.rs:645:5
  15:     0x55667530a5f5 - core::panicking::panic_fmt::h0290566811e2a53e
                               at /rustc/f967532a47eb728ada44473a5c4c2eca1a45fe30/library/core/src/panicking.rs:72:14
  16:     0x55667530abe3 - core::result::unwrap_failed::he976b56b2f3075df
                               at /rustc/f967532a47eb728ada44473a5c4c2eca1a45fe30/library/core/src/result.rs:1649:5
  17:     0x556675365eac - core::result::Result<T,E>::unwrap::h1d783792ff1d34a8
                               at /rustc/f967532a47eb728ada44473a5c4c2eca1a45fe30/library/core/src/result.rs:1073:23
  18:     0x55667531ed79 - softfido::main::{{closure}}::h6448e8ba87f734f8
                               at /home/estan/orexplore/softfido/src/main.rs:47:13
  19:     0x556675325e07 - softfido::crypto::globals::with_ctx::ha15e4b258d00e171
                               at /home/estan/orexplore/softfido/src/crypto.rs:97:24
  20:     0x55667530db30 - softfido::main::h5fd3fa871463c8b6
                               at /home/estan/orexplore/softfido/src/main.rs:31:5
  21:     0x55667545f91b - core::ops::function::FnOnce::call_once::h1dfb12ea5c1d17c1
                               at /rustc/f967532a47eb728ada44473a5c4c2eca1a45fe30/library/core/src/ops/function.rs:250:5
  22:     0x55667533690e - std::sys_common::backtrace::__rust_begin_short_backtrace::hdcdf338f5378fdcd
                               at /rustc/f967532a47eb728ada44473a5c4c2eca1a45fe30/library/std/src/sys_common/backtrace.rs:155:18
  23:     0x556675342151 - std::rt::lang_start::{{closure}}::h6b186564db090002
                               at /rustc/f967532a47eb728ada44473a5c4c2eca1a45fe30/library/std/src/rt.rs:167:18
  24:     0x5566754d0137 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::hd620b3b8c9654887
                               at /rustc/f967532a47eb728ada44473a5c4c2eca1a45fe30/library/core/src/ops/function.rs:284:13
  25:     0x5566754d0137 - std::panicking::try::do_call::h319f4a718cea0bc5
                               at /rustc/f967532a47eb728ada44473a5c4c2eca1a45fe30/library/std/src/panicking.rs:552:40
  26:     0x5566754d0137 - std::panicking::try::h2c1b070ca4a247bb
                               at /rustc/f967532a47eb728ada44473a5c4c2eca1a45fe30/library/std/src/panicking.rs:516:19
  27:     0x5566754d0137 - std::panic::catch_unwind::h6a5d720b96964c71
                               at /rustc/f967532a47eb728ada44473a5c4c2eca1a45fe30/library/std/src/panic.rs:142:14
  28:     0x5566754d0137 - std::rt::lang_start_internal::{{closure}}::hbad653246307ad43
                               at /rustc/f967532a47eb728ada44473a5c4c2eca1a45fe30/library/std/src/rt.rs:148:48
  29:     0x5566754d0137 - std::panicking::try::do_call::h83f4de88adc0ca5e
                               at /rustc/f967532a47eb728ada44473a5c4c2eca1a45fe30/library/std/src/panicking.rs:552:40
  30:     0x5566754d0137 - std::panicking::try::hd3793aaafcd95dda
                               at /rustc/f967532a47eb728ada44473a5c4c2eca1a45fe30/library/std/src/panicking.rs:516:19
  31:     0x5566754d0137 - std::panic::catch_unwind::h4b1c2658c4d0db72
                               at /rustc/f967532a47eb728ada44473a5c4c2eca1a45fe30/library/std/src/panic.rs:142:14
  32:     0x5566754d0137 - std::rt::lang_start_internal::hcda365c9de08b755
                               at /rustc/f967532a47eb728ada44473a5c4c2eca1a45fe30/library/std/src/rt.rs:148:20
  33:     0x55667534212a - std::rt::lang_start::h1d4091c4e86fda69
                               at /rustc/f967532a47eb728ada44473a5c4c2eca1a45fe30/library/std/src/rt.rs:166:17
  34:     0x55667530f2be - main
  35:     0x7f7872429d90 - __libc_start_call_main
                               at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
  36:     0x7f7872429e40 - __libc_start_main_impl
                               at ./csu/../csu/libc-start.c:392:3
  37:     0x55667530aee5 - _start
  38:                0x0 - <unknown>
estan@edison:~/orexplore/softfido$

estan avatar Dec 09 '23 17:12 estan