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 242 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.

    kgf@hachyderm.ioK This user is from outside of this forum
    kgf@hachyderm.ioK This user is from outside of this forum
    kgf@hachyderm.io
    wrote sidst redigeret af
    #48

    @lcamtuf I don't take this as a dunk on Rust, I take it as a (well-deserved) dunk on repositories that accept PRs that vibe-coded entire features that clearly no one understood. Which adds even more hidden costs.

    1 Reply Last reply
    0
    • m33@mastodon.socialM m33@mastodon.social

      @sten @darkuncle @ChuckMcManis @lcamtuf is it really production if it's not on my machine ?

      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
      #49

      @m33 @darkuncle @ChuckMcManis @lcamtuf An excellent point that I have to admit I hadn't considered.

      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.

        rdp@notpickard.comR This user is from outside of this forum
        rdp@notpickard.comR This user is from outside of this forum
        rdp@notpickard.com
        wrote sidst redigeret af
        #50

        @lcamtuf coming in at #1 with a bullet on the Joel On Software 'things you never do' list

        (know its common wisdom, but think Joel articulates it very well)

        https://www.joelonsoftware.com/2000/04/06/things-you-should-never-do-part-i/

        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.

          brandnewmath@mstdn.socialB This user is from outside of this forum
          brandnewmath@mstdn.socialB This user is from outside of this forum
          brandnewmath@mstdn.social
          wrote sidst redigeret af
          #51

          @lcamtuf I always looked at this project as a sort of hobby, a learning exercise, maybe just a lark, or a "maybe one day we'll have a useful alternative"...and then Canonical went and adopted it before anyone could reasonably believe it was of production quality

          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.

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

            @lcamtuf

            It’s frustrating that POSIX took decades to get APIs that weren’t intrinsically racy, but then higher-level languages that post dated the improved ones implemented equivalents of the old racy APIs. C++ was annoying, they waited until pretty much every platform that supported C++ and had a filesystem implemented the newer APIs and then standardised the filesystem TS with racy ones. I believe Rust is similar, but at least it has cap-std which implements the non-racy versions as an alternative standard library.

            tris@chaos.socialT icing@chaos.socialI 2 Replies Last reply
            0
            • benh@mastodon.scotB benh@mastodon.scot

              @lcamtuf

              https://www.joelonsoftware.com/2000/04/06/things-you-should-never-do-part-i/

              cmdrmoto@hachyderm.ioC This user is from outside of this forum
              cmdrmoto@hachyderm.ioC This user is from outside of this forum
              cmdrmoto@hachyderm.io
              wrote sidst redigeret af
              #53

              @benh @lcamtuf Wow. Kudos to Joel, it’s 26 years later and I still remember reading this article when it was fresh.

              slash909uk@mastodon.me.ukS 1 Reply Last reply
              0
              • hypha@cafe.mycelium.locahlo.stH hypha@cafe.mycelium.locahlo.st

                @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 This user is from outside of this forum
                star@fed.amazonawaws.comS This user is from outside of this forum
                star@fed.amazonawaws.com
                wrote sidst redigeret af
                #54
                @hypha @xerz @lcamtuf tbf i think the framing that "they shouldn't have" is wrong and bad. *canonical* should not have switched, because that is such a bad idea
                xerz@soc.masfloss.netX 1 Reply Last reply
                0
                • star@fed.amazonawaws.comS star@fed.amazonawaws.com
                  @hypha @xerz @lcamtuf tbf i think the framing that "they shouldn't have" is wrong and bad. *canonical* should not have switched, because that is such a bad idea
                  xerz@soc.masfloss.netX This user is from outside of this forum
                  xerz@soc.masfloss.netX This user is from outside of this forum
                  xerz@soc.masfloss.net
                  wrote sidst redigeret af
                  #55

                  @star @hypha @lcamtuf yeah, the audits should have come first, not the other way around

                  all they did was give them free patches, so uh... yet another Rust advantage? ​

                  lispi314@udongein.xyzL 1 Reply Last reply
                  0
                  • sten@chaos.socialS sten@chaos.social

                    @oblomov @lcamtuf Wow. Are there any documents that say this that I can get my hands on?

                    oblomov@sociale.networkO This user is from outside of this forum
                    oblomov@sociale.networkO This user is from outside of this forum
                    oblomov@sociale.network
                    wrote sidst redigeret af
                    #56

                    @sten @lcamtuf sorry, it's been literally years since the last time I cared enough about this, so I don't have the links at hand. From what I remember, the dev(s) that got the project started claimed to not care about the license and that they would consider relicensing if the community showed an interest, but shot down all proposals to switch to GPL with no discussion.

                    Officially t's explicitly NOT about that:

                    https://uutils.github.io/

                    «It is not primarily […] about license debates.»

                    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.

                      raven667@hachyderm.ioR This user is from outside of this forum
                      raven667@hachyderm.ioR This user is from outside of this forum
                      raven667@hachyderm.io
                      wrote sidst redigeret af
                      #57

                      @lcamtuf It's even sillier because the Rust rewrite was just someones hobby project to learn Rust, it wasn't engineered from the start to be the "Canonical" implementation, so picking it off the Internet and shoving it into Ubuntu is an engineering decision that the professional Ubuntu engineers should be accountable for, not the original developer who just shared their work with the world.

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

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

                        raven667@hachyderm.ioR This user is from outside of this forum
                        raven667@hachyderm.ioR This user is from outside of this forum
                        raven667@hachyderm.io
                        wrote sidst redigeret af
                        #58

                        @sten @darkuncle The old joke that _everyone_ has a testing environment, some are fortunate enough to have a separate Production environment 🙂

                        sqlallfather@techhub.socialS 1 Reply Last reply
                        0
                        • miss_rodent@girlcock.clubM miss_rodent@girlcock.club

                          @lcamtuf Yeah, but they got to license-wash the coreutils, the gnu coreutils are GPL3, the rust uutils use the much more corporate-overlord and user-abuse friendly MIT license.

                          grumpybozo@toad.socialG This user is from outside of this forum
                          grumpybozo@toad.socialG This user is from outside of this forum
                          grumpybozo@toad.social
                          wrote sidst redigeret af
                          #59

                          @miss_rodent @lcamtuf If that was all they wanted, the BSD toolset is just sitting there….

                          miss_rodent@girlcock.clubM 1 Reply Last reply
                          0
                          • hyc@mastodon.socialH hyc@mastodon.social

                            @lcamtuf See this all the time - people storm in trying to change things before trying to understand how the current things work. People who don't learn from what's been done before. Society doesn't progress from efforts like theirs. You only make progress by learning from and building on top of what came before.

                            kajord@hachyderm.ioK This user is from outside of this forum
                            kajord@hachyderm.ioK This user is from outside of this forum
                            kajord@hachyderm.io
                            wrote sidst redigeret af
                            #60

                            @hyc @lcamtuf this wasn't even storming in, this was a hobby project started in 2013 that was adopted for Ubuntu in 2025. I fault Canonical for that decision more than the project here.

                            hyc@mastodon.socialH 1 Reply Last reply
                            0
                            • grumpybozo@toad.socialG grumpybozo@toad.social

                              @miss_rodent @lcamtuf If that was all they wanted, the BSD toolset is just sitting there….

                              miss_rodent@girlcock.clubM This user is from outside of this forum
                              miss_rodent@girlcock.clubM This user is from outside of this forum
                              miss_rodent@girlcock.club
                              wrote sidst redigeret af
                              #61

                              @grumpybozo @lcamtuf afaik the BSD core utils aren't entirely compatible with the gnu core utils, still?
                              But yeah, there are more permissively licensed versions of the *nix coreutils already; rust uutils is aiming to be a drop-in replacement for the gnu coreutils specifically, though, which means all the gnu-specific extensions and peculiarities. Which, previously, were basically only under the gpl (and some scripts and such can break if you don't have those, so, it's a meaningful difference.)

                              grumpybozo@toad.socialG 1 Reply Last reply
                              0
                              • miss_rodent@girlcock.clubM miss_rodent@girlcock.club

                                @grumpybozo @lcamtuf afaik the BSD core utils aren't entirely compatible with the gnu core utils, still?
                                But yeah, there are more permissively licensed versions of the *nix coreutils already; rust uutils is aiming to be a drop-in replacement for the gnu coreutils specifically, though, which means all the gnu-specific extensions and peculiarities. Which, previously, were basically only under the gpl (and some scripts and such can break if you don't have those, so, it's a meaningful difference.)

                                grumpybozo@toad.socialG This user is from outside of this forum
                                grumpybozo@toad.socialG This user is from outside of this forum
                                grumpybozo@toad.social
                                wrote sidst redigeret af
                                #62

                                @miss_rodent @lcamtuf Right, there are some variances in command line options, usually in areas not covered by POSIX.

                                1 Reply Last reply
                                0
                                • kajord@hachyderm.ioK kajord@hachyderm.io

                                  @hyc @lcamtuf this wasn't even storming in, this was a hobby project started in 2013 that was adopted for Ubuntu in 2025. I fault Canonical for that decision more than the project here.

                                  hyc@mastodon.socialH This user is from outside of this forum
                                  hyc@mastodon.socialH This user is from outside of this forum
                                  hyc@mastodon.social
                                  wrote sidst redigeret af
                                  #63

                                  @kajord @lcamtuf sure, it's Canonical's fault for deciding to deploy to production. And it's still a fault in the developers, for failing to understand why the original programs were written the way they were.

                                  1 Reply Last reply
                                  0
                                  • darkuncle@infosec.exchangeD darkuncle@infosec.exchange

                                    @lcamtuf very much a Chesterton's Fence kind of situation

                                    nicksilkey@hachyderm.ioN This user is from outside of this forum
                                    nicksilkey@hachyderm.ioN This user is from outside of this forum
                                    nicksilkey@hachyderm.io
                                    wrote sidst redigeret af
                                    #64

                                    @darkuncle tysm for pointing me to this amazing parable, amigos. ✌️💙

                                    https://fs.blog/chestertons-fence/

                                    1 Reply Last reply
                                    0
                                    • david_chisnall@infosec.exchangeD david_chisnall@infosec.exchange

                                      @lcamtuf

                                      It’s frustrating that POSIX took decades to get APIs that weren’t intrinsically racy, but then higher-level languages that post dated the improved ones implemented equivalents of the old racy APIs. C++ was annoying, they waited until pretty much every platform that supported C++ and had a filesystem implemented the newer APIs and then standardised the filesystem TS with racy ones. I believe Rust is similar, but at least it has cap-std which implements the non-racy versions as an alternative standard library.

                                      tris@chaos.socialT This user is from outside of this forum
                                      tris@chaos.socialT This user is from outside of this forum
                                      tris@chaos.social
                                      wrote sidst redigeret af
                                      #65

                                      @david_chisnall @lcamtuf Well people have opinions: https://mastodon.social/@pid_eins/116459585811044061 😛

                                      Btw also https://chaos.social/@tris/116453545444380978

                                      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.

                                        ryanc@infosec.exchangeR This user is from outside of this forum
                                        ryanc@infosec.exchangeR This user is from outside of this forum
                                        ryanc@infosec.exchange
                                        wrote sidst redigeret af
                                        #66

                                        @lcamtuf Amusingly, I recently did some work in Rust and wanted safe file operations that avoided race conditions. I couldn't find anything good and wrote my own opinionated helper.

                                        Though, a large part of it is that O_TMPFILE is awesome and underused.

                                        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.

                                          lanodan@queer.hacktivis.meL This user is from outside of this forum
                                          lanodan@queer.hacktivis.meL This user is from outside of this forum
                                          lanodan@queer.hacktivis.me
                                          wrote sidst redigeret af
                                          #67

                                          @lcamtuf@infosec.exchange Also quite few are noticeably fails in implementing POSIX, which makes me wonder if they’re only caring about coreutils testsuite and --help/help2man output.

                                          Like CVE-2026-35367 (nohup(1) permissions) as Colin Funk noted, but also CVE-2026-35369 (kill -1), CVE-2026-35370 & CVE-2026-35371 (real vs. effective in id(1)), and CVE-2026-35379 (wrong character classes in tr(1))

                                          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