Commit 788d6715 authored by Nathan Chancellor's avatar Nathan Chancellor Committed by Vasily Gorbik

s390/kaslr: Fix casts in get_random

Clang warns:

../arch/s390/boot/kaslr.c:78:25: warning: passing 'char *' to parameter
of type 'const u8 *' (aka 'const unsigned char *') converts between
pointers to integer
types with different sign [-Wpointer-sign]
                                  (char *) entropy, (char *) entropy,
                                                    ^~~~~~~~~~~~~~~~
../arch/s390/include/asm/cpacf.h:280:28: note: passing argument to
parameter 'src' here
                            u8 *dest, const u8 *src, long src_len)
                                                ^
2 warnings generated.

Fix the cast to match what else is done in this function.

Fixes: b2d24b97 ("s390/kernel: add support for kernel address space layout randomization (KASLR)")
Link: https://github.com/ClangBuiltLinux/linux/issues/862
Link: https://lkml.kernel.org/r/20200208141052.48476-1-natechancellor@gmail.comSigned-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
parent 38032473
...@@ -75,7 +75,7 @@ static unsigned long get_random(unsigned long limit) ...@@ -75,7 +75,7 @@ static unsigned long get_random(unsigned long limit)
*(unsigned long *) prng.parm_block ^= seed; *(unsigned long *) prng.parm_block ^= seed;
for (i = 0; i < 16; i++) { for (i = 0; i < 16; i++) {
cpacf_kmc(CPACF_KMC_PRNG, prng.parm_block, cpacf_kmc(CPACF_KMC_PRNG, prng.parm_block,
(char *) entropy, (char *) entropy, (u8 *) entropy, (u8 *) entropy,
sizeof(entropy)); sizeof(entropy));
memcpy(prng.parm_block, entropy, sizeof(entropy)); memcpy(prng.parm_block, entropy, sizeof(entropy));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment