Skip to content

Latest commit

 

History

History
74 lines (58 loc) · 3.57 KB

bpf_get_prandom_u32.md

File metadata and controls

74 lines (58 loc) · 3.57 KB
title description
Helper Function 'bpf_get_prandom_u32'
This page documents the 'bpf_get_prandom_u32' eBPF helper function, including its defintion, usage, program types that can use it, and examples.

Helper function bpf_get_prandom_u32

:octicons-tag-24: v4.17

Definition

Copyright (c) 2015 The Libbpf Authors. All rights reserved.

Get a pseudo-random number.

From a security point of view, this helper uses its own pseudo-random internal state, and cannot be used to infer the seed of other random functions in the kernel. However, it is essential to note that the generator used by the helper is not cryptographically secure.

Returns

A random 32-bit unsigned value.

#!c static __u32 (* const bpf_get_prandom_u32)(void) = (void *) 7;

Usage

!!! example "Docs could be improved" This part of the docs is incomplete, contributions are very welcome

Program types

This helper call can be used in the following program types:

Example

!!! example "Docs could be improved" This part of the docs is incomplete, contributions are very welcome