Wedson Almeida Filho is a Microsoft engineer who has been prolific in his contributions to the Rust for the Linux kernel code over the past several years. Wedson has worked on many Rust Linux kernel features and even did a experimental EXT2 file-system driver port to Rust. But he’s had enough and is now stepping away from the Rust for Linux efforts.

From Wedon’s post on the kernel mailing list:

I am retiring from the project. After almost 4 years, I find myself lacking the energy and enthusiasm I once had to respond to some of the nontechnical nonsense, so it’s best to leave it up to those who still have it in them.

I truly believe the future of kernels is with memory-safe languages. I am no visionary but if Linux doesn’t internalize this, I’m afraid some other kernel will do to it what it did to Unix.

Lastly, I’ll leave a small, 3min 30s, sample for context here: https://youtu.be/WiPp9YEBV0Q?t=1529 – and to reiterate, no one is trying force anyone else to learn Rust nor prevent refactorings of C code."

  • youmaynotknow@lemmy.ml
    link
    fedilink
    arrow-up
    109
    arrow-down
    2
    ·
    3 months ago

    Ted Ts’o is a prick with a god complex. I understand his experience is hard to match, we all have something in our lives we’re that good at, but that does not need to lead to acting like a fucking religious fanatic.

    • pivot_root@lemmy.world
      link
      fedilink
      arrow-up
      144
      arrow-down
      4
      ·
      edit-2
      3 months ago

      I understand his experience is hard to match, we all have something in our lives we’re that good at

      At some point, that mix of experience and ego becomes a significant liability. He’s directly hurting the adoption of Rust in the kernel, while the C code he’s responsible for is full of problems that would have been impossible if written in safe Rust.

      CVE-2024-42304 — crash from undocumented function parameter invariants
      CVE-2024-40955 — out of bounds read
      CVE-2024-0775 — use-after-free
      CVE-2023-2513 — use-after-free
      CVE-2023-1252 — use-after-free
      CVE-2022-1184 — use-after-free
      CVE-2020-14314 — out of bounds read
      CVE-2019-19447 — use-after-free
      CVE-2018-10879 — use-after-free
      CVE-2018-10878 — out of bounds write
      CVE-2018-10881 — out of bounds read
      CVE-2015-8324 — null pointer dereference
      CVE-2014-8086 — race condition
      CVE-2011-2493 — call function pointer in uninitialized struct
      CVE-2009-0748 — null pointer dereference

      • Flipper@feddit.org
        link
        fedilink
        arrow-up
        30
        ·
        3 months ago

        crash from undocumented function parameter invariants

        My favourite, as that was the exact point the dev was making in his talk, that the stuff is badly documented and that the function signature would document it perfectly.

        • WarmApplePieShrek@lemmy.dbzer0.com
          link
          fedilink
          English
          arrow-up
          2
          arrow-down
          5
          ·
          edit-2
          3 months ago

          My favorite, as that is the exact point made by anti-rust people.

          What kind of type signature would prove the first block of any directory in an ext4 filesystem image isn’t a hole?

          • pivot_root@lemmy.world
            link
            fedilink
            arrow-up
            14
            arrow-down
            1
            ·
            3 months ago

            The first directory block is a hole. But type == DIRENT, so no error is reported. After that, we get a directory block without ‘.’ and ‘…’ but with a valid dentry. This may cause some code that relies on dot or dotdot (such as make_indexed_dir()) to crash

            The problem isn’t that the block is a hole. It’s that the downstream function expects the directory block to contain . and .., and it gets given one without because of incorrect error handling.

            You can encode the invariant of “has dot and dot dot” using a refinement type and smart constructor. The refined type would be a directory block with a guarantee it meets that invariant, and an instance of it could only be created through a function that validates the invariant. If the invariant is met, you get the refined type. If it isn’t, you only get an error.

            This doesn’t work in C, but in languages with stricter type systems, refinement types are a huge advantage.

              • pivot_root@lemmy.world
                link
                fedilink
                arrow-up
                3
                ·
                edit-2
                3 months ago

                If it were poorly designed and used exceptions, yes. The correct way to design smart constructors is to not actually use a constructor directly but instead use a static method that forces the caller to handle both cases (or explicitly ignore the failure case). The static method would have a return type that either indicates “success and here’s the refined type” or “error and this is why.”

                In Rust terminology, that would be a Result<T, Error>.

                For Go, it would be (*RefinedType, error) (where dereferencing the first value without checking it would be at your own peril).

                C++ would look similar to Rust, but it doesn’t come as part of the standard library last I checked.

                C doesn’t have the language-level features to be able to do this. You can’t make a refined type that’s accessible as a type while also making it impossible to construct arbitrarily.

                  • pivot_root@lemmy.world
                    link
                    fedilink
                    arrow-up
                    1
                    ·
                    edit-2
                    3 months ago

                    You’re going to need to cite that.

                    I’m not familiar with C23 or many of the compiler-specific extensions, but in all the previous versions I worked with, there is no type visibility other than “fully exposed” or opaque and dangerous (void*).

                    You could try wrapping your Foo in

                    typedef struct {
                        Foo validated
                    } ValidFoo;
                    

                    But nothing stops someone from being an idiot about it and constructing it by hand:

                    ValidFoo trustMeBro;
                    trustMeBro.validated = someFoo;
                    otherFunction(trustMeBro);
                    

                    Or even just casting it.

                    Foo* someFoo;
                    otherFunction((ValidFoo*) someFoo);
                    
          • Preston Maness ☭@lemmygrad.ml
            link
            fedilink
            English
            arrow-up
            3
            ·
            3 months ago

            What kind of type signature would prove the first block of any directory in an ext4 filesystem image isn’t a hole?

            I don’t know if the type system proves it’s not a hole, but the type system certainly seems to force consumers to contend with the possibility by surfacing the outcomes at the type system level. That’s what the Either is doing in the example’s return type, is it not?

            fn get_or_create_inode(
                &self,
                ino: Ino
            ) -> Result<Either<ARef<Inode<T>>, inode::New<T>>>
            
    • IAmNotACat@lemmy.world
      link
      fedilink
      arrow-up
      38
      arrow-down
      2
      ·
      3 months ago

      Agreed. His experience might be useful if he were there to engage, but he’s clearly not. It seems like he just wanted to shout down the project and it seems like he was somewhat successful.

    • qqq@lemmy.world
      link
      fedilink
      arrow-up
      38
      arrow-down
      9
      ·
      edit-2
      3 months ago

      No intention of validating that behavior, it’s uncalled for and childish, but I think there is another bit of “nontechnical nonsense” on the opposite side of this silly religious war: the RIIR crowd. Longstanding C projects (sometimes even projects written in dynamic languages…?) get people that know very little about the project, or at least have never contributed, asking for it to be rewritten or refactored in Rust, and that’s likely just as tiring as the defensive C people when you want to include Rust in the kernel.

      People need to chill out on both sides of this weird religious war. A programming language is just a tool: its merits in a given situation should be discussed logically.

      • JackbyDev@programming.dev
        link
        fedilink
        English
        arrow-up
        12
        arrow-down
        1
        ·
        3 months ago

        I imagine this mentality is frustrating because of how many times they have to explain that they weren’t forcing people to learn Rust and that the Rust bindings were second class citizens. They never said to rewrite the kernel in Rust.

        • wewbull@feddit.uk
          link
          fedilink
          English
          arrow-up
          12
          arrow-down
          9
          ·
          3 months ago

          That’s disengenuous though.

          • We’re not forcing you to learn rust. We’ll just place code in your security critical project in a language you don’t know.

          • Rust is a second class citizen, but we feel rust is the superior language and all code should eventually benefit from it’s memory safety.

          • We’re not suggesting that code needs to be rewritten in rust, but the Linux kernel development must internalise the need for memory safe languages.

          No other language community does what the rust community does. Haskellers don’t go to the Emacs project and say “We’d like to write Emacs modules, but we think Haskell is a much nicer and safer functional language than Lisp, so how about we add the capability of using Haskell and Lisp?”. Pythonistas didn’t add Python support to Rails along side Ruby.

          Rusties seem to want to convert everyone by Trojan horsing their way into communities. It’s extremely damaging, both to those communities and to rust itself.

          • CancerMancer@sh.itjust.works
            link
            fedilink
            arrow-up
            4
            arrow-down
            1
            ·
            3 months ago

            It doesn’t help that the Rust community tends to bring extremely divisive politics with it in places and ways that just don’t need to happen, starting battles that aren’t even tangentially related to programming.

      • youmaynotknow@lemmy.ml
        link
        fedilink
        arrow-up
        24
        ·
        3 months ago

        He’s the guy you hear vexing rust in the video posted. While both languages have their pros and cons, he chooses to just blast this other guy by repeating the same crap over and over without letting him reply. Basically the kind of person with a “I win because I’m louder” demeanor.