Giter Club home page Giter Club logo

memsec's Introduction

memsec's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

memsec's Issues

release 1.0.0

This library has been stable for a while and I don't think there will be any further changes in the base API.

but there are some internal changes that may happen in future.

These changes affect the MSRVs supported by memsec, and while memsec doesn't state which MSRV it supports right now, I would like it to change as little as possible.

Cross build for Android from macOS "selecting" march_o_sys crate instead of libc crate

Building memsec for android using MacOS fails

Environment

  • System: MacOS 10.14.5
  • Rust version: rustc 1.35.0 (3c235d560 2019-05-20)
  • Cargo version: cargo 1.35.0 (6f3e9c367 2019-04-04)
  • Cargo target: --target armv7-linux-androideabi
  • Android NDK: 18b
  • Memsec: tried 0.5.4 and latest commit e3cdb01

Command executed

cargo build --target armv7-linux-androideabi -vv

Command output

Machine-MacBook-Pro:memsec User$ cargo build --target armv7-linux-androideabi -vv
   Compiling libc v0.2.55
   Compiling memsec v0.5.5 (/Users/User/src/memsec)
     Running `CARGO_PKG_VERSION_PRE= CARGO_PKG_VERSION_MAJOR=0 DYLD_FALLBACK_LIBRARY_PATH='/Users/User/src/memsec/target/debug/deps:/Users/User/.rustup/toolchains/stable-x86_64-apple-darwin/lib:/Users/User/.rustup/toolchains/stable-x86_64-apple-darwin/lib:/Users/User/lib:/usr/local/lib:/usr/lib:/Users/User/lib:/usr/local/lib:/lib:/usr/lib' CARGO_PKG_NAME=libc CARGO_PKG_VERSION=0.2.55 CARGO_PKG_REPOSITORY='https://github.com/rust-lang/libc' CARGO=/Users/User/.rustup/toolchains/stable-x86_64-apple-darwin/bin/cargo CARGO_PKG_VERSION_MINOR=2 CARGO_PKG_VERSION_PATCH=55 CARGO_MANIFEST_DIR=/Users/User/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.55 CARGO_PKG_DESCRIPTION='Raw FFI bindings to platform libraries like libc.
' CARGO_PKG_HOMEPAGE='https://github.com/rust-lang/libc' CARGO_PKG_AUTHORS='The Rust Project Developers' rustc --crate-name build_script_build /Users/User/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.55/build.rs --color always --crate-type bin --emit=dep-info,link -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="use_std"' -C metadata=ad5ddcb9ef777b62 -C extra-filename=-ad5ddcb9ef777b62 --out-dir /Users/User/src/memsec/target/debug/build/libc-ad5ddcb9ef777b62 -L dependency=/Users/User/src/memsec/target/debug/deps --cap-lints warn`
     Running `CARGO_PKG_VERSION_PRE= CARGO_PKG_VERSION_MAJOR=0 DYLD_FALLBACK_LIBRARY_PATH='/Users/User/src/memsec/target/debug/deps:/Users/User/.rustup/toolchains/stable-x86_64-apple-darwin/lib:/Users/User/.rustup/toolchains/stable-x86_64-apple-darwin/lib:/Users/User/lib:/usr/local/lib:/usr/lib:/Users/User/lib:/usr/local/lib:/lib:/usr/lib' CARGO_PKG_NAME=memsec CARGO_PKG_VERSION=0.5.5 CARGO_PKG_REPOSITORY='https://github.com/quininer/memsec' CARGO=/Users/User/.rustup/toolchains/stable-x86_64-apple-darwin/bin/cargo CARGO_PKG_VERSION_MINOR=5 CARGO_PKG_VERSION_PATCH=5 CARGO_PRIMARY_PACKAGE=1 CARGO_MANIFEST_DIR=/Users/User/src/memsec CARGO_PKG_DESCRIPTION='Rust implementation `libsodium/utils`.' CARGO_PKG_HOMEPAGE= CARGO_PKG_AUTHORS='quininer kel <[email protected]>' rustc --crate-name build_script_build build.rs --color always --crate-type bin --emit=dep-info,link -C debuginfo=2 --cfg 'feature="alloc"' --cfg 'feature="default"' --cfg 'feature="getrandom"' --cfg 'feature="libc"' --cfg 'feature="mach_o_sys"' --cfg 'feature="use_os"' --cfg 'feature="winapi"' -C metadata=644572c87eb180c9 -C extra-filename=-644572c87eb180c9 --out-dir /Users/User/src/memsec/target/debug/build/memsec-644572c87eb180c9 -C incremental=/Users/User/src/memsec/target/debug/incremental -L dependency=/Users/User/src/memsec/target/debug/deps`
     Running `/Users/User/src/memsec/target/debug/build/memsec-644572c87eb180c9/build-script-build`
