lkml.org 
[lkml]   [2022]   [Aug]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: Should Linux set the new constant-time mode CPU flags?
    Hi Eric,

    On Thu, Aug 25, 2022 at 11:15:58PM +0000, Eric Biggers wrote:
    > I'm wondering if people are aware of this issue, and whether anyone has any
    > thoughts on whether/where the kernel should be setting these new CPU flags.
    > There don't appear to have been any prior discussions about this. (Thanks to

    Maybe it should be set unconditionally now, until we figure out how to
    make it more granular.

    In terms of granularity, I saw other folks suggesting making it per-task
    (so, presumably, a prctl() knob), and others mentioning doing it just
    for kernel crypto. For the latter, I guess the crypto API could set it
    inside of its abstractions, and the various lib/crypto APIs could set it
    at invocation time. I wonder, though, what's the cost of
    enabling/disabling it? Would we in fact need a kind of lazy-deferred
    disabling, like we have with kernel_fpu_end()? I also wonder what
    crypto-adjacent code might wind up being missed if we're going function
    by function. Like, obviously we'd set this for crypto_memneq, but what
    about potential unprotected `==` of ID numbers that could leak some info
    in various protocols? What other subtle nearby code should we be
    thinking about, that relies on constant time logic but isn't neatly
    folded inside a crypto_do_something() function?

    Jason

    \
     
     \ /
      Last update: 2022-08-29 18:40    [W:2.675 / U:0.120 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site