Announcement

Collapse
No announcement yet.

Initial Support For The Rust Language Lands In Linux-Next

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #21
    Originally posted by CommunityMember View Post

    No one believes that rust will fix all security issues. One can still safely decide to do stupid things (or intentionally damaging things). But rust can, if used appropriately, address one particularly common security issue, which is memory safety, which has been claimed to represent nearly 70% of bugs (which does not represent any specific project accurately, but it is a number worth trying to reduce).
    Microsoft reported it across multiple codebases but Google got the same result by specifically analyzing "912 high or critical severity security bugs since 2015, affecting the Stable channel" for Chrome/Chromium.)

    Comment


    • #22
      Originally posted by ssokolow View Post

      Programmers invented computers, C, and C++. Therefore, it's our collective fault that memory vulnerabilities in C and C++ programs stay at around 70% of CVEs no matter what we try.
      So it needs to be invented by cats and dogs. Woof woof meow.

      Originally posted by bug77 View Post
      Drivers with built-in memory safety? I'll take two, tyvm.
      We'll see how that works out. Maybe they're onto something. Never know what someone might come up with. It would be funny if it became worse in time because of this.
      Last edited by ix900; 19 March 2021, 03:28 PM.

      Comment


      • #23
        Every time I see a thread about Rust on Phoronix, I grab some popcorn and start reading the comments. I was always against adding one more language (any language) at a purely C codebase, because I am worried that some time in the future both languages will be needed to understand the codebase (my worries could be unfounded, but Rust fans will certainly try to rewrite parts of the kernel in Rust). I also hate the toxicity of the Rust community ("Everything new should be written in Rust", they said). I also dislike its syntax but this is just personal taste.

        I hope that either Rust never makes it to the Kernel, or that it is only used in code that is never called by C and does not implement core functionality.

        Comment


        • #24
          Originally posted by marios View Post
          Every time I see a thread about Rust on Phoronix, I grab some popcorn and start reading the comments. I was always against adding one more language (any language) at a purely C codebase, because I am worried that some time in the future both languages will be needed to understand the codebase (my worries could be unfounded, but Rust fans will certainly try to rewrite parts of the kernel in Rust). I also hate the toxicity of the Rust community ("Everything new should be written in Rust", they said). I also dislike its syntax but this is just personal taste.

          I hope that either Rust never makes it to the Kernel, or that it is only used in code that is never called by C and does not implement core functionality.
          Yeah. I like the idea of Rust, but (without knowing much about the kernel) the task of "integrating" it into a large existing project sounds scary. I'd guess there's a risk of having a whole new brand of security holes...

          Comment


          • #25
            I can see Rust maybe being helpful with various userspace facing kernel instrumentations (say, eBPF), but then again, I'm no kernel developer.

            Comment


            • #26
              Bugs, maybe, but security holes? I don't know.
              Using rust and c++ in the same codebase works fine for Firefox.

              Comment


              • #27
                Originally posted by ferry View Post
                Good luck getting Linus to accept code that builds today but not tomorrow into the kernel.
                Linus would accept it even knowing that Rust was absolutely going to be dead in 5 years. Why? Because code is documentation. A working Rust driver is excellent documentation for a C driver developer to work from if Rust disappears, and that is better than nothing. If a driver stops working because some runtime is unsupported then that driver gets dropped. That is happening regularly today with poorly maintained C drivers. It's no different at all.

                What you won't see any time soon is Linus accepting Rust-written core functionality like x86 Platform, MM and Net. Not because Linus is afraid Rust will disappear, but because dividing the competence of the eyeballs on the gonads of the kernel into two language camps is unacceptable.

                Comment


                • #28
                  Originally posted by CommunityMember View Post

                  Rust's existence has not depended on Mozilla for quite some time (although until the creation of the Rust Foundation did use Mozilla's hosting facilities (they layoffs expedited the creation of the foundation which had been previously planned)). While one should not dismiss the importance and value of Mozilla's employees in creating and shepherding rust, rust outgrew Mozilla, and recent contributions to the ecosystem were more from outside than inside Mozilla itself.
                  I mean quite the opposite: the creation of a foundation is just a first step to maturity. The next step would be a solid standardization process, preferably under ISO umbrella. The fear that without support from its parent Rust will die just shows that the language is still in it's infancy. Which doesn't mean that it's a bad thing, it's just way to early to make the linux kernel depend on it.

                  Comment


                  • #29
                    Originally posted by ssokolow View Post
                    Maybe it's doing something like "The majority of the threads are sleeping, so I'll call it sleeping, but one thread is taking 100% CPU".
                    Awesome! Thank you so much for this idea, that's going to help me a lot. I had no idea top and ps and everything else I was looking at were doing this, or that rustc was using multiple threads under the hood to cause this problem for me. This is why I like reading Phoronix -- there are some genuinely smart people here.

                    Comment


                    • #30
                      Originally posted by marios View Post
                      Every time I see a thread about Rust on Phoronix, I grab some popcorn and start reading the comments. I was always against adding one more language (any language) at a purely C codebase, because I am worried that some time in the future both languages will be needed to understand the codebase (my worries could be unfounded, but Rust fans will certainly try to rewrite parts of the kernel in Rust). I also hate the toxicity of the Rust community ("Everything new should be written in Rust", they said). I also dislike its syntax but this is just personal taste.

                      I hope that either Rust never makes it to the Kernel, or that it is only used in code that is never called by C and does not implement core functionality.
                      Polyglot codebases are already common. Many Python apps have some modules written in C and projects like Git or Libre Office are real hodgepodges of all sorts of languages. Your fear that in order to understand the kernel, one might now have to learn two languages instead of one, are true to some extent, but in practice it doesn't complicate matters that much. The Linux kernel has grown so large and so complex that no-one, not even Linus and his lieutenants, understands it in its entirety. People always work on particular subsystems, drivers or modules. For now they have all been written in C but if some new ones are written in Rust instead, it will still be a consistent, single-language codebase as far as that particular part of the kernel is concerned.

                      BTW I don't think that your bashing of the Rust community is warranted. The "rewrite everything in Rust" meme is more of an in-joke than a serious attitude; in fact the Rust community has always been open-minded about that. Read for example this week's This Week In Rust and you will find an article on why Rust and Go complement nicely each other. Personally I've always found the Rust community to be one of the least toxic programming language communities around (together with the Python and Go communities), particularly if you compare it with the likes of the C++ folks (many of whom are unusually narrow-minded and defensive about "their" language - I've worked a lot (a lot) on C++ codebases) or the rather bizarre dlang community, who spends most of its time bashing D but at the same time is extremely resentful and acrimonious towards all languages that are not D, particularly Rust, Java and JS.

                      Comment

                      Working...
                      X