Index | Thread | Search

From:
"Theo de Raadt" <deraadt@openbsd.org>
Subject:
Re: kern_pledge, allow sysctl hw.model & hw.cpuspeed
To:
Tobias Heider <tobias.heider@stusta.de>
Cc:
Fabien Romano <fabienromano@gmail.com>, tech@openbsd.org
Date:
Fri, 21 Jun 2024 07:55:18 -0600

Download raw body.

Thread
  • Stuart Henderson:

    kern_pledge, allow sysctl hw.model & hw.cpuspeed

  • Tobias Heider <tobias.heider@stusta.de> wrote:
    
    > > My work on sandboxing is still in early stage ... while there, I also encounter
    > > a mlock(2) in signal-desktop/better-sqlite/sqlcipher. From my understanding this
    > > syscall is about wiring page and not about concurrencies. I guess this is for
    > > performance reasons so I disabled the feature at compilation time.
    > > Am I wrong ?
    > 
    > Those properties will not change at runtime so the better way to deal with
    > this would be reading them once at the start of the program before any
    > privileges are dropped and then using that value where needed instead of
    > softening the pledge promise.
    
    When we applied pledge to all of base, and to chrome and a few ports, this
    development process became known as "hoisting".  You move the things prevented
    by the chosen pledges, above the pledge call(s).
    
    It is refactoring initialization code to be outside the security-sensitive
    main loop.
    
    It is a required procedure to use pledge.
    
    Every month someone comes to me and says pledge is too restrictive.  Being
    restrictive is the entire idea.
    
    Applications and daemons must adapt to pledge, not the other way around.
    
    
    
  • Stuart Henderson:

    kern_pledge, allow sysctl hw.model & hw.cpuspeed