- Breaking: Removed
boxed
module.Box
is now available in theallocator_api
module. - Breaking: Allocators are no longer generic over a
Zeroizer
, but always use the default. - On a stable compiler use
allocator-api2
crate instead of our own allocator api clone. - Improved error messages when page allocation or locking fails.
- Internal: Ported unix support from
libc
torustix
crate. This means that in no-std mode this crate no longer depends on libc. - Internal: Ported windows support from
winapi
towindows
crate.
- Breaking: Removed
zeroize
module. A singlezeroize_mem
function is now available in the crate root instead.
- Fixed SSE and AVX zeroizers not properly zeroising the whole memory region under certain alignment conditions.
- Fixed potential memory leak on Windows, where the page size was passed to
VirtualAlloc
, where it expected a zero value.
Notice: Yanked because of the issues described under the 0.2.2 version.
-
Fixed Undefined Behaviour (UB) in
SecStackSinglePageAlloc
when not using thenightly_allocator_api
feature.The UB would occur when the user deallocates a
secmem_proc::boxed::Box
of a size which is not a multiple of 8.Detailed Description
The issue is that stds nightly
Allocator
is "magic" w.r.t. thedeallocate
function. The pointer input variable (first input) received by the allocator, doesn't have the provenance of the pointer that was passed todeallocate
, but instead the potentially larger provenance of the pointer that was returned byallocate
for this allocation.We round up allocation request sizes to multiples of 8, and then in
deallocate
we zeroize this full (size multiple of 8) allocation. However, in our stable "clone" ofAllocator
, there is no "magic", and the pointer passed todeallocate
can have a provenance to only the number of bytes that were requested in theallocate
call, i.e. not rounded up to a multiple of 8.
Notice: Yanked because of the issues described under the 0.2.1 and 0.2.2 versions.
- Added X86_64 SSE2 and AVX simd zeroizers using inline assembly.
- Added
nightly_stdsimd
andnightly_strict_provenance
features. Both don't affect the library interface currently.
- Ported
AsmRepStosZeroizer
to use Rust inline assembly rather than C inline assembly so it doesn't require thecc
feature and a C compiler anymore. - Changed
MemZeroizer
trait: replacedzeroize_mem_minaligned
method with new methodzeroize_mem_blocks
which takes the logarithm of the align and in addition a logarithm of block size as constant generics (such thatlen
must be a multiple of of this block size, andptr
is aligned to the specified align). DefaultMemZeroizer
now uses one of the simd zeroizers when available and no libc zeroizer or nightly compiler (nightly_core_intrinsics
feature) is available.
cc
crate feature, since the C inline assembly has been ported to Rust inline assembly.
- Fixed compile error on
no_std
windows - Added
MAP_NOCORE
flag on page allocation on freebsd-like systems - Remove int-ptr-casts, making miri pass with
miri-tag-raw-pointers
enabled
- Added windows support
- Added MIRAI annotations to source code
- Excluded unnecessary files from crates package
- Added changelog
Initial version