diff options
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/bpf/core.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c index f1e8a0def99b..b94a36550591 100644 --- a/kernel/bpf/core.c +++ b/kernel/bpf/core.c | |||
| @@ -231,7 +231,7 @@ bpf_jit_binary_alloc(unsigned int proglen, u8 **image_ptr, | |||
| 231 | hdr->pages = size / PAGE_SIZE; | 231 | hdr->pages = size / PAGE_SIZE; |
| 232 | hole = min_t(unsigned int, size - (proglen + sizeof(*hdr)), | 232 | hole = min_t(unsigned int, size - (proglen + sizeof(*hdr)), |
| 233 | PAGE_SIZE - sizeof(*hdr)); | 233 | PAGE_SIZE - sizeof(*hdr)); |
| 234 | start = (prandom_u32() % hole) & ~(alignment - 1); | 234 | start = (get_random_int() % hole) & ~(alignment - 1); |
| 235 | 235 | ||
| 236 | /* Leave a random number of instructions before BPF code. */ | 236 | /* Leave a random number of instructions before BPF code. */ |
| 237 | *image_ptr = &hdr->image[start]; | 237 | *image_ptr = &hdr->image[start]; |
| @@ -251,7 +251,7 @@ static int bpf_jit_blind_insn(const struct bpf_insn *from, | |||
| 251 | struct bpf_insn *to_buff) | 251 | struct bpf_insn *to_buff) |
| 252 | { | 252 | { |
| 253 | struct bpf_insn *to = to_buff; | 253 | struct bpf_insn *to = to_buff; |
| 254 | u32 imm_rnd = prandom_u32(); | 254 | u32 imm_rnd = get_random_int(); |
| 255 | s16 off; | 255 | s16 off; |
| 256 | 256 | ||
| 257 | BUILD_BUG_ON(BPF_REG_AX + 1 != MAX_BPF_JIT_REG); | 257 | BUILD_BUG_ON(BPF_REG_AX + 1 != MAX_BPF_JIT_REG); |
