Rust Programming Language To Land in Linux Kernel 6.1

Tux the penguin peeks out from behind a rusty chain
(Image credit: Miguel Á. Padriñán)

In a recent post on the Linux Kernel Mailing List, Linus Torvalds promised “a number of fairly core new things” in Linux kernel 6.1, and the first one seems to have appeared: as reported by The Register, the Rust programming language will be directly supported in the OS.

The Rust logo

(Image credit: Rust Foundation)
Latest Videos FromTom's Hardware
Ian Evenden
Freelance News Writer

Ian Evenden is a UK-based news writer for Tom’s Hardware US. He’ll write about anything, but stories about Raspberry Pi and DIY robots seem to find their way to him.

  • RichardtST
    As a long-time kernel developer and hacker I can tell you without any shadow of a doubt that Rust is being added to create more attack surface. Gotta have those back doors. No better place than someplace "safe". Seriously, have you looked at real Rust code? Absolutely the antithesis of the "KISS PRINCIPLE". This is bad news for linux.
    Reply
  • Kamen Rider Blade
    Why did Linus approve of integrating RUST inco the Linux Kernal?

    Can anybody tell me why?

    I'm perfectly fine with C/C++ as the main languages for the Linux Kernal

    I know RUST is a C/C++ relative, but it's like that weird cousin.

    Has RUST been tested properly for security issues?
    Reply
  • coolitic
    Kamen Rider Blade said:
    Why did Linus approve of integrating RUST inco the Linux Kernal?

    Can anybody tell me why?

    I'm perfectly fine with C/C++ as the main languages for the Linux Kernal

    I know RUST is a C/C++ relative, but it's like that weird cousin.

    Has RUST been tested properly for security issues?
    C++ is not used in the kernel, because it's unnecessarily complex and ambiguous.
    Reply
  • It C for kernel and I would like it to STAY that way
    Reply
  • bit_user
    RichardtST said:
    As a long-time kernel developer and hacker I can tell you without any shadow of a doubt that Rust is being added to create more attack surface. Gotta have those back doors. No better place than someplace "safe". Seriously, have you looked at real Rust code? Absolutely the antithesis of the "KISS PRINCIPLE". This is bad news for linux.
    Interesting take. In all the discussion and debate I've read about this on Linux-focused forums, I've not seen such claims.

    I trust this work wasn't undertaken lightly. It's been under way for several years. Right now, it's just limited to device drivers. If it turns out to be as big a liability as you claim, I'm sure it'll be addressed or removed.
    Reply
  • bit_user
    Kamen Rider Blade said:
    I'm perfectly fine with C/C++ as the main languages for the Linux Kernal
    There was never any C++. Linus is famously opposed to it. Until earlier this year, the kernel was C89 (with GNU extensions). They recently upped it to C11 (with GNU extensions). The Rust support is limited to a very small portion of it, for now.

    Kamen Rider Blade said:
    Has RUST been tested properly for security issues?
    Safety & security are its main selling points. If you're interested, I'd encourage you to read up on it.
    Reply
  • bit_user
    coolitic said:
    C++ is not used in the kernel, because it's unnecessarily complex and ambiguous.
    There were objections to it, but I think that doesn't do them justice. Suffice to say that C++ has had a long history, and it still has some reputational damage from its earlier days. I think that colored the opinions of some kernel developers who didn't personally have much experience with it.

    The other thing about C++ is that it's been fairly polarizing. Those who still use pure C have likely made a conscious choice to resist C++, making it a harder sell for getting them to adopt it. Anyway, it's a moot point (for the Linux kernel, anyway). It looks like they successfully fended off C++ and its evolutionary path will now potentially be a Rusty one.

    What I take issue with is characterizing C++ as "ambiguous", though I'd have to agree that it has a lot of complexity (or richness, as some may choose to characterize it).
    Reply
  • bit_user
    Mandark said:
    It C for kernel and I would like it to STAY that way
    Right, because the world learned nothing about writing software since the 1970's!
    ;)

    It's pretty rare, in this industry, to see people advocate for sticking with technology that's literally 50 years old. It dates back to a time when most software was written on punch cards and most "mini-computers" (which were typically refrigerator-sized) had at most a couple MB of RAM and ran at a couple MHz or less.
    Reply
  • capodistria
    Kamen Rider Blade said:
    Why did Linus approve of integrating RUST into the Linux Kernal?

    Can anybody tell me why?

    I'm perfectly fine with C/C++ as the main languages for the Linux Kernal

    I know RUST is a C/C++ relative, but it's like that weird cousin.

    Has RUST been tested properly for security issues?
    War in Ukraine (why?)
    The threat of a 3rd world war (why?)
    Nuclear war threat (why?)
    The RUST threat (why?)
    ...The answer to your question (why?) is that there is no answer.
    Reply
  • bit_user
    capodistria said:
    The RUST threat (why?)The answer to your question (why?) is that there is no answer.
    I think the reason some people feel threatened by Rust is simply resistance to change. Linux has used C for the past 30+ years, so why change it now? There's always a risk involved in any change. If you're happy with Linux as it is, then you probably don't feel you have much to gain by it. That could make the prospect of change seem scary to some.

    What the Rust advocates claim (and don't get me wrong, I'm not a Rust user, but here's their argument, as I understand it):
    Fewer bugs - Rust has memory safety features not found in C.
    Fewer security exploits - along with the memory safety, Rust also has security features as core parts of the language.
    Improved productivity - being more modern & expressive, you can do more with fewer lines of code.
    Larger talent pool - C is a rather primitive language that fewer programmers want to work in, these days.
    Somewhere in there ought to be room for performance improvements, as well. The Linux kernel has lots of algorithms and data structures, many of which weren't terribly efficient or haven't scaled well. Using a safer language that's easier to work within should (eventually) facilitate improving lots of aspects in the kernel that might've either seemed to risky or too much effort to tackle, previously.
    Reply