Skip to content
  • Kategorien
  • Aktuell
  • Tags
  • Beliebt
  • World
  • Benutzer
  • Gruppen
Skins
  • Light
  • 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

  • Standard: (Kein Skin)
  • Kein Skin
Einklappen

other.li Forum

  1. Übersicht
  2. Uncategorized
  3. The coreutils Rust rewrite story is pretty funny.

The coreutils Rust rewrite story is pretty funny.

Geplant Angeheftet Gesperrt Verschoben Uncategorized
77 Beiträge 51 Kommentatoren 0 Aufrufe
  • Älteste zuerst
  • Neuste zuerst
  • Meiste Stimmen
Antworten
  • In einem neuen Thema antworten
Anmelden zum Antworten
Dieses Thema wurde gelöscht. Nur Nutzer mit entsprechenden Rechten können es sehen.
  • 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.

    ? Offline
    ? Offline
    Gast
    schrieb zuletzt editiert von
    #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 Antwort Letzte Antwort
    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.

      ? Offline
      ? Offline
      Gast
      schrieb zuletzt editiert von
      #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.

      ? ? 2 Antworten Letzte Antwort
      0
      • ? Gast

        @lcamtuf

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

        ? Offline
        ? Offline
        Gast
        schrieb zuletzt editiert von
        #53

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

        1 Antwort Letzte Antwort
        0
        • ? Gast

          @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

          ? Offline
          ? Offline
          Gast
          schrieb zuletzt editiert von
          #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
          ? 1 Antwort Letzte Antwort
          0
          • ? Gast
            @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
            ? Offline
            ? Offline
            Gast
            schrieb zuletzt editiert von
            #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? ​

            1 Antwort Letzte Antwort
            0
            • ? Gast

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

              ? Offline
              ? Offline
              Gast
              schrieb zuletzt editiert von
              #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 Antwort Letzte Antwort
              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.

                ? Offline
                ? Offline
                Gast
                schrieb zuletzt editiert von
                #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 Antwort Letzte Antwort
                0
                • ? Gast

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

                  ? Offline
                  ? Offline
                  Gast
                  schrieb zuletzt editiert von
                  #58

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

                  1 Antwort Letzte Antwort
                  0
                  • ? Gast

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

                    ? Offline
                    ? Offline
                    Gast
                    schrieb zuletzt editiert von
                    #59

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

                    ? 1 Antwort Letzte Antwort
                    0
                    • ? Gast

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

                      ? Offline
                      ? Offline
                      Gast
                      schrieb zuletzt editiert von
                      #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.

                      ? 1 Antwort Letzte Antwort
                      0
                      • ? Gast

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

                        ? Offline
                        ? Offline
                        Gast
                        schrieb zuletzt editiert von
                        #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.)

                        ? 1 Antwort Letzte Antwort
                        0
                        • ? Gast

                          @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.)

                          ? Offline
                          ? Offline
                          Gast
                          schrieb zuletzt editiert von
                          #62

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

                          1 Antwort Letzte Antwort
                          0
                          • ? Gast

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

                            ? Offline
                            ? Offline
                            Gast
                            schrieb zuletzt editiert von
                            #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 Antwort Letzte Antwort
                            0
                            • ? Gast

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

                              ? Offline
                              ? Offline
                              Gast
                              schrieb zuletzt editiert von
                              #64

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

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

                              1 Antwort Letzte Antwort
                              0
                              • ? Gast

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

                                ? Offline
                                ? Offline
                                Gast
                                schrieb zuletzt editiert von
                                #65

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

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

                                1 Antwort Letzte Antwort
                                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.

                                  ? Offline
                                  ? Offline
                                  Gast
                                  schrieb zuletzt editiert von
                                  #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 Antwort Letzte Antwort
                                  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.

                                    ? Offline
                                    ? Offline
                                    Gast
                                    schrieb zuletzt editiert von
                                    #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 Antwort Letzte Antwort
                                    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.

                                      ? Offline
                                      ? Offline
                                      Gast
                                      schrieb zuletzt editiert von
                                      #68

                                      @lcamtuf I've heard a lot of funny stories like this in previous years. Like for example a startup trying to rewrite the TCP stack by their own from scratch because they can do it more efficient.
                                      Soon they learned how a real environment, or better said, the real life really is.

                                      1 Antwort Letzte Antwort
                                      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.

                                        ? Offline
                                        ? Offline
                                        Gast
                                        schrieb zuletzt editiert von
                                        #69

                                        @lcamtuf yeah it's frustrating because in some sense we all had the opportunity to learn this lesson, a long time ago

                                        we remember when we were kids, after Netscape went bankrupt trying to re-write their software from scratch, there were some good essays analyzing what went wrong and advocating for refactoring instead so as not to lose the knowledge that's in the code

                                        and then there's the ATC system

                                        like... there's so many past instances to learn from

                                        ? 1 Antwort Letzte Antwort
                                        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.

                                          ? Offline
                                          ? Offline
                                          Gast
                                          schrieb zuletzt editiert von
                                          #70

                                          @lcamtuf Dang, that is a wild ride of a thread.

                                          And it kinda lines up with my experiences as well-- coreutils is battle tested and a load bearing feature of Linux.

                                          Uutils is just too new to get all of the behavior exactly the same. I've tested it on my nix machine in the past, and alothough I never pushed uutils quite as far as it could have gone in order to discover any of these bugs, I kind of shudder to think what would have happened if I had.

                                          Very interesting to think that the concept of C isn't exactly bad-- but it just needs a long time to mature and get it right, just like any program. The fact that the Rust compiler prevents you from making memory errors doesn't also prevent you from misunderstanding CPU clocks or buffer overflows or race conditions and other low level stuff.

                                          1 Antwort Letzte Antwort
                                          0
                                          Antworten
                                          • In einem neuen Thema antworten
                                          Anmelden zum Antworten
                                          • Älteste zuerst
                                          • Neuste zuerst
                                          • Meiste Stimmen


                                          • Anmelden

                                          • Anmelden oder registrieren, um zu suchen
                                          • Erster Beitrag
                                            Letzter Beitrag
                                          0
                                          • Kategorien
                                          • Aktuell
                                          • Tags
                                          • Beliebt
                                          • World
                                          • Benutzer
                                          • Gruppen