Skip to content

Commit 904caa6

Browse files
rth7680tytso
authored andcommitted
linux/random.h: Mark CONFIG_ARCH_RANDOM functions __must_check
We must not use the pointer output without validating the success of the random read. Reviewed-by: Ard Biesheuvel <[email protected]> Signed-off-by: Richard Henderson <[email protected]> Signed-off-by: Mark Brown <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
1 parent 66f5ae8 commit 904caa6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

include/linux/random.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,19 +167,19 @@ static inline void prandom_seed_state(struct rnd_state *state, u64 seed)
167167
#ifdef CONFIG_ARCH_RANDOM
168168
# include <asm/archrandom.h>
169169
#else
170-
static inline bool arch_get_random_long(unsigned long *v)
170+
static inline bool __must_check arch_get_random_long(unsigned long *v)
171171
{
172172
return false;
173173
}
174-
static inline bool arch_get_random_int(unsigned int *v)
174+
static inline bool __must_check arch_get_random_int(unsigned int *v)
175175
{
176176
return false;
177177
}
178-
static inline bool arch_get_random_seed_long(unsigned long *v)
178+
static inline bool __must_check arch_get_random_seed_long(unsigned long *v)
179179
{
180180
return false;
181181
}
182-
static inline bool arch_get_random_seed_int(unsigned int *v)
182+
static inline bool __must_check arch_get_random_seed_int(unsigned int *v)
183183
{
184184
return false;
185185
}

0 commit comments

Comments
 (0)