netheril96 / securefs

Filesystem in userspace (FUSE) with transparent authenticated encryption
Other
734 stars 62 forks source link

Securefs broken on linux 5.4 #87

Closed glitsj16 closed 4 years ago

glitsj16 commented 4 years ago

After building securefs from git master, this is what I see on Arch Linux:

$ securefs mount ${HOME}/.stash_sfs ${HOME}/stash_sfs
Password:
Filesystem mounted successfully
fuse: reading device: Invalid argument
Filesystem unmounted successfully

The same command works fine on Ubuntu 16.04 LTS. See OS info and build log below. If there's anything else I can provide, feel free to ask.

OS: Arch Linux $ pacman -Q cmake fuse-common fuse2 fuse3 gcc-libs cmake 3.16.0-1 fuse-common 3.8.0-1 fuse2 2.9.9-3 fuse3 3.8.0-1 gcc-libs 9.2.0-4

-- The C compiler identification is GNU 9.2.0
-- The CXX compiler identification is GNU 9.2.0
-- Check for working C compiler: /usr/lib/ccache/bin/cc
-- Check for working C compiler: /usr/lib/ccache/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/lib/ccache/bin/c++
-- Check for working CXX compiler: /usr/lib/ccache/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- *************************************************************************
The Crypto++ library does not officially support CMake. CMake support is a
community effort, and the library works with the folks using CMake to help
improve it. If you find an issue then please fix it or report it at
https://github.com/noloader/cryptopp-cmake.
-- *************************************************************************
-- CMake version 3.16.0
-- Performing Test CRYPTOPP_IA32_SSE2
-- Performing Test CRYPTOPP_IA32_SSE2 - Success
-- Performing Test CRYPTOPP_IA32_SSSE3
-- Performing Test CRYPTOPP_IA32_SSSE3 - Success
-- Performing Test CRYPTOPP_IA32_SSE41
-- Performing Test CRYPTOPP_IA32_SSE41 - Success
-- Performing Test CRYPTOPP_IA32_SSE42
-- Performing Test CRYPTOPP_IA32_SSE42 - Success
-- Performing Test CRYPTOPP_IA32_CLMUL
-- Performing Test CRYPTOPP_IA32_CLMUL - Success
-- Performing Test CRYPTOPP_IA32_AES
-- Performing Test CRYPTOPP_IA32_AES - Success
-- Performing Test CRYPTOPP_IA32_AVX
-- Performing Test CRYPTOPP_IA32_AVX - Success
-- Performing Test CRYPTOPP_IA32_AVX2
-- Performing Test CRYPTOPP_IA32_AVX2 - Success
-- Performing Test CRYPTOPP_IA32_SHA
-- Performing Test CRYPTOPP_IA32_SHA - Success
-- Performing Test CRYPTOPP_MIXED_ASM
-- Performing Test CRYPTOPP_MIXED_ASM - Success
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Performing Test HAS_THREAD_LOCAL
-- Performing Test HAS_THREAD_LOCAL - Success
-- Performing Test HAS_CLOCK_GETTIME
-- Performing Test HAS_CLOCK_GETTIME - Success
-- Performing Test HAS_FUTIMENS
-- Performing Test HAS_FUTIMENS - Success
-- Performing Test HAS_UTIMENSAT
-- Performing Test HAS_UTIMENSAT - Success
-- Configuring done
-- Build files have been written to: /home/glitsj16/securefs-git/src/securefs/build
Scanning dependencies of target cryptopp-object
[  0%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/cpu.cpp.o
[  0%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/cryptlib.cpp.o
[  1%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/integer.cpp.o
[  1%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/3way.cpp.o
[  2%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/adler32.cpp.o
[  2%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/algebra.cpp.o
[  3%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/algparam.cpp.o
[  3%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/arc4.cpp.o
[  4%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/aria.cpp.o
[  4%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/aria_simd.cpp.o
[  5%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/ariatab.cpp.o
[  5%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/asn.cpp.o
[  6%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/authenc.cpp.o
[  6%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/base32.cpp.o
[  7%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/base64.cpp.o
[  7%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/basecode.cpp.o
[  8%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/bfinit.cpp.o
[  8%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/blake2.cpp.o
[  9%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/blake2b_simd.cpp.o
[  9%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/blake2s_simd.cpp.o
[ 10%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/blowfish.cpp.o
[ 10%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/blumshub.cpp.o
[ 11%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/camellia.cpp.o
[ 11%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/cast.cpp.o
[ 12%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/casts.cpp.o
[ 12%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/cbcmac.cpp.o
[ 13%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/ccm.cpp.o
[ 13%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/chacha.cpp.o
[ 14%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/chacha_avx.cpp.o
[ 14%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/chacha_simd.cpp.o
[ 15%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/chachapoly.cpp.o
[ 15%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/cham.cpp.o
[ 16%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/cham_simd.cpp.o
[ 16%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/channels.cpp.o
[ 16%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/cmac.cpp.o
[ 17%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/crc.cpp.o
[ 17%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/crc_simd.cpp.o
[ 18%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/darn.cpp.o
[ 18%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/default.cpp.o
[ 19%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/des.cpp.o
[ 19%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/dessp.cpp.o
[ 20%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/dh.cpp.o
[ 20%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/dh2.cpp.o
[ 21%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/donna_32.cpp.o
[ 22%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/donna_64.cpp.o
[ 22%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/donna_sse.cpp.o
[ 23%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/dsa.cpp.o
[ 23%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/eax.cpp.o
[ 24%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/ec2n.cpp.o
[ 24%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/eccrypto.cpp.o
[ 25%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/ecp.cpp.o
/home/glitsj16/securefs-git/src/securefs/external/cryptopp/ecp.cpp: In copy constructor ‘CryptoPP::ECP::ECP(const CryptoPP::ECP&, bool)’:
/home/glitsj16/securefs-git/src/securefs/external/cryptopp/ecp.cpp:55:16: warning: implicitly-declared ‘CryptoPP::ECP& CryptoPP::ECP::operator=(const CryptoPP::ECP&)’ is deprecated [-Wdeprecated-copy]
   55 |   operator=(ecp);
      |                ^
/home/glitsj16/securefs-git/src/securefs/external/cryptopp/ecp.cpp:46:1: note: because ‘CryptoPP::ECP’ has user-provided ‘CryptoPP::ECP::ECP(const CryptoPP::ECP&, bool)’
   46 | ECP::ECP(const ECP &ecp, bool convertToMontgomeryRepresentation)
      | ^~~
[ 25%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/elgamal.cpp.o
[ 26%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/emsa2.cpp.o
In file included from /home/glitsj16/securefs-git/src/securefs/external/cryptopp/modes.h:14,
                 from /home/glitsj16/securefs-git/src/securefs/external/cryptopp/ccm.h:11,
                 from /home/glitsj16/securefs-git/src/securefs/external/cryptopp/dll.h:18,
                 from /home/glitsj16/securefs-git/src/securefs/external/cryptopp/dll.cpp:6:
/home/glitsj16/securefs-git/src/securefs/external/cryptopp/algparam.h: In instantiation of ‘CryptoPP::GetValueHelperClass<T, BASE>& CryptoPP::GetValueHelperClass<T, BASE>::operator()(const char*, const R& (T::*)() const) [with R = CryptoPP::ECP; T = CryptoPP::DL_GroupParameters_EC<CryptoPP::ECP>; BASE = CryptoPP::DL_GroupParameters<CryptoPP::ECPPoint>]’:
/home/glitsj16/securefs-git/src/securefs/external/cryptopp/eccrypto.cpp:507:4:   required from ‘bool CryptoPP::DL_GroupParameters_EC<EC>::GetVoidValue(const char*, const std::type_info&, void*) const [with EC = CryptoPP::ECP]’
/home/glitsj16/securefs-git/src/securefs/external/cryptopp/eccrypto.h:638:29:   required from here
/home/glitsj16/securefs-git/src/securefs/external/cryptopp/algparam.h:183:37: warning: implicitly-declared ‘CryptoPP::ECP& CryptoPP::ECP::operator=(const CryptoPP::ECP&)’ is deprecated [-Wdeprecated-copy]
  183 |    *reinterpret_cast<R *>(m_pValue) = (m_pObject->*pm)();
      |    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /home/glitsj16/securefs-git/src/securefs/external/cryptopp/eccrypto.h:22,
                 from /home/glitsj16/securefs-git/src/securefs/external/cryptopp/dll.h:25,
                 from /home/glitsj16/securefs-git/src/securefs/external/cryptopp/dll.cpp:6:
/home/glitsj16/securefs-git/src/securefs/external/cryptopp/ecp.h:42:2: note: because ‘CryptoPP::ECP’ has user-provided ‘CryptoPP::ECP::ECP(const CryptoPP::ECP&, bool)’
   42 |  ECP(const ECP &ecp, bool convertToMontgomeryRepresentation = false);
      |  ^~~
[ 26%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/eprecomp.cpp.o
[ 27%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/esign.cpp.o
[ 27%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/files.cpp.o
[ 28%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/filters.cpp.o
[ 29%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/gcm.cpp.o
[ 29%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/gcm_simd.cpp.o
[ 30%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/gf256.cpp.o
[ 30%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/gf2_32.cpp.o
[ 31%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/gf2n_simd.cpp.o
[ 32%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/gfpcrypt.cpp.o
[ 32%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/gost.cpp.o
[ 33%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/gzip.cpp.o
[ 33%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/hc128.cpp.o
[ 33%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/hc256.cpp.o
[ 34%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/hex.cpp.o
[ 34%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/hight.cpp.o
[ 35%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/hmac.cpp.o
[ 35%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/hrtimer.cpp.o
[ 36%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/ida.cpp.o
[ 36%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/idea.cpp.o
[ 37%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/iterhash.cpp.o
[ 37%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/kalyna.cpp.o
[ 38%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/kalynatab.cpp.o
[ 38%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/keccak.cpp.o
[ 39%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/keccak_core.cpp.o
[ 39%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/keccak_simd.cpp.o
[ 40%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/lea.cpp.o
[ 40%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/lea_simd.cpp.o
[ 41%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/luc.cpp.o
[ 41%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/mars.cpp.o
[ 42%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/marss.cpp.o
[ 42%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/md2.cpp.o
[ 43%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/md4.cpp.o
[ 43%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/md5.cpp.o
[ 44%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/misc.cpp.o
[ 44%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/modes.cpp.o
[ 45%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/mqueue.cpp.o
[ 45%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/mqv.cpp.o
[ 46%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/nbtheory.cpp.o
[ 46%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/neon_simd.cpp.o
[ 47%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/oaep.cpp.o
[ 47%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/osrng.cpp.o
[ 48%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/padlkrng.cpp.o
[ 48%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/panama.cpp.o
[ 49%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/pkcspad.cpp.o
[ 49%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/poly1305.cpp.o
[ 50%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/polynomi.cpp.o
[ 50%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/ppc_power7.cpp.o
[ 50%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/ppc_power8.cpp.o
[ 51%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/ppc_power9.cpp.o
[ 51%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/ppc_simd.cpp.o
[ 52%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/pssr.cpp.o
[ 52%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/pubkey.cpp.o
[ 53%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/rabbit.cpp.o
[ 54%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/rabin.cpp.o
[ 54%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/randpool.cpp.o
[ 55%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/rc2.cpp.o
[ 55%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/rc5.cpp.o
[ 56%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/rc6.cpp.o
[ 57%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/rdtables.cpp.o
[ 57%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/rijndael.cpp.o
[ 58%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/ripemd.cpp.o
[ 59%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/rng.cpp.o
[ 59%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/rsa.cpp.o
[ 60%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/rw.cpp.o
[ 60%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/safer.cpp.o
[ 61%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/salsa.cpp.o
[ 61%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/scrypt.cpp.o
[ 62%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/seal.cpp.o
[ 62%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/seed.cpp.o
[ 63%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/serpent.cpp.o
[ 63%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/sha.cpp.o
[ 64%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/sha3.cpp.o
[ 64%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/sha_simd.cpp.o
[ 65%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/shacal2.cpp.o
[ 65%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/shacal2_simd.cpp.o
[ 66%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/shake.cpp.o
[ 66%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/shark.cpp.o
[ 66%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/sharkbox.cpp.o
[ 67%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/simeck.cpp.o
[ 67%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/simeck_simd.cpp.o
[ 68%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/simon.cpp.o
[ 68%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/simon128_simd.cpp.o
[ 69%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/simon64_simd.cpp.o
[ 69%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/skipjack.cpp.o
[ 70%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/sm3.cpp.o
[ 70%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/sm4.cpp.o
[ 71%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/sm4_simd.cpp.o
[ 71%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/sosemanuk.cpp.o
[ 72%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/speck.cpp.o
[ 72%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/speck128_simd.cpp.o
[ 73%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/speck64_simd.cpp.o
[ 73%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/square.cpp.o
[ 74%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/squaretb.cpp.o
[ 74%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/sse_simd.cpp.o
[ 75%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/strciphr.cpp.o
[ 75%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/tea.cpp.o
[ 76%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/tftables.cpp.o
[ 76%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/threefish.cpp.o
[ 77%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/tiger.cpp.o
[ 77%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/tigertab.cpp.o
[ 78%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/ttmac.cpp.o
[ 78%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/tweetnacl.cpp.o
[ 79%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/twofish.cpp.o
[ 79%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/vmac.cpp.o
[ 80%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/wake.cpp.o
[ 80%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/whrlpool.cpp.o
[ 81%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/xed25519.cpp.o
[ 81%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/xtr.cpp.o
[ 82%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/xtrcrypt.cpp.o
[ 82%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/zdeflate.cpp.o
[ 83%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/zinflate.cpp.o
[ 83%] Building CXX object external/cryptopp/CMakeFiles/cryptopp-object.dir/zlib.cpp.o
[ 83%] Built target cryptopp-object
Scanning dependencies of target cryptopp-static
[ 83%] Linking CXX static library libcryptopp.a
[ 83%] Built target cryptopp-static
Scanning dependencies of target securefs-static
[ 84%] Building CXX object CMakeFiles/securefs-static.dir/git-version.cpp.o
[ 84%] Building CXX object CMakeFiles/securefs-static.dir/external/jsoncpp.cpp.o
[ 85%] Building C object CMakeFiles/securefs-static.dir/external/utf8proc/utf8proc.c.o
/home/glitsj16/securefs-git/src/securefs/external/utf8proc/utf8proc.c: In function ‘utf8proc_decompose’:
/home/glitsj16/securefs-git/src/securefs/external/utf8proc/utf8proc.c:393:28: warning: comparison of integer expressions of different signedness: ‘utf8proc_ssize_t’ {aka ‘long int’} and ‘long unsigned int’ [-Wsign-compare]
  393 |       if (wpos < 0 || wpos > SSIZE_MAX/sizeof(utf8proc_int32_t)/2)
      |                            ^
[ 85%] Building CXX object CMakeFiles/securefs-static.dir/sources/apple_xattr_workaround.cpp.o
[ 86%] Building CXX object CMakeFiles/securefs-static.dir/sources/btree_dir.cpp.o
/home/glitsj16/securefs-git/src/securefs/sources/btree_dir.cpp: In instantiation of ‘const byte* securefs::read_and_forward(const byte*, const byte*, T&) [with T = securefs::PODArray<unsigned char, 32>; byte = unsigned char]’:
/home/glitsj16/securefs-git/src/securefs/sources/btree_dir.cpp:197:62:   required from here
/home/glitsj16/securefs-git/src/securefs/sources/btree_dir.cpp:30:11: warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘class securefs::PODArray<unsigned char, 32>’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
   30 |     memcpy(&value, buffer, sizeof(value));
      |     ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/glitsj16/securefs-git/src/securefs/sources/files.h:3,
                 from /home/glitsj16/securefs-git/src/securefs/sources/btree_dir.h:2,
                 from /home/glitsj16/securefs-git/src/securefs/sources/btree_dir.cpp:1:
/home/glitsj16/securefs-git/src/securefs/sources/myutils.h:166:7: note: ‘class securefs::PODArray<unsigned char, 32>’ declared here
  166 | class PODArray
      |       ^~~~~~~~
[ 86%] Building CXX object CMakeFiles/securefs-static.dir/sources/commands.cpp.o
/home/glitsj16/securefs-git/src/securefs/external/jsoncpp.cpp: In member function ‘Json::Value Json::Value::removeMember(const string&)’:
/home/glitsj16/securefs-git/src/securefs/external/jsoncpp.cpp:3679:34: warning: ‘Json::Value Json::Value::removeMember(const char*)’ is deprecated:  [-Wdeprecated-declarations]
 3679 |   return removeMember(key.c_str());
      |                                  ^
/home/glitsj16/securefs-git/src/securefs/external/jsoncpp.cpp:3666:7: note: declared here
 3666 | Value Value::removeMember(const char* key)
      |       ^~~~~
/home/glitsj16/securefs-git/src/securefs/external/jsoncpp.cpp: In member function ‘bool Json::OurReader::readToken(Json::OurReader::Token&)’:
/home/glitsj16/securefs-git/src/securefs/external/jsoncpp.cpp:1453:5: warning: this statement may fall through [-Wimplicit-fallthrough=]
 1453 |     if (features_.allowSingleQuotes_) {
      |     ^~
/home/glitsj16/securefs-git/src/securefs/external/jsoncpp.cpp:1458:3: note: here
 1458 |   case '/':
      |   ^~~~
[ 87%] Building CXX object CMakeFiles/securefs-static.dir/sources/common_platform.cpp.o
[ 87%] Building CXX object CMakeFiles/securefs-static.dir/sources/crypto.cpp.o
[ 88%] Building CXX object CMakeFiles/securefs-static.dir/sources/exceptions.cpp.o
[ 88%] Building CXX object CMakeFiles/securefs-static.dir/sources/file_table.cpp.o
/home/glitsj16/securefs-git/src/securefs/sources/commands.cpp: In static member function ‘static securefs::FSConfig securefs::CommandBase::read_config(securefs::FileStream*, const void*, size_t)’:
/home/glitsj16/securefs-git/src/securefs/sources/commands.cpp:438:18: warning: ‘Reader’ is deprecated: Use CharReader and CharReaderBuilder instead [-Wdeprecated-declarations]
  438 |     Json::Reader reader;
      |                  ^~~~~~
In file included from /home/glitsj16/securefs-git/src/securefs/sources/commands.cpp:14:
/home/glitsj16/securefs-git/src/securefs/external/json/json.h:1381:83: note: declared here
 1381 | class JSONCPP_DEPRECATED("Use CharReader and CharReaderBuilder instead") JSON_API Reader {
      |                                                                                   ^~~~~~
/home/glitsj16/securefs-git/src/securefs/sources/commands.cpp: In member function ‘virtual int securefs::InfoCommand::execute()’:
/home/glitsj16/securefs-git/src/securefs/sources/commands.cpp:1167:26: warning: ‘Reader’ is deprecated: Use CharReader and CharReaderBuilder instead [-Wdeprecated-declarations]
 1167 |             Json::Reader reader;
      |                          ^~~~~~
In file included from /home/glitsj16/securefs-git/src/securefs/sources/commands.cpp:14:
/home/glitsj16/securefs-git/src/securefs/external/json/json.h:1381:83: note: declared here
 1381 | class JSONCPP_DEPRECATED("Use CharReader and CharReaderBuilder instead") JSON_API Reader {
      |                                                                                   ^~~~~~
[ 89%] Building CXX object CMakeFiles/securefs-static.dir/sources/files.cpp.o
[ 89%] Building CXX object CMakeFiles/securefs-static.dir/sources/lite_fs.cpp.o
/home/glitsj16/securefs-git/src/securefs/sources/files.cpp: In member function ‘void securefs::FileBase::utimens(const timespec*)’:
/home/glitsj16/securefs-git/src/securefs/sources/files.cpp:314:30: warning: ‘current_time.timespec::tv_sec’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  314 |         struct fuse_timespec current_time;
/home/glitsj16/securefs-git/src/securefs/sources/files.cpp:314:30: warning: ‘current_time.timespec::tv_nsec’ may be used uninitialized in this function [-Wmaybe-uninitialized]
[ 90%] Building CXX object CMakeFiles/securefs-static.dir/sources/lite_operations.cpp.o
[ 90%] Building CXX object CMakeFiles/securefs-static.dir/sources/lite_stream.cpp.o
[ 91%] Building CXX object CMakeFiles/securefs-static.dir/sources/logger.cpp.o
[ 91%] Building CXX object CMakeFiles/securefs-static.dir/sources/mystring.cpp.o
[ 92%] Building CXX object CMakeFiles/securefs-static.dir/sources/myutils.cpp.o
[ 92%] Building CXX object CMakeFiles/securefs-static.dir/sources/operations.cpp.o
[ 93%] Building CXX object CMakeFiles/securefs-static.dir/sources/scrypt.cpp.o
[ 93%] Building CXX object CMakeFiles/securefs-static.dir/sources/streams.cpp.o
[ 94%] Building CXX object CMakeFiles/securefs-static.dir/sources/unix.cpp.o
[ 94%] Building CXX object CMakeFiles/securefs-static.dir/sources/win.cpp.o
[ 95%] Linking CXX static library libsecurefs-static.a
[ 95%] Built target securefs-static
Scanning dependencies of target securefs
Scanning dependencies of target securefs_test
[ 96%] Building CXX object CMakeFiles/securefs.dir/main.cpp.o
[ 96%] Building CXX object CMakeFiles/securefs_test.dir/test/main.cpp.o
[ 96%] Linking CXX executable securefs
[ 96%] Built target securefs
[ 97%] Building CXX object CMakeFiles/securefs_test.dir/test/test_btree.cpp.o
[ 97%] Building CXX object CMakeFiles/securefs_test.dir/test/test_crypto.cpp.o
[ 98%] Building CXX object CMakeFiles/securefs_test.dir/test/test_files.cpp.o
[ 98%] Building CXX object CMakeFiles/securefs_test.dir/test/test_streams.cpp.o
[ 99%] Building CXX object CMakeFiles/securefs_test.dir/test/test_utils.cpp.o
[ 99%] Building CXX object CMakeFiles/securefs_test.dir/test/test_xattr_workaround.cpp.o
[100%] Linking CXX executable securefs_test
[100%] Built target securefs_test
$ securefs_test
===============================================================================
All tests passed (395411 assertions in 19 test cases)
$ securefs version
securefs 0.9.0-beta1-24-gf7bc5ad
Crypto++ 8.2
libfuse 29
utf8proc 1.2.0

Hardware features available:
SSE2: true
SSE3: true
SSE4.1: true
SSE4.2: false
AES-NI: false
CLMUL: false
SHA: false
netheril96 commented 4 years ago

Does other FUSE filesystem, such as sshfs, work on your ArchLinux?

glitsj16 commented 4 years ago

Does other FUSE filesystem, such as sshfs, work on your ArchLinux?

Yes, SSHFS works just fine on Arch Linux. Creating a new securefs filesystem and mounting it results in the same error. Here's the output of the info subcommand:

$ securefs info /home/glitsj16/.007/.stash_sfs/
Config file path: /home/glitsj16/.007/.stash_sfs//.securefs.json
Filesystem format version: 1
Is full or lite format: full
Is underlying directory flattened: true
Is multiple mounts allowed: false
Is timestamp stored within the fs: false

Content block size: 4096 bytes
Content IV size: 256 bits
Password derivation algorithm: PBKDF2-HMAC-SHA256
Password derivation iterations: 214016
Per file key generation algorithm: HMAC-SHA256
Content cipher: AES-256-GCM
netheril96 commented 4 years ago

Can you try building with clang++ instead?

glitsj16 commented 4 years ago

@netheril96 Building with clang++ resulted in the exact same issue. I think it is a fuse issue on linux kernel 5.4. I don't have anything hard to support that claim yet, but I've seen reports on mount troubles with the 5.4 elsewhere. What I can confirm is that on the Arch Linux linux-zen kernel (currently at 5.13) securefs works as expected. That's why it worked on my Ubuntu 16.04 LTS machine, on which I run kernel 4.15.0-70-generic. With 5.4.0-1.1-liquorix-amd64 I see the same failure on Ubuntu too. Changed the description accordingly to avoid confusion. Will do some more digging and report back here. Thanks for your response.

glitsj16 commented 4 years ago

@netheril96 Here are 2 strace logs (redacted the securefs password). Did you get securefs working as expected on a linux kernel 5.4? If so I would be very interested to learn what version works for you. Hopefully this is a fixable issue, because on my main Arch Linux systems the 5.13 kernel that worked just got updated to 5.4 as well and that broke securefs entirely.

glitsj16 commented 4 years ago

Update: securefs should be fixed in kernel 5.4.2 via this commit. When that gets released I'll do some more testing.

netheril96 commented 4 years ago

Glad to know it’s not my fault.

mhogomchungu commented 4 years ago

The problem is still there with 5.4.2.

Command i use to unlock securefs volume and its output is below:

[ink@mtz ~]$ "/usr/bin/securefs" mount "$CIPHER_FOLDER" "$MOUNT_PATH"  -o ro,fsname=securefs@"/home/ink/.vaults/securefs",subtype=securefs
Password: 
Filesystem mounted successfully
fuse: reading device: Invalid argument
Filesystem unmounted successfully
[ink@mtz ~]$

The above attempt fails but produces below entry in "/proc/self/mountinfo"

39 33 0:31 / $MOUNT_PATH ro,nosuid,nodev,relatime - fuse.securefs securefs@/$CIPHER_PATH ro,user_id=500,group_id=500

The mount point is not accessible and it fails with the following error

[ink@mtz ~]$ stat $MOUNT_POINT
stat: cannot stat 'xxx': Transport endpoint is not connected
[ink@mtz ~]$ 

Cryfs, gocryptfs and encfs works fine.

Tested with securefs version 0.8.3 and kernel version 5.4.2 on PCLinuxOS.

[ink@mtz ~]$ uname -a
Linux mtz 5.4.2-pclos1 #1 SMP Wed Dec 4 17:46:38 CST 2019 x86_64 x86_64 x86_64 GNU/Linux
[ink@mtz ~]$ securefs v
securefs 0.8.3
Crypto++ 7
libfuse 29

Hardware features available:
SSE2: true
SSE3: true
SSE4.1: true
SSE4.2: true
AES-NI: true
CLMUL: true
SHA: false
[ink@mtz ~]$ 
netheril96 commented 4 years ago

How do I install a Linux 5.4.2 for testing? What distribution do you recommend I install on a VM to reproduce this bug?

glitsj16 commented 4 years ago

Confirming that the issue is indeed still present on linux 5.4.2.

@netheril96 The linux 5.4.2 kernel was officially released only a few days ago, so my guess is you won't find a ready-made VM that carries that easily. But if you use something like Virtualbox (what hypervisor are you using/comfortable with?) you can install a recent Ubuntu OS and manually get the 5.4.2 kernel .deb packages from https://kernel.ubuntu.com/~kernel-ppa/mainline/. I'm not very good with VM's though (due to not having access to a capable machine), so @mhogomchungu might have better advice.

bitraid commented 4 years ago

Linux 5.4.2 is now on Arch. You can grab the latest cli vm image from here, update (pacman -Syu), install dependencies (pacman -S).

repnz-scasb commented 4 years ago

Same thing happening over here , running on 5.4.1 Kernel

repnz-scasb commented 4 years ago

Problem still present on 5.4.5

netheril96 commented 4 years ago

I don't really know how to handle ArchLinux.

netheril96 commented 4 years ago

The strace logs look confusing. On 5.3.13 there is no reference to fusermount, while on 5.4 there is. Maybe the error is in the userland? What is the version of FUSE library when it breaks?

bitraid commented 4 years ago

FUSE3 version on Arch is 3.9.0.

glitsj16 commented 4 years ago

@netheril96 You might find some inspiration from gocryptfs when trying to debug/fix this.

MCOfficer commented 4 years ago

there was some discussion about a similar issue on the arch forums, which eventually pointed at this commit being the culprit. maybe that helps?

netheril96 commented 4 years ago

there was some discussion about a similar issue on the arch forums, which eventually pointed at this commit being the culprit. maybe that helps?

Judging from the symptoms (EINVAL), this is a likely cause. However, I never explicit set read buffer size, which should have been handled by libfuse already.

MCOfficer commented 4 years ago

Linux 5.4.2 is now on Arch. You can grab the latest cli vm image from here, update (pacman -Syu), install dependencies (pacman -S).

if arch is out of your league (boy, do i feel you), you might want to give manjaro a try. it is arch based and just got the 5.4.6 update (which didn't fix it, unfortunately), but provides frontends for the stuff relevant here: installing packages and switching kernel versions. the latter is hidden in the settings, under "Manjaro Settings Manager" -> "Kernel". if you want to stick to CLI, have a look at mhwd-kernel instead.

MCOfficer commented 4 years ago

Can confirm it works, thank you!