Skip to content

Commit 7d5ec9e

Browse files
keesgregkh
authored andcommitted
latent_entropy: fix ARM build error on earlier gcc
commit 9988f4d upstream. This fixes build errors seen on gcc-4.9.3 or gcc-5.3.1 for an ARM: arm-soc/init/initramfs.c: In function 'error': arm-soc/init/initramfs.c:50:1: error: unrecognizable insn: } ^ (insn 26 25 27 5 (set (reg:SI 111 [ local_entropy.243 ]) (rotatert:SI (reg:SI 116 [ local_entropy.243 ]) (const_int -30 [0xffffffffffffffe2]))) -1 (nil)) Patch from PaX Team <pageexec@freemail.hu> Reported-by: Arnd Bergmann <arnd@arndb.de> Reported-by: Brad Spengler <spender@grsecurity.net> Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 959e953 commit 7d5ec9e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎scripts/gcc-plugins/latent_entropy_plugin.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,9 @@ static enum tree_code get_op(tree *rhs)
328328
op = LROTATE_EXPR;
329329
/*
330330
* This code limits the value of random_const to
331-
* the size of a wide int for the rotation
331+
* the size of a long for the rotation
332332
*/
333-
random_const &= HOST_BITS_PER_WIDE_INT - 1;
333+
random_const %= TYPE_PRECISION(long_unsigned_type_node);
334334
break;
335335
}
336336

0 commit comments

Comments
 (0)