Login
You're viewing the discuss.systems public feed.
  • Oct 7, 2026, 4:17 PM

    RE: chaos.social/@icing/1173980695

    I’ve complained about this before, but this is not something you can usefully do from the front-end. If we really want things zeroed, we need compiler functionality that asks the back end to ensure that the data is gone as soon as possible after it’s no longer needed and no later than when the function returns, either by having the register or memory reused, or cleared if there’s no good reuse opportunity

    💬 2🔄 1⭐ 1

Replies

  • 💬 2🔄 0⭐ 0
  • Oct 7, 2026, 4:34 PM

    @joe @fay59 after the AI apocalypse we'll all go back to cooperative multitasking, so this won't be a problem

    💬 1🔄 0⭐ 0
  • Oct 7, 2026, 4:35 PM

    @zwarich @fay59 i was going to shitpost about how this is why x86 is actually more secure, since you can just use REP STOSB and/or memory operands to keep your secret out of architectural state

    💬 1🔄 1⭐ 0
  • Oct 7, 2026, 4:40 PM

    @joe @fay59 I think CPUs should have string instructions from clearing, copying, comparing, and hashing memory (with a few different kinds of hash functions for the latter, e.g. checksum, hash table hash, and cryptographic hashes). CPU microarchitects generally don't like this for a number of reasons, but we must find a way.

    💬 1🔄 0⭐ 0
  • 💬 0🔄 0⭐ 1
  • Oct 7, 2026, 5:10 PM

    @joe @fay59 Pretty much any attempt at wiping secrets fails unless it is part of task/process management (system/kernel), and even then it is still leaky (e.g swap, SRAM/DDR contents across reset, etc, etc), or can be snooped (spectre, SPA, DPA, etc).

    If leaking secrets is ever a concern where you'd want to apply sanitizing at *compiler* level, you're likely in a threat model where that isn't sufficient.

    💬 1🔄 0⭐ 0
  • Oct 7, 2026, 7:44 PM

    @jripley @joe sounds like a necessary step at any rate; what hopes do you have to fix the problem if you don’t have that?

    💬 1🔄 0⭐ 0
  • Oct 7, 2026, 7:57 PM

    @fay59 @jripley this seems like a situation where mitigation is still worthwhile to some degree even without a 100% airtight solution, since some of these leakages require higher sophistication and/or a longer exploit chain to get to than if the secret is left sitting

    💬 1🔄 0⭐ 0
  • Oct 7, 2026, 8:13 PM

    @joe @fay59 It is an unpopular opinion, but mine is these mitigations should _not_ be used. Not even if there is "compiler support". Keeping secrets from other parts of the same task, in the same program, is extremely fragile. People integrate these repos into platforms you didn't expect—with the expectation they get sanitizing—and it fails to do so. And worse, they go no further than this, because the expectation is data is gone, which it isn't, because it's a *systems* problem.

    💬 1🔄 0⭐ 0
  • Oct 7, 2026, 8:27 PM

    @joe @fay59 If you have a feature-rich platform (SoC) then perhaps you can use ISA or mapped-device features, so general-purpose parts of your core are never tainted. Otherwise, the only way to guarantee isolation of that function is context isolation, and the least leaky method is a separate task/process. Or if you're feature-rich, a dedicated "secure" core, or (worse but works better than nothing) a "secure state".

    Otherwise, some day you find your sanitizing silently stopped working.

    💬 1🔄 0⭐ 0
  • Oct 7, 2026, 9:26 PM

    @jripley @joe I still don’t understand how a holistic solution to this problem can exist without the language/compiler change that you don’t like

    💬 1🔄 0⭐ 0
  • Oct 7, 2026, 9:43 PM

    @fay59 @joe Consider how you would test that your program was not leaking secrets. [Or even how you would test this feature worked, for your function]

    💬 1🔄 0⭐ 0
  • Oct 8, 2026, 1:06 AM

    @jripley @joe I am considering that and I am still not arriving at “this is unnecessary”. There’s plenty of very common, essentially portable ways to read bytes that are just hanging out in memory, even if they’re not the only way

    💬 0🔄 0⭐ 0
  • Oct 7, 2026, 4:32 PM

    @fay59 yeah - realistically it should probably be an attribute that gets to the backend for register and stack allocation, of course doing that in a cross compiler way is a misery pit (attribute can be ignored, magic builtin requires cross compiler support, etc)

    💬 0🔄 0⭐ 0