Kees Cook

435 posts

Kees Cook banner
Kees Cook

Kees Cook

@kees_cook

Free Software Hacker he/him @[email protected]

Portland, OR, USA انضم Şubat 2010
109 يتبع4.9K المتابعون
Kees Cook
Kees Cook@kees_cook·
Today's the 7th anniversary of founding the Kernel Self-Protection Project! @mail.gmail.com/" target="_blank" rel="nofollow noopener">lore.kernel.org/kernel-hardeni… We've come a long way, but there's still lots more work to do. :)
English
2
3
59
0
Kees Cook
Kees Cook@kees_cook·
If you can't switch your C to Rust immediately, consider at least enabling all the sanity checking the compiler can already do for free: -Wall -D_FORTIFY_SOURCE=2 -fsanitize=bounds fsanitize-undefined-trap-on-error -fstrict-flex-arrays (GCC 13+, Clang 16+)
English
12
72
444
0
Kees Cook
Kees Cook@kees_cook·
@Lahvuun I'm recommending "bounds" not "address" and if you use trap mode, it doesn't need the library.
English
0
0
1
0
lahvuun
lahvuun@Lahvuun·
@kees_cook I'm not sure about using -fsanitize. In my case with -fsanitize=address,undefined it linked to libasan, which broke my program for one of the users once their Linux distribution updated the library. I feel like this option should only be used for debug builds.
English
1
0
0
0
Kees Cook
Kees Cook@kees_cook·
@Khajiit_san glibc headers/runtime supports 1-3. Bionic supports 1-2. musl doesn't support it at all, and the separate fortify-aware headers (for 1-2) don't come with a runtime. So, yeah, =3 is glibc only currently.
English
1
0
0
0
Kees Cook
Kees Cook@kees_cook·
@Khajiit_san FORTIFY is a weird one: it's a combination of compiler builtins, libc headers, and libc runtime features. =1 uses __builtin_object_size(p, 0) =2 uses __builtin_object_size(p, 1) =3 uses __builtin_dynamic_object_size(p, 1) ...
English
1
0
0
0
Kees Cook
Kees Cook@kees_cook·
@zgrlin -fsanitize=address is ASAN (and is great) but usually considered too heavy for production code. -fsanitize=bounds has trivial overhead, though. Compiler can, you know, check the bounds: "Am I about to use an index outside the size of the array I know the length of? Maybe don't!"
English
0
0
7
0
Kees Cook
Kees Cook@kees_cook·
@_trou_ @BincatLady Cool! You remind me I've had buffer overflows on my mind too much recently: there's so much more to enable for other security bug classes, too: -fstack-protector-strong -Wvla -Wimplicit-fallthrough -ftrivial-auto-var-init=zero All of these should be default on in distros! :|
English
0
0
13
0
Kees Cook
Kees Cook@kees_cook·
@lafp I thought that part of -Wall? I ran out of characters on the first tweet, but if not -Wall, then yes, these: -Warray-bounds -Wstringop-overflow -Wstringop-overread -Wstringop-truncation
English
0
0
11
0
Kees Cook
Kees Cook@kees_cook·
@signalapp This is extremely disappointing. SMS integration is what set Signal apart from the fragmented ecosystem of other messaging apps. It's what made it easy for less technical friends & family to switch to and stay with Signal.
English
0
1
28
0
Signal
Signal@signalapp·
In the interest of privacy, security, and clarity we’re beginning to phase out SMS support from the Android app. You’ll have several months to export your messages and either find a new app for SMS or tell your friends to download Signal.  signal.org/blog/sms-remov…
English
969
493
1.7K
0
Kees Cook
Kees Cook@kees_cook·
I've started trying to document the various things I've learned about using Coccinelle to match code patterns in the Linux kernel here: github.com/kees/kernel-to… It's hardly complete, but I wanted to start keeping notes somewhere I could find later. :)
English
1
10
70
0
Kees Cook
Kees Cook@kees_cook·
On Linux there's at least 2 ways to mitigate these kinds of attacks: - easy: seccomp filter of "exec" system call - better: MAC (e.g. AppArmor, SELinux, etc) to block both "exec" and limit unexpected path traversals and file accesses
English
1
2
20
0
Kees Cook
Kees Cook@kees_cook·
I looked through these RCEs: they appear to all be command injection. (Though the MS issues don't have much detail.) Notably, there aren't any memory safety issues. But this is also more about web/net services, and command injection is the low hanging fruit in that environment.
English
2
3
23
0
Kees Cook
Kees Cook@kees_cook·
I think -Wimplicit-fallthrough should be enabled by -Wall. Right now it's only on with -Wextra. Thoughts?
English
6
1
14
0