mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Avoid returning a NULL pointer from the Intel hw PRNG ifunc resolver.
DTrace expects kernel function symbols of a non-zero size to have an implementation, which is a reasonable invariant to preserve. Reported and tested by: ler Reviewed by: cem, kib Approved by: so (delphij) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20218
This commit is contained in:
parent
0eba88cf91
commit
b870199522
1 changed files with 8 additions and 1 deletions
|
|
@ -97,6 +97,13 @@ x86_rdseed_store(u_long *buf)
|
|||
return (retry);
|
||||
}
|
||||
|
||||
static int
|
||||
x86_unimpl_store(u_long *buf __unused)
|
||||
{
|
||||
|
||||
panic("%s called", __func__);
|
||||
}
|
||||
|
||||
DEFINE_IFUNC(static, int, x86_rng_store, (u_long *buf), static)
|
||||
{
|
||||
has_rdrand = (cpu_feature2 & CPUID2_RDRAND);
|
||||
|
|
@ -107,7 +114,7 @@ DEFINE_IFUNC(static, int, x86_rng_store, (u_long *buf), static)
|
|||
else if (has_rdrand)
|
||||
return (x86_rdrand_store);
|
||||
else
|
||||
return (NULL);
|
||||
return (x86_unimpl_store);
|
||||
}
|
||||
|
||||
/* It is required that buf length is a multiple of sizeof(u_long). */
|
||||
|
|
|
|||
Loading…
Reference in a new issue