Giter Site home page Giter Site logo

bzero pages about sunriseos HOT 4 OPEN

sunriseos avatar sunriseos commented on May 31, 2024
bzero pages

from sunriseos.

Comments (4)

roblabla avatar roblabla commented on May 31, 2024 1

Can probably be closed with https://github.com/sunriseos/SunriseOS/blob/master/shell/img/meme7.gif

from sunriseos.

kitlith avatar kitlith commented on May 31, 2024 1

Given the number of "reboot and use some state left in RAM" attacks on various systems, I think that you cannot assume that never-used pages are clean.

There's a trade-off between whether you want allocation to be fast, or freeing to be fast. If you zero on allocation:

  • You don't have to clean never-used pages until they are actually used.
    • On the other hand, this may mean that stuff sticks around for a long time in memory, even if inaccessible.
  • Free (shouldn't) have to do anything extra.

If you zero on free:

  • Never-used pages should be cleared at boot.
  • Attacker controlled values go away as soon as the page is freed.
    • As a side-effect, I'd think this accomplishes 'zero memory on shutdown' kinda automatically
  • Allocation (shouldn't) have to do anything extra.
  • All kernel pages are zeroed too, because there are no free dirty pages.

Upon thinking about this, I think I actually prefer zeroing on free due to the implications it has. Either a page is used and has valid(?) data, or is zero.

from sunriseos.

roblabla avatar roblabla commented on May 31, 2024

We should at least clean up on deallocation

from sunriseos.

Orycterope avatar Orycterope commented on May 31, 2024

One unmentioned problem is that to bzero a page, it needs to be mapped. However the allocation of pages and their mapping is highly decoupled (frame_allocator vs. paging). This means we either have to:

  • have the frame_allocator re-map a frame every time it needs to bzero it (either at allocation or at free). This is a lot of overhead, and clearly not ideal.
  • map the whole RAM in our address space somewhere in the KernelLand, so that frame_allocator can bzero freed frames by accessing them directly. This is the preferred solution for 64-bit address spaces, however this is not applicable for 32-bit address spaces, since a 4GB address space isn't big enough.
  • find a way to re-couple the frame_allocator and paging on this matter. If we end up going for the 'zero on free' solution, we should use the 'dirty' bit in the page tables to skip pages that haven't been modified.

from sunriseos.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.