提交 eed89d0f 编写于 作者: I Ian Molton 提交者: Herbert Xu

hwrng: core - Prevent too-small buffer sizes

This patch prevents the hw_random core using too small of a buffer
on machines with small cacheline sizes.
Signed-off-by: NIan Molton <ian.molton@collabora.co.uk>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 bb347d98
...@@ -53,7 +53,8 @@ static struct hwrng *current_rng; ...@@ -53,7 +53,8 @@ static struct hwrng *current_rng;
static LIST_HEAD(rng_list); static LIST_HEAD(rng_list);
static DEFINE_MUTEX(rng_mutex); static DEFINE_MUTEX(rng_mutex);
static int data_avail; static int data_avail;
static u8 rng_buffer[SMP_CACHE_BYTES] __cacheline_aligned; static u8 rng_buffer[SMP_CACHE_BYTES < 32 ? 32 : SMP_CACHE_BYTES]
__cacheline_aligned;
static inline int hwrng_init(struct hwrng *rng) static inline int hwrng_init(struct hwrng *rng)
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册