summaryrefslogtreecommitdiff
path: root/fs/jffs2/security.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2022-11-30 03:02:05 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2022-12-04 14:37:08 +0100
commit39ec9e6b141e5a9d7274f40531888f890385a013 (patch)
tree3a08982293fe2b6380b160dda771d328419478c3 /fs/jffs2/security.c
parentb83e45fd065c3cfdb8cc0179bbddf296ce4d4fda (diff)
downloadlwn-39ec9e6b141e5a9d7274f40531888f890385a013.tar.gz
lwn-39ec9e6b141e5a9d7274f40531888f890385a013.zip
random: align entropy_timer_state to cache line
The theory behind the jitter dance is that multiple things are poking at the same cache line. This only works, however, if what's being poked at is actually all in the same cache line. Ensure this is the case by aligning the struct on the stack to the cache line size. We can't use ____cacheline_aligned on a stack variable, because gcc assumes 16 byte alignment when only 8 byte alignment is provided by the kernel, which means gcc could technically do something pathological like `(rsp & ~48) - 64`. It doesn't, but rather than risk it, just do the stack alignment manually with PTR_ALIGN and an oversized buffer. Fixes: 50ee7529ec45 ("random: try to actively add entropy rather than passively wait for it") Cc: Eric Biggers <ebiggers@kernel.org> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'fs/jffs2/security.c')
0 files changed, 0 insertions, 0 deletions