Skip to content
  • Hjem
  • Seneste
  • Etiketter
  • Populære
  • Verden
  • Bruger
  • Grupper
Temaer
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Kollaps
FARVEL BIG TECH
  1. Forside
  2. Ikke-kategoriseret
  3. The coreutils Rust rewrite story is pretty funny.

The coreutils Rust rewrite story is pretty funny.

Planlagt Fastgjort Låst Flyttet Ikke-kategoriseret
198 Indlæg 103 Posters 150 Visninger
  • Ældste til nyeste
  • Nyeste til ældste
  • Most Votes
Svar
  • Svar som emne
Login for at svare
Denne tråd er blevet slettet. Kun brugere med emne behandlings privilegier kan se den.
  • lcamtuf@infosec.exchangeL lcamtuf@infosec.exchange

    The coreutils Rust rewrite story is pretty funny.

    Coreutils are tools like rm, mv, mkdir, etc. Unlike binutils, this isn't a fertile ground for memory safety bugs. But, the rewrite was completed, and in the spirit of progress, Canonical decided to switch.

    But do you know what coreutils are a fertile ground for? Race conditions around file creation, deletion, permission setting, and so on. The original code accounted for decades of hard-learned lessons in that space. The Rust rewrite did not:

    https://seclists.org/oss-sec/2026/q2/332

    PS. I'm not dunking on Rust. It's just that... starting over from scratch has its hidden costs.

    lee_holmes@infosec.exchangeL This user is from outside of this forum
    lee_holmes@infosec.exchangeL This user is from outside of this forum
    lee_holmes@infosec.exchange
    wrote sidst redigeret af
    #19

    @lcamtuf Yeah, not a good situation - even doing it in "safe C++" or somesuch would have had the same result. Decades of hard-learned lessons should be encoded in decades of well-written unit tests.

    1 Reply Last reply
    0
    • lcamtuf@infosec.exchangeL lcamtuf@infosec.exchange

      The coreutils Rust rewrite story is pretty funny.

      Coreutils are tools like rm, mv, mkdir, etc. Unlike binutils, this isn't a fertile ground for memory safety bugs. But, the rewrite was completed, and in the spirit of progress, Canonical decided to switch.

      But do you know what coreutils are a fertile ground for? Race conditions around file creation, deletion, permission setting, and so on. The original code accounted for decades of hard-learned lessons in that space. The Rust rewrite did not:

      https://seclists.org/oss-sec/2026/q2/332

      PS. I'm not dunking on Rust. It's just that... starting over from scratch has its hidden costs.

      drwho@masto.hackers.townD This user is from outside of this forum
      drwho@masto.hackers.townD This user is from outside of this forum
      drwho@masto.hackers.town
      wrote sidst redigeret af
      #20

      @lcamtuf Welp. Got rent for next month covered.

      1 Reply Last reply
      0
      • pikhq@social.treehouse.systemsP pikhq@social.treehouse.systems

        @lcamtuf and it's very worth remembering that while the design of rust _does_ prevent many bugs, it's not a get-out-of-bugs-free card. there are many ways to write code wrong, not just memory safety issues!

        petrillic@hachyderm.ioP This user is from outside of this forum
        petrillic@hachyderm.ioP This user is from outside of this forum
        petrillic@hachyderm.io
        wrote sidst redigeret af
        #21

        @pikhq @lcamtuf @drwho we are, as a species, especially creative at finding new ways to write code wrong.

        1 Reply Last reply
        1
        0
        • raymaccarthy@mastodon.ieR raymaccarthy@mastodon.ie

          @lcamtuf
          I learned C++ after Modula-2 and before C.
          I learned programming earlier.

          Learning a programming language isn't learning programming (extracting requirements, specification, design, coding, test etc).
          I looked at Rust. C++ certainly has got too complicated since 1987, but I wonder does Rust *only* help with memory safety?
          Main memory safety in general relates to using pointers that are invalid, accessing arrays out of bounds and past the end of strings.
          Partly bad libraries & design.

          zardoz03@mastodon.onlineZ This user is from outside of this forum
          zardoz03@mastodon.onlineZ This user is from outside of this forum
          zardoz03@mastodon.online
          wrote sidst redigeret af
          #22

          @raymaccarthy
          well allegedly its types are meant to aid in type driven design and better domain modelling; but i dont know if this is actually seen in practice in better code structure. same could be said of cxx + its classes
          @lcamtuf

          raymaccarthy@mastodon.ieR 1 Reply Last reply
          0
          • lcamtuf@infosec.exchangeL lcamtuf@infosec.exchange

            The coreutils Rust rewrite story is pretty funny.

            Coreutils are tools like rm, mv, mkdir, etc. Unlike binutils, this isn't a fertile ground for memory safety bugs. But, the rewrite was completed, and in the spirit of progress, Canonical decided to switch.

            But do you know what coreutils are a fertile ground for? Race conditions around file creation, deletion, permission setting, and so on. The original code accounted for decades of hard-learned lessons in that space. The Rust rewrite did not:

            https://seclists.org/oss-sec/2026/q2/332

            PS. I'm not dunking on Rust. It's just that... starting over from scratch has its hidden costs.

            m@martinh.netM This user is from outside of this forum
            m@martinh.netM This user is from outside of this forum
            m@martinh.net
            wrote sidst redigeret af
            #23

            @lcamtuf Et tu, TOCTOU

            1 Reply Last reply
            0
            • xerz@soc.masfloss.netX xerz@soc.masfloss.net

              @lcamtuf ........ouch

              I'm shocked they didn't account for any of that

              hypha@cafe.mycelium.locahlo.stH This user is from outside of this forum
              hypha@cafe.mycelium.locahlo.stH This user is from outside of this forum
              hypha@cafe.mycelium.locahlo.st
              wrote sidst redigeret af
              #24

              @xerz @lcamtuf it’s easy to fall for domain specific knowledge traps when you’re learning
              which is why it’s often advised against rewriting software from scratch, especially if you were not in the first team of developers

              star@fed.amazonawaws.comS 1 Reply Last reply
              0
              • zardoz03@mastodon.onlineZ zardoz03@mastodon.online

                @raymaccarthy
                well allegedly its types are meant to aid in type driven design and better domain modelling; but i dont know if this is actually seen in practice in better code structure. same could be said of cxx + its classes
                @lcamtuf

                raymaccarthy@mastodon.ieR This user is from outside of this forum
                raymaccarthy@mastodon.ieR This user is from outside of this forum
                raymaccarthy@mastodon.ie
                wrote sidst redigeret af
                #25

                @zardoz03 @lcamtuf
                Strong types help, but loads of languages had that 40 years ago.

                1 Reply Last reply
                0
                • synlogic4242@social.vivaldi.netS synlogic4242@social.vivaldi.net

                  @lcamtuf Rustaceans are the problem, not Rust itself. theyre like a lobbing group trying explicitly to boost their future employment demand much more than prioritized on doing the right thing as engineers or for the community. much like the AI VC are "talking up their book" even if its poison for the rest of us

                  rmq@toot.ioR This user is from outside of this forum
                  rmq@toot.ioR This user is from outside of this forum
                  rmq@toot.io
                  wrote sidst redigeret af
                  #26

                  @synlogic4242 Uutils started as someone’s personal project to learn rust, and “write a system utility” is frequently used as a basic exercise for learning. Uutils is doing exactly what it set out to do.

                  It’s not the fault of uutils that Canonical is dumb.

                  @lcamtuf

                  synlogic4242@social.vivaldi.netS 1 Reply Last reply
                  0
                  • lcamtuf@infosec.exchangeL lcamtuf@infosec.exchange

                    The coreutils Rust rewrite story is pretty funny.

                    Coreutils are tools like rm, mv, mkdir, etc. Unlike binutils, this isn't a fertile ground for memory safety bugs. But, the rewrite was completed, and in the spirit of progress, Canonical decided to switch.

                    But do you know what coreutils are a fertile ground for? Race conditions around file creation, deletion, permission setting, and so on. The original code accounted for decades of hard-learned lessons in that space. The Rust rewrite did not:

                    https://seclists.org/oss-sec/2026/q2/332

                    PS. I'm not dunking on Rust. It's just that... starting over from scratch has its hidden costs.

                    klausman@mas.toK This user is from outside of this forum
                    klausman@mas.toK This user is from outside of this forum
                    klausman@mas.to
                    wrote sidst redigeret af
                    #27

                    @lcamtuf There's also that human habit of getting complacent about all bugs when _some_ types of bugs are either impossible or very very hard to make because of language structure and tooling.

                    orb2069@mastodon.onlineO 1 Reply Last reply
                    0
                    • lcamtuf@infosec.exchangeL lcamtuf@infosec.exchange

                      The coreutils Rust rewrite story is pretty funny.

                      Coreutils are tools like rm, mv, mkdir, etc. Unlike binutils, this isn't a fertile ground for memory safety bugs. But, the rewrite was completed, and in the spirit of progress, Canonical decided to switch.

                      But do you know what coreutils are a fertile ground for? Race conditions around file creation, deletion, permission setting, and so on. The original code accounted for decades of hard-learned lessons in that space. The Rust rewrite did not:

                      https://seclists.org/oss-sec/2026/q2/332

                      PS. I'm not dunking on Rust. It's just that... starting over from scratch has its hidden costs.

                      groxx@hachyderm.ioG This user is from outside of this forum
                      groxx@hachyderm.ioG This user is from outside of this forum
                      groxx@hachyderm.io
                      wrote sidst redigeret af
                      #28

                      @lcamtuf a related observation would probably be: why did important, security-critical edge cases get handled without enough documentation to prevent them from reoccurring?

                      orb2069@mastodon.onlineO fivetonsflax@tilde.zoneF 2 Replies Last reply
                      0
                      • lcamtuf@infosec.exchangeL lcamtuf@infosec.exchange

                        The coreutils Rust rewrite story is pretty funny.

                        Coreutils are tools like rm, mv, mkdir, etc. Unlike binutils, this isn't a fertile ground for memory safety bugs. But, the rewrite was completed, and in the spirit of progress, Canonical decided to switch.

                        But do you know what coreutils are a fertile ground for? Race conditions around file creation, deletion, permission setting, and so on. The original code accounted for decades of hard-learned lessons in that space. The Rust rewrite did not:

                        https://seclists.org/oss-sec/2026/q2/332

                        PS. I'm not dunking on Rust. It's just that... starting over from scratch has its hidden costs.

                        arcaik@hachyderm.ioA This user is from outside of this forum
                        arcaik@hachyderm.ioA This user is from outside of this forum
                        arcaik@hachyderm.io
                        wrote sidst redigeret af
                        #29

                        @lcamtuf Why do we keep calling uutils coreutils a rewrite?

                        1 Reply Last reply
                        0
                        • rmq@toot.ioR rmq@toot.io

                          @synlogic4242 Uutils started as someone’s personal project to learn rust, and “write a system utility” is frequently used as a basic exercise for learning. Uutils is doing exactly what it set out to do.

                          It’s not the fault of uutils that Canonical is dumb.

                          @lcamtuf

                          synlogic4242@social.vivaldi.netS This user is from outside of this forum
                          synlogic4242@social.vivaldi.netS This user is from outside of this forum
                          synlogic4242@social.vivaldi.net
                          wrote sidst redigeret af
                          #30

                          @rmq @lcamtuf I view it as both their fault. I'm pissed that after having to deal with Copy.Fail I now have to wipe other people's butts again for them. and I worry this will happen with more frequency as more vibe-coded software spreads around

                          1 Reply Last reply
                          0
                          • lcamtuf@infosec.exchangeL lcamtuf@infosec.exchange

                            The coreutils Rust rewrite story is pretty funny.

                            Coreutils are tools like rm, mv, mkdir, etc. Unlike binutils, this isn't a fertile ground for memory safety bugs. But, the rewrite was completed, and in the spirit of progress, Canonical decided to switch.

                            But do you know what coreutils are a fertile ground for? Race conditions around file creation, deletion, permission setting, and so on. The original code accounted for decades of hard-learned lessons in that space. The Rust rewrite did not:

                            https://seclists.org/oss-sec/2026/q2/332

                            PS. I'm not dunking on Rust. It's just that... starting over from scratch has its hidden costs.

                            E This user is from outside of this forum
                            E This user is from outside of this forum
                            equity7804@hostux.social
                            wrote sidst redigeret af
                            #31

                            @lcamtuf Hey, would you care to elaborate or point me to resources explaining why the coreutils aren't fertile ground for memory safety issues? It's the first time I heard of this

                            not2b@sfba.socialN 1 Reply Last reply
                            0
                            • lcamtuf@infosec.exchangeL lcamtuf@infosec.exchange

                              The coreutils Rust rewrite story is pretty funny.

                              Coreutils are tools like rm, mv, mkdir, etc. Unlike binutils, this isn't a fertile ground for memory safety bugs. But, the rewrite was completed, and in the spirit of progress, Canonical decided to switch.

                              But do you know what coreutils are a fertile ground for? Race conditions around file creation, deletion, permission setting, and so on. The original code accounted for decades of hard-learned lessons in that space. The Rust rewrite did not:

                              https://seclists.org/oss-sec/2026/q2/332

                              PS. I'm not dunking on Rust. It's just that... starting over from scratch has its hidden costs.

                              sten@chaos.socialS This user is from outside of this forum
                              sten@chaos.socialS This user is from outside of this forum
                              sten@chaos.social
                              wrote sidst redigeret af
                              #32

                              @lcamtuf Not only that, some of the utils were not command line-compatible with their non-Rust counterparts.

                              Honestly, I don't understand why these utils were rewritten. They didn't need rewriting.

                              m33@mastodon.socialM oblomov@sociale.networkO 2 Replies Last reply
                              0
                              • darkuncle@infosec.exchangeD darkuncle@infosec.exchange

                                @ChuckMcManis @lcamtuf sometimes that's the only way to learn, but it's also often the most effective way to learn

                                sten@chaos.socialS This user is from outside of this forum
                                sten@chaos.socialS This user is from outside of this forum
                                sten@chaos.social
                                wrote sidst redigeret af
                                #33

                                @darkuncle @ChuckMcManis @lcamtuf Sure, but perhaps don't do your learning in production? 🙂

                                darkuncle@infosec.exchangeD m33@mastodon.socialM raven667@hachyderm.ioR wolf480pl@mstdn.ioW lispi314@udongein.xyzL 5 Replies Last reply
                                0
                                • synlogic4242@social.vivaldi.netS synlogic4242@social.vivaldi.net

                                  @hyc @lcamtuf ie. be like LEGO not Death Stars

                                  wonka@chaos.socialW This user is from outside of this forum
                                  wonka@chaos.socialW This user is from outside of this forum
                                  wonka@chaos.social
                                  wrote sidst redigeret af
                                  #34

                                  https://www.lego.com/en-us/product/death-star-75419 would like a word. 😇

                                  @synlogic4242 @hyc @lcamtuf

                                  synlogic4242@social.vivaldi.netS 1 Reply Last reply
                                  0
                                  • sten@chaos.socialS sten@chaos.social

                                    @darkuncle @ChuckMcManis @lcamtuf Sure, but perhaps don't do your learning in production? 🙂

                                    darkuncle@infosec.exchangeD This user is from outside of this forum
                                    darkuncle@infosec.exchangeD This user is from outside of this forum
                                    darkuncle@infosec.exchange
                                    wrote sidst redigeret af
                                    #35

                                    @sten @ChuckMcManis @lcamtuf sometimes you have to get burned to learn not to touch the stove 😂

                                    1 Reply Last reply
                                    0
                                    • lcamtuf@infosec.exchangeL lcamtuf@infosec.exchange

                                      The coreutils Rust rewrite story is pretty funny.

                                      Coreutils are tools like rm, mv, mkdir, etc. Unlike binutils, this isn't a fertile ground for memory safety bugs. But, the rewrite was completed, and in the spirit of progress, Canonical decided to switch.

                                      But do you know what coreutils are a fertile ground for? Race conditions around file creation, deletion, permission setting, and so on. The original code accounted for decades of hard-learned lessons in that space. The Rust rewrite did not:

                                      https://seclists.org/oss-sec/2026/q2/332

                                      PS. I'm not dunking on Rust. It's just that... starting over from scratch has its hidden costs.

                                      inguin@nerdculture.deI This user is from outside of this forum
                                      inguin@nerdculture.deI This user is from outside of this forum
                                      inguin@nerdculture.de
                                      wrote sidst redigeret af
                                      #36

                                      @lcamtuf
                                      Many of those seemingly trivial utilities are surprisingly complex: sort runs in multiple concurrent threads, "cp -a" must build a lookup table to detect hardlinks, and ps parses obscure files in /proc. There's plenty of ways to screw up that a type- and memory-safe language would catch.

                                      That said, the list of CVEs in the post is really impressive. Ditching the good old GNU coreutils might have been a tad overhasty.

                                      1 Reply Last reply
                                      0
                                      • wonka@chaos.socialW wonka@chaos.social

                                        https://www.lego.com/en-us/product/death-star-75419 would like a word. 😇

                                        @synlogic4242 @hyc @lcamtuf

                                        synlogic4242@social.vivaldi.netS This user is from outside of this forum
                                        synlogic4242@social.vivaldi.netS This user is from outside of this forum
                                        synlogic4242@social.vivaldi.net
                                        wrote sidst redigeret af
                                        #37

                                        @wonka @hyc @lcamtuf TBF if I knew I might have to keep rebuilding my Death Star from scratch every time the Rebellion blew it up for plot reasons I'd much prefer to do it in LEGO

                                        1 Reply Last reply
                                        0
                                        • prozacchiwawa@functional.cafeP prozacchiwawa@functional.cafe

                                          @lcamtuf i do find that the crates dedicated to atomic file handling and temp files, in the interest of providing a uniform platform interface aren't as good as what's reachable in c.

                                          it's not a fault of the rust language per se, but writing a safe interface at that level isn't easy, so it makes sense (and is in some sense a better default) to have high level, platform neutral access here.

                                          L This user is from outside of this forum
                                          L This user is from outside of this forum
                                          lukasz2@social.vivaldi.net
                                          wrote sidst redigeret af
                                          #38

                                          @prozacchiwawa @lcamtuf yeah, but coreutils is an interface for shell languages. The shell doesn't care if underlying "util" was written in C or Rust

                                          1 Reply Last reply
                                          0
                                          Svar
                                          • Svar som emne
                                          Login for at svare
                                          • Ældste til nyeste
                                          • Nyeste til ældste
                                          • Most Votes


                                          • Log ind

                                          • Har du ikke en konto? Tilmeld

                                          • Login or register to search.
                                          Powered by NodeBB Contributors
                                          Graciously hosted by data.coop
                                          • First post
                                            Last post
                                          0
                                          • Hjem
                                          • Seneste
                                          • Etiketter
                                          • Populære
                                          • Verden
                                          • Bruger
                                          • Grupper