[memsec 0.5.5] cargo:rustc-cfg=apple
     Running `/Users/User/src/memsec/target/debug/build/libc-ad5ddcb9ef777b62/build-script-build`
[libc 0.2.55] cargo:rustc-cfg=libc_priv_mod_use
[libc 0.2.55] cargo:rustc-cfg=libc_union
[libc 0.2.55] cargo:rustc-cfg=libc_const_size_of
[libc 0.2.55] cargo:rustc-cfg=libc_align
[libc 0.2.55] cargo:rustc-cfg=libc_core_cvoid
[libc 0.2.55] cargo:rustc-cfg=libc_packedN
     Running `CARGO_PKG_VERSION_PRE= OUT_DIR=/Users/User/src/memsec/target/armv7-linux-androideabi/debug/build/libc-57c702f685547b8d/out CARGO_PKG_VERSION_MAJOR=0 DYLD_FALLBACK_LIBRARY_PATH='/Users/User/src/memsec/target/debug/deps:/Users/User/.rustup/toolchains/stable-x86_64-apple-darwin/lib:/Users/User/.rustup/toolchains/stable-x86_64-apple-darwin/lib:/Users/User/lib:/usr/local/lib:/usr/lib:/Users/User/lib:/usr/local/lib:/lib:/usr/lib' CARGO_PKG_NAME=libc CARGO_PKG_VERSION=0.2.55 CARGO_PKG_REPOSITORY='https://github.com/rust-lang/libc' CARGO=/Users/User/.rustup/toolchains/stable-x86_64-apple-darwin/bin/cargo CARGO_PKG_VERSION_MINOR=2 CARGO_PKG_VERSION_PATCH=55 CARGO_MANIFEST_DIR=/Users/User/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.55 CARGO_PKG_DESCRIPTION='Raw FFI bindings to platform libraries like libc.
' CARGO_PKG_HOMEPAGE='https://github.com/rust-lang/libc' CARGO_PKG_AUTHORS='The Rust Project Developers' rustc --crate-name libc /Users/User/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.55/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="use_std"' -C metadata=2963020b54ba7cc1 -C extra-filename=-2963020b54ba7cc1 --out-dir /Users/User/src/memsec/target/armv7-linux-androideabi/debug/deps --target armv7-linux-androideabi -C ar=/Users/User/src/NDK/arm/bin/arm-linux-androideabi-ar -C linker=/Users/User/src/NDK/arm/bin/arm-linux-androideabi-clang -L dependency=/Users/User/src/memsec/target/armv7-linux-androideabi/debug/deps -L dependency=/Users/User/src/memsec/target/debug/deps --cap-lints warn --cfg libc_priv_mod_use --cfg libc_union --cfg libc_const_size_of --cfg libc_align --cfg libc_core_cvoid --cfg libc_packedN`
   Compiling getrandom v0.1.3
     Running `CARGO_PKG_VERSION_PRE= CARGO_PKG_VERSION_MAJOR=0 DYLD_FALLBACK_LIBRARY_PATH='/Users/User/src/memsec/target/debug/deps:/Users/User/.rustup/toolchains/stable-x86_64-apple-darwin/lib:/Users/User/.rustup/toolchains/stable-x86_64-apple-darwin/lib:/Users/User/lib:/usr/local/lib:/usr/lib:/Users/User/lib:/usr/local/lib:/lib:/usr/lib' CARGO_PKG_NAME=getrandom CARGO_PKG_VERSION=0.1.3 CARGO_PKG_REPOSITORY='https://github.com/rust-random/getrandom' CARGO=/Users/User/.rustup/toolchains/stable-x86_64-apple-darwin/bin/cargo CARGO_PKG_VERSION_MINOR=1 CARGO_PKG_VERSION_PATCH=3 CARGO_MANIFEST_DIR=/Users/User/.cargo/registry/src/github.com-1ecc6299db9ec823/getrandom-0.1.3 CARGO_PKG_DESCRIPTION='A small cross-platform library for retrieving random data from system source' CARGO_PKG_HOMEPAGE= CARGO_PKG_AUTHORS='The Rand Project Developers' rustc --edition=2018 --crate-name getrandom /Users/User/.cargo/registry/src/github.com-1ecc6299db9ec823/getrandom-0.1.3/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=a57b553dffd209ec -C extra-filename=-a57b553dffd209ec --out-dir /Users/User/src/memsec/target/armv7-linux-androideabi/debug/deps --target armv7-linux-androideabi -C ar=/Users/User/src/NDK/arm/bin/arm-linux-androideabi-ar -C linker=/Users/User/src/NDK/arm/bin/arm-linux-androideabi-clang -L dependency=/Users/User/src/memsec/target/armv7-linux-androideabi/debug/deps -L dependency=/Users/User/src/memsec/target/debug/deps --extern libc=/Users/User/src/memsec/target/armv7-linux-androideabi/debug/deps/liblibc-2963020b54ba7cc1.rlib --cap-lints warn`
     Running `CARGO_PKG_VERSION_PRE= OUT_DIR=/Users/User/src/memsec/target/armv7-linux-androideabi/debug/build/memsec-65bda352a3700c4b/out CARGO_PKG_VERSION_MAJOR=0 DYLD_FALLBACK_LIBRARY_PATH='/Users/User/src/memsec/target/debug/deps:/Users/User/.rustup/toolchains/stable-x86_64-apple-darwin/lib:/Users/User/.rustup/toolchains/stable-x86_64-apple-darwin/lib:/Users/User/lib:/usr/local/lib:/usr/lib:/Users/User/lib:/usr/local/lib:/lib:/usr/lib' CARGO_PKG_NAME=memsec CARGO_PKG_VERSION=0.5.5 CARGO_PKG_REPOSITORY='https://github.com/quininer/memsec' CARGO=/Users/User/.rustup/toolchains/stable-x86_64-apple-darwin/bin/cargo CARGO_PKG_VERSION_MINOR=5 CARGO_PKG_VERSION_PATCH=5 CARGO_PRIMARY_PACKAGE=1 CARGO_MANIFEST_DIR=/Users/User/src/memsec CARGO_PKG_DESCRIPTION='Rust implementation `libsodium/utils`.' CARGO_PKG_HOMEPAGE= CARGO_PKG_AUTHORS='quininer kel <[email protected]>' rustc --crate-name memsec src/lib.rs --color always --crate-type lib --emit=dep-info,link -C debuginfo=2 --cfg 'feature="alloc"' --cfg 'feature="default"' --cfg 'feature="getrandom"' --cfg 'feature="libc"' --cfg 'feature="mach_o_sys"' --cfg 'feature="use_os"' --cfg 'feature="winapi"' -C metadata=745173220f5af749 -C extra-filename=-745173220f5af749 --out-dir /Users/User/src/memsec/target/armv7-linux-androideabi/debug/deps --target armv7-linux-androideabi -C ar=/Users/User/src/NDK/arm/bin/arm-linux-androideabi-ar -C linker=/Users/User/src/NDK/arm/bin/arm-linux-androideabi-clang -C incremental=/Users/User/src/memsec/target/armv7-linux-androideabi/debug/incremental -L dependency=/Users/User/src/memsec/target/armv7-linux-androideabi/debug/deps -L dependency=/Users/User/src/memsec/target/debug/deps --extern getrandom=/Users/User/src/memsec/target/armv7-linux-androideabi/debug/deps/libgetrandom-a57b553dffd209ec.rlib --extern libc=/Users/User/src/memsec/target/armv7-linux-androideabi/debug/deps/liblibc-2963020b54ba7cc1.rlib --cfg apple`
