Alien Top
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
onlinepersona@programming.dev to Rust@programming.devEnglish · 7 hours ago

Memory Safety Bugs in Rust Standard Library

forge-blog.github.io

external-link
message-square
11
link
fedilink
27
external-link

Memory Safety Bugs in Rust Standard Library

forge-blog.github.io

onlinepersona@programming.dev to Rust@programming.devEnglish · 7 hours ago
message-square
11
link
fedilink
Knowing What You Trust: Three patterns behind memory safety bugs we found in Rust's standard library, and why Rust's safety model still matters even though it isn't perfect.

cross-posted from: https://lemmy.bestiver.se/post/1442424

Comments

alert-triangle
You must log in or # to comment.
  • BB_C@programming.dev
    link
    fedilink
    arrow-up
    2
    ·
    37 minutes ago

    M$ ad talk now comes with LLM word diarrhea. Great!

    Nothing special is discovered or revealed here IMHO. The very first issue was independently found by security scans that don’t come with a marketing budget. The ad itself admits other issues also have been independently reported by others.

    The str/pattern stuff validates the position that unicode-validation at construction then keeping everything byte-based wasn’t a good choice. Explicit byte-view and char-view APIs would have been better.

    Otherwise, no harm from throwing free tokens at the rust compiler+std. They can still shove their now LLM-generated word diarrhea ad posts where they belong.

  • Kissaki@programming.dev
    link
    fedilink
    English
    arrow-up
    2
    ·
    2 hours ago

    Microsoft’s FORGE Lab found several memory safety issues in Rust’s standard library (std and core), including cases where code written entirely in safe Rust can trigger undefined behavior.

    • ImgurRefugee114@reddthat.com
      link
      fedilink
      arrow-up
      1
      ·
      2 hours ago

      Bit of a misnomer, since I don’t think Rust actually has “defined behavior” in the technical sense…

      or has it actually gotten a formal specification since I last looked?

      • TehPers@beehaw.org
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 hour ago

        From The Rust Reference

        • ImgurRefugee114@reddthat.com
          link
          fedilink
          arrow-up
          1
          ·
          52 minutes ago

          Not quite a standard, but fair enough for colloquial usage. A bit funny that they have to explicitly define undefined.

          • TehPers@beehaw.org
            link
            fedilink
            English
            arrow-up
            2
            ·
            35 minutes ago

            Yeah, they don’t define what’s “defined” behavior due to a lack of a formal standard, but there are some things they specifically want to defend against.

            There does exist a formal standard (and certified toolchain), but it’s not official as far as I’m aware.

            • BB_C@programming.dev
              link
              fedilink
              arrow-up
              2
              ·
              24 minutes ago

              but it’s not official as far as I’m aware.

              https://blog.rust-lang.org/2025/03/26/adopting-the-fls/

              https://rust-lang.github.io/fls/

              • TehPers@beehaw.org
                link
                fedilink
                English
                arrow-up
                1
                ·
                18 minutes ago

                Hey this is great news! I’m surprised I hadn’t seen this before.

            • ImgurRefugee114@reddthat.com
              link
              fedilink
              arrow-up
              1
              ·
              28 minutes ago

              Oh, I hadn’t heard of them before. Interesting. Thank you.

  • onlinepersona@programming.devOP
    link
    fedilink
    English
    arrow-up
    17
    ·
    7 hours ago

    Unsurprisingly, the issues come from wrapped, unsafe code.

    • Kissaki@programming.dev
      link
      fedilink
      English
      arrow-up
      5
      ·
      2 hours ago

      … in the stdlib, though, so safe code can trigger it.

Rust@programming.dev

rust@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !rust@programming.dev

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

!performance@programming.dev

Credits
  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 66 users / day
  • 137 users / week
  • 239 users / month
  • 1.17K users / 6 months
  • 22 local subscribers
  • 8.37K subscribers
  • 1.11K Posts
  • 4.13K Comments
  • Modlog
  • mods:
  • snowe@programming.dev
  • Ategon@programming.dev
  • EdTheLegendary@programming.dev
  • torcherist@programming.dev
  • BE: 0.19.17
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org