Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
Ubuntu

Memory-Safe Sudo To Become the Default In Ubuntu 28

Longtime Slashdot reader RoccamOccam shares a blog post from the Trifecta Tech Foundation, a nonprofit organization that creates secure, open source building blocks for infrastructure software. The foundation is also the developer behind Sudo-rs. From the report: Ubuntu 25.10 is set to adopt sudo-rs by default. Sudo-rs is a memory-safe reimplementation of the widely-used sudo utility, written in the Rust programming language. This move is part of a broader effort by Canonical to improve the resilience and maintainability of core system components. [...]

The decision to adopt sudo-rs is in line with Canonical's commitment to Carefully But Purposefully increase the resilience of critical system software, by adopting Rust. Rust is a programming language with strong memory safety guarantees that eliminates many of the vulnerabilities that have historically plagued traditional C-based software. Sudo-rs is part of the Trifecta Tech Foundation's Privilege Boundary initiative, which aims to handle privilege escalation with memory-safe alternatives.

Memory-Safe Sudo To Become the Default In Ubuntu

Comments Filter:
  • Although I would like sudo that is formally verified, not simply memory safe. Maybe something worth doing in Ada/SPARK.

  • by PhantomHarlock ( 189617 ) on Tuesday May 06, 2025 @06:45PM (#65357441)

    ...it can still make me a sandwich we're good.

    • It's the real sudo's memory unsafety (forgetting how many sandwiches it's made and who for) that allows for this. Don't worry, you can use sudo-rs to run sudo.

  • Could someone explain to a ânon-coderâ(TM) what this means in laymanâ(TM)s terms please. ;)

    • Re: (Score:3, Insightful)

      by Anonymous Coward

      Someone re-wrote a piece of code that already worked into their preferred language so that they could trumpet their accomplishment.

  • by jrnvk ( 4197967 )

    This is probably gonna break some of my 20-year-old plus scripts

    • I'm thinking it's in addition to sudo; able to change back to sudo as default

    • by caseih ( 160668 )

      Meh. The big distros have already deprecated sudo in favor of policykit (which has not yet been re-written in rust).

    • Yes, it may break things [github.com], although it's drop-in compatible for the subset of sudo functionality it implements. I'm not sure if Ubuntu will migrate everyone by default on upgrade, but they'll almost certainly keep the original sudo as an option for people that need it.

  • ... how much of the Rust environment will I have to install just to fix this one bad sudo executable?

    • by Anonymous Coward

      This blog post discusses the risk of depending on dozens of unstable packages, not uncommon for programs written in modern languages:

      Sudo-rs dependencies: when less is better [memorysafety.org]

      The sudo utility represents a critical privilege boundary, so it should be memory safe. [...] Ruben Nijveld from the Tweede golf team offers his perspective here on one of the greatest challenges we faced when developing software that can be widely adopted: Rust crate dependencies.

      When sudo-rs development started, we added several dependencies using Rust's crates ecosystem to quickly ramp up development. During development we accrued approximately 135 transitive (direct and indirect) dependencies. Once this was identified, we managed to reduce our total dependencies down to three. In this blog, we explain why and how we did this.

      The remaining dependencies are the core crates libc, glob, and log.

    • Rust executables are typically built with all rust modules statically linked, so only dependencies on libc and other system libraries remain:

      $ ldd `which sudo-rs`
      linux-vdso.so.1 (0x000072fbe0db3000)
      libpam.so.0 => /lib/x86_64-linux-gnu/libpam.so.0 (0x000072fbe0cb6000)
      libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x000072fbe0c88000)
      libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x000072fbe0b9f000)
      libc.so.6 => /lib/x86_64-
      • by caseih ( 160668 )

        Nice, but that is not what the OP was asking about.

        • The immediate implication of my comment is that no "Rust environment" needs to be installed for the sudo-rs executable to function. I guess you could consider statically linked code an "environment", but at any rate it doesn't pull in a bunch of dependencies from the package system that you would get with e.g. a Java or Node application.

        • by PPH ( 736903 )

          I got two different answers, both useful.

          1) For someone who is unfamiliar with Rust, it appears that it can be statically linked to existing libraries. Good ... but that opens up the question of how secure a sudo.rs executable can be if an attack surface exists in someplace like libc.so (the 'old fashioned' C implementation). If I understood this response incorrectly, then:

          2) A project to 'Rustify' any existing executable will be an involved job. Here (https://www.memorysafety.org/blog/reducing-dependenci [memorysafety.org]

  • by moglito ( 1355533 ) on Tuesday May 06, 2025 @07:08PM (#65357485)
    I find the title misleading. It suggests that the current sudo is not memory-safe, while in reality it is just not written in a memory-safe language. That attribute means very different things when talking about a language and a program. It honestly seems a bit arrogant from the Rust-fan-block to use that description, as if programs could not be memory safe unless they are written in a language that guarantees memory safety.
  • I use su like god intended.

  • That's great, now your doohickey is memory safe. Which sounds like a good idea to me.
    But why not just get rid of the doohickey completely, and waste less of your time and cognitive ability on something you don't need in the first place.

The game of life is a game of boomerangs. Our thoughts, deeds and words return to us sooner or later with astounding accuracy.

Working...