error[E0463]: can't find crate for `mach_o_sys`
 --> src/lib.rs:8:40
  |
8 | #[cfg(all(apple, feature = "use_os"))] extern crate mach_o_sys;
  |                                        ^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: Could not compile `memsec`.

Caused by:
  process didn't exit successfully: `CARGO_PKG_VERSION_PRE= OUT_DIR=/Users/User/src/memsec/target/armv7-linux-androideabi/debug/build/memsec-65bda352a3700c4b/out CARGO_PKG_VERSION_MAJOR=0 DYLD_FALLBACK_LIBRARY_PATH='/Users/User/src/memsec/target/debug/deps:/Users/User/.rustup/toolchains/stable-x86_64-apple-darwin/lib:/Users/User/.rustup/toolchains/stable-x86_64-apple-darwin/lib:/Users/User/lib:/usr/local/lib:/usr/lib:/Users/User/lib:/usr/local/lib:/lib:/usr/lib' CARGO_PKG_NAME=memsec CARGO_PKG_VERSION=0.5.5 CARGO_PKG_REPOSITORY='https://github.com/quininer/memsec' CARGO=/Users/User/.rustup/toolchains/stable-x86_64-apple-darwin/bin/cargo CARGO_PKG_VERSION_MINOR=5 CARGO_PKG_VERSION_PATCH=5 CARGO_PRIMARY_PACKAGE=1 CARGO_MANIFEST_DIR=/Users/User/src/memsec CARGO_PKG_DESCRIPTION='Rust implementation `libsodium/utils`.' CARGO_PKG_HOMEPAGE= CARGO_PKG_AUTHORS='quininer kel <[email protected]>' rustc --crate-name memsec src/lib.rs --color always --crate-type lib --emit=dep-info,link -C debuginfo=2 --cfg 'feature="alloc"' --cfg 'feature="default"' --cfg 'feature="getrandom"' --cfg 'feature="libc"' --cfg 'feature="mach_o_sys"' --cfg 'feature="use_os"' --cfg 'feature="winapi"' -C metadata=745173220f5af749 -C extra-filename=-745173220f5af749 --out-dir /Users/User/src/memsec/target/armv7-linux-androideabi/debug/deps --target armv7-linux-androideabi -C ar=/Users/User/src/NDK/arm/bin/arm-linux-androideabi-ar -C linker=/Users/User/src/NDK/arm/bin/arm-linux-androideabi-clang -C incremental=/Users/User/src/memsec/target/armv7-linux-androideabi/debug/incremental -L dependency=/Users/User/src/memsec/target/armv7-linux-androideabi/debug/deps -L dependency=/Users/User/src/memsec/target/debug/deps --extern getrandom=/Users/User/src/memsec/target/armv7-linux-androideabi/debug/deps/libgetrandom-a57b553dffd209ec.rlib --extern libc=/Users/User/src/memsec/target/armv7-linux-androideabi/debug/deps/liblibc-2963020b54ba7cc1.rlib --cfg apple` (exit code: 1)

Things tried and guessing

  • Building from Debian <- It worked like a charm (0.5.4 and latest master)

I guess it is detecting the build-os instead of the target-os and therefore trying to use march_o_sys instead of libc when building from apple.

Is there interest in a feature gated `memfd_secret` backend?

We are interested in having a memfd_secret based allocator, that uses memsec as fallback. So we figured it would make sense to ask, if this would be a functionality desired directly in memsec?

The basic ideas are:

  • provide runtime function to check for memfd_secret support (this we already have, on non-linux systems that is compile time known false)
  • if memfd_secret support is available, try memfd_secret + mmap to allocate
  • if that fails, fall back to the default

All that of course feature gated, not active by default.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.