top | item 41913905

(no title)

nullindividual | 1 year ago

You'd need to pin pages in physical memory to guarantee it stays in physical memory. What happens if an 'attacker' (or accidental user) exceeds available physical memory? OOM Kill other applications? Just don't accept temp data, leading to failures in operations requested by the user or system?

Pages in physical memory are not typically zero'ed out upon disuse. Yes, they're temporary... but only guaranteed temporary if you turn the system off and the DRAM cells bleed out their voltage.

discuss

order

noirscape|1 year ago

By default a tmpfs has a really low RAM priority so the OS will try to move it in swapspace if memory gets low. tmpfs size is specified on creation of the tmpfs (and cant be larger than the total memory available, which is swap + RAM) but it's only "occupied" when files begin to fill the tmpfs.

If it gets too full for regular OS operations, you get the fun of the OOM Killer shutting down services (tmpfs is never targeted by the OOM Killer) until the entire OS just deadlocks if you somehow manage to fill the tmpfs up entirely.

nullindividual|1 year ago

> OS will try to move it in swapspace if memory gets low

That defeats the idea GP presented.

akira2501|1 year ago

> exceeds available physical memory?

shm and memory mounts use half the available system memory by default. so this is not typically possible.

> are not typically zero'ed out upon disuse

They're zeroed when they're reallocated.

> and the DRAM cells bleed out their voltage.

This occurs in less than a second in almost every room temperature environment.

RiverCrochet|1 year ago

Well I guess you could tell Linux to not use some memory addresses using the BadRAM feature, then setup an `mtd` device to those memory addresses and create a RAM-based block device, then use `cryptsetup` to encrypt it. If your Linux box is headless and you have a GPU with RAM there mostly sitting unused then you could use the VRAM.