safeclib
fancy-memcmp
safeclib | fancy-memcmp | |
---|---|---|
8 | 2 | |
311 | 3 | |
- | - | |
7.0 | 3.5 | |
18 days ago | 9 days ago | |
C | Assembly | |
GNU General Public License v3.0 or later | - |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
safeclib
-
LLVM's Libc Gets Much Faster memcpy For RISC-V
Of course assembler spezializations are an anti-pattern, because the optimizer should be fixed to do it much better. Better C code is often 2x faster than hand optimized assembler.
Eg my C memcpy with inlined and vectorized clang beats glibc or gcc memcpy in assembler easily. https://github.com/rurban/safeclib/blob/master/tests/perf_me...
-
Site with common coding mistakes that cause security threats with code examples?
+1 This along with https://github.com/rurban/safeclib (and its forks/derivatives).
- Safeclib – C11 Annex K implementation
-
What are the major dialects of C nowadays?
I have yet to look into Annex K. It didn't seem to gain much traction. Some people at Red Hat wrote a field experience report about it. I recently discovered an implementation of Annex K functions that claims to be pretty portable, safeclib.
-
memmove_s?
See my testsuite and remarks at https://github.com/rurban/safeclib/blob/master/doc/libc-overview.md , esp. towards the windows implementation
- Why does Windows 10 run faster than Fedora?
-
A 100LOC C impl of memset, that is faster than glibc's
I do it because nobody else implemented a secure memset. What they call secure is just avoiding that the compiler ignores it. A secure memset also cleans the caches with a memory barrier, so that meltdown cannot read it.
explicit_bzero and it's numerous variants are not only insecure, but also slow. (byte wise!)
Only safelibc has a secure memset_s. https://github.com/rurban/safeclib/blob/master/tests/perf_me...
fancy-memcmp
-
Out-of-bounds read and write in the glibc's qsort()
Hrm—that's another case of missing isel from gcc/clang (c.f. <https://pp.ipd.kit.edu/firm/selgen>)—my implementation (<https://github.com/moon-chilled/fancy-memcmp/blob/master/mem...>) does it in one less instruction. (An alternative is to skip the xors and do cmp/setcc/setcc/sub/movsx, which matches my approach on instruction count, but relies on good handling of partial renames, which is uarch-dependent. And I can never remember if anybody can eliminate movsx. Otoh it is non-destructive.)
-
LLVM's Libc Gets Much Faster memcpy For RISC-V
I only have experience with their amd64 code.
> What problems do they have?
Nothing in particular, just not particularly amazing performance. They work fine. One thing they have going for them is that they typically have separate versions for every interesting architecture feature level/set, whereas e.g. bionic only has sse code. I guess I can point at my own implementations of memset and memcmp (https://github.com/moon-chilled/fancy-memset https://github.com/moon-chilled/fancy-memcmp), both of which employ novel techniques not used by glibc; but I've not yet gotten around to doing proper benchmarks on either.
What are some alternatives?
memset_benchmark - This repository contains high-performance implementations of memset and memcpy in assembly.
fancy-memset - small, fast memset based on microsoft's design
qemu
gcc
libu8ident - unicode security guidelines for identifiers
copies-and-fills
libredwg - Official mirror of libredwg. With CI hooks and nightly releases. PR's ok
libnbd
nbdkit