Skip to content
  • Home Home Home, current page.
  • Moments Moments Moments, current page.

Saved searches

  • Remove
  • In this conversation
    Verified accountProtected Tweets @
Suggested users
  • Verified accountProtected Tweets @
  • Verified accountProtected Tweets @
  • Language: English
    • Bahasa Indonesia
    • Bahasa Melayu
    • Català
    • Čeština
    • Dansk
    • Deutsch
    • English UK
    • Español
    • Filipino
    • Français
    • Hrvatski
    • Italiano
    • Magyar
    • Nederlands
    • Norsk
    • Polski
    • Português
    • Română
    • Slovenčina
    • Suomi
    • Svenska
    • Tiếng Việt
    • Türkçe
    • Ελληνικά
    • Български език
    • Русский
    • Српски
    • Українська мова
    • עִבְרִית
    • العربية
    • فارسی
    • मराठी
    • हिन्दी
    • বাংলা
    • ગુજરાતી
    • தமிழ்
    • ಕನ್ನಡ
    • ภาษาไทย
    • 한국어
    • 日本語
    • 简体中文
    • 繁體中文
  • Have an account? Log in
    Have an account?
    · Forgot password?

    New to Twitter?
    Sign up
RichFelker's profile
Rich Felker
Rich Felker
Rich Felker
@RichFelker

Tweets

Rich Felker

@RichFelker

Yeah, I do @musllibc, FOSS & infosec stuff. But now is not the time for a mostly-/only-tech Twitter feed.

musl-libc.org
Joined March 2014

Tweets

  • © 2018 Twitter
  • About
  • Help Center
  • Terms
  • Privacy policy
  • Cookies
  • Ads info
Dismiss
Previous
Next

Go to a person's profile

Saved searches

  • Remove
  • In this conversation
    Verified accountProtected Tweets @
Suggested users
  • Verified accountProtected Tweets @
  • Verified accountProtected Tweets @

Promote this Tweet

Block

  • Tweet with a location

    You can add location information to your Tweets, such as your city or precise location, from the web and via third-party applications. You always have the option to delete your Tweet location history. Learn more

    Your lists

    Create a new list


    Under 100 characters, optional

    Privacy

    Copy link to Tweet

    Embed this Tweet

    Embed this Video

    Add this Tweet to your website by copying the code below. Learn more

    Add this video to your website by copying the code below. Learn more

    Hmm, there was a problem reaching the server.

    By embedding Twitter content in your website or app, you are agreeing to the Twitter Developer Agreement and Developer Policy.

    Preview

    Why you're seeing this ad

    Log in to Twitter

    · Forgot password?
    Don't have an account? Sign up »

    Sign up for Twitter

    Not on Twitter? Sign up, tune into the things you care about, and get updates as they happen.

    Sign up
    Have an account? Log in »

    Two-way (sending and receiving) short codes:

    Country Code For customers of
    United States 40404 (any)
    Canada 21212 (any)
    United Kingdom 86444 Vodafone, Orange, 3, O2
    Brazil 40404 Nextel, TIM
    Haiti 40404 Digicel, Voila
    Ireland 51210 Vodafone, O2
    India 53000 Bharti Airtel, Videocon, Reliance
    Indonesia 89887 AXIS, 3, Telkomsel, Indosat, XL Axiata
    Italy 4880804 Wind
    3424486444 Vodafone
    » See SMS short codes for other countries

    Confirmation

     

    Welcome home!

    This timeline is where you’ll spend most of your time, getting instant updates about what matters to you.

    Tweets not working for you?

    Hover over the profile pic and click the Following button to unfollow any account.

    Say a lot with a little

    When you see a Tweet you love, tap the heart — it lets the person who wrote it know you shared the love.

    Spread the word

    The fastest way to share someone else’s Tweet with your followers is with a Retweet. Tap the icon to send it instantly.

    Join the conversation

    Add your thoughts about any Tweet with a Reply. Find a topic you’re passionate about, and jump right in.

    Learn the latest

    Get instant insight into what people are talking about now.

    Get more of what you love

    Follow more accounts to get instant updates about topics you care about.

    Find what's happening

    See the latest conversations about any topic instantly.

    Never miss a Moment

    Catch up instantly on the best stories happening as they unfold.

    1. Alexander Tarasikov‏ @astarasikov Apr 14

      So why don't most libc/kernel implementations ship a "memcpy" that would query the number of available bytes from the allocator (for heap objects), from the linker (for globals) and from some compiler-generated info (CFI?)?

      1 reply 3 retweets 7 likes
      Rich Felker‏ @RichFelker Apr 14
      Replying to @astarasikov

      This exists. It's called ASan.

      8:00 PM - 14 Apr 2018
      3 replies 0 retweets 0 likes
        1. New conversation
        2. Alexander Tarasikov‏ @astarasikov Apr 14
          Replying to @RichFelker

          yes, but ASan is too heavy-weight. It seems that hardened usercopy is exactly what I've described and if I'm not mistaken grsec had a compiler plugin for stack instrumentation. Now, why did this not get adopted everywhere at least for debugging, and did not get benchmarked?

          2 replies 0 retweets 0 likes
        3. Rich Felker‏ @RichFelker Apr 14
          Replying to @astarasikov

          I don't think hardened usercopy is related.

          1 reply 0 retweets 0 likes
        4. CopperheadOS‏ @CopperheadOS Apr 14
          Replying to @RichFelker @astarasikov

          It's related but it's way too slow to use it for memcpy, especially in libc. Most malloc implementations aren't capable of providing a comparable feature. Kernel slab allocators are similar to a hardened malloc like OpenBSD malloc other than how they track free objects in slabs.

          0 replies 0 retweets 1 like
        5. End of conversation
        1. New conversation
        2. Rich Felker‏ @RichFelker Apr 14
          Replying to @RichFelker @astarasikov

          Also _FORTIFY_SOURCE kinda does it for production use, but the scope of size availability is limited.

          1 reply 0 retweets 1 like
        3. Rich Felker‏ @RichFelker Apr 14
          Replying to @RichFelker @astarasikov

          Could extend it by providing a way to extend __builtin_object_size to call into a function with hooks into malloc & symbol table if size isn't locally known...

          1 reply 0 retweets 0 likes
        4. Rich Felker‏ @RichFelker Apr 14
          Replying to @RichFelker @astarasikov

          But making that work depends on a malloc implementation that can find an allocation by any pointer into it, not just pointer to start.

          1 reply 0 retweets 0 likes
        5. Alexander Tarasikov‏ @astarasikov Apr 14
          Replying to @RichFelker

          yes, and that depends on not trusting the pointers that you pass to "free()" and ideally not storing metadata inline with the data

          1 reply 0 retweets 0 likes
        6. CopperheadOS‏ @CopperheadOS Apr 14
          Replying to @astarasikov @RichFelker

          OpenBSD malloc works like this and we have a __dynamic_object_size(arbitrary_pointer) implementation for it which we use for dynamic overflow checks in the libc system call wrappers. It's one of the features we haven't fully ported to Android Oreo though.

          1 reply 0 retweets 1 like
        7. CopperheadOS‏ @CopperheadOS Apr 14
          Replying to @CopperheadOS @astarasikov @RichFelker

          Still have __dynamic_object_size (which calls our __malloc_object_size) but need to add back the system call wrappers using it. They moved everything around and it just needs a bit of work. Doing it like this lets it work for indirect calls and doesn't require rebuilding code.

          1 reply 0 retweets 0 likes
        8. CopperheadOS‏ @CopperheadOS Apr 14
          Replying to @CopperheadOS @astarasikov @RichFelker

          It would be ridiculously slow to use it with the string functions. It's only used for system calls. If you want pervasive overflow checks, you should probably just recompile code with fat pointers and check all dereferences not just string functions.

          1 reply 0 retweets 0 likes
        9. CopperheadOS‏ @CopperheadOS Apr 14
          Replying to @CopperheadOS @astarasikov @RichFelker

          Can have a fat pointer ABI side-by-side with the existing ABI as part of phasing it in, just like a multiarch 32-bit -> 64-bit transition. Integer -> pointer conversions would need to use an intrinsic to set the size to enforce proper bounds checks but otherwise it's automatic.

          0 replies 0 retweets 0 likes
        10. End of conversation
        1. New conversation
        2. CopperheadOS‏ @CopperheadOS Apr 14
          Replying to @RichFelker @astarasikov

          ASan checks aren't based on allocation sizes. It's best effort checking based on bitmaps and red zones.

          1 reply 0 retweets 1 like
        3. CopperheadOS‏ @CopperheadOS Apr 15
          Replying to @CopperheadOS @RichFelker @astarasikov

          ASan approach can only reliably catch linear overflows. It can detect some non-linear overflows, but not all, and definitely not ones done by an attacker. It can't really detect a write from one heap object into another. It's good at catching some accidental stray accesses.

          1 reply 0 retweets 1 like
        4. CopperheadOS‏ @CopperheadOS Apr 15
          Replying to @CopperheadOS @RichFelker @astarasikov

          Similarly, ASan double-free / use-after-free detection works via a quarantine with a limited size so it's also only best effort. It's really an allocator feature and makes sense in a debugging or hardened allocator without any of the compiler instrumentation too.

          0 replies 0 retweets 0 likes
        5. End of conversation

      Loading seems to be taking a while.

      Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.

        Promoted Tweet

        false

        • © 2018 Twitter
        • About
        • Help Center
        • Terms
        • Privacy policy
        • Cookies
        • Ads info