RE: [PATCH v2 1/1] x86/hyperv: Use Hyper-V entropy to seed guest random number generator

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +void __init ms_hyperv_late_init(void)
> +{
> +       struct acpi_table_header *header;
> +       acpi_status status;
> +       u8 *randomdata;
> +       u32 length, i;
> +
> +       /*
> +        * Seed the Linux random number generator with entropy provided by
> +        * the Hyper-V host in ACPI table OEM0.  It would be nice to do this
> +        * even earlier in ms_hyperv_init_platform(), but the ACPI subsystem
> +        * isn't set up at that point. Skip if booted via EFI as generic EFI
> +        * code has already done some seeding using the EFI RNG protocol.
> +        */
> +       if (!IS_ENABLED(CONFIG_ACPI) || efi_enabled(EFI_BOOT))
> +               return;
> +
> +       status = acpi_get_table("OEM0", 0, &header);
> +       if (ACPI_FAILURE(status) || !header)
> +               return;

Should we call acpi_put_table() if header == 0? It will also be helpful doing a pr_info() here so user knows that hyper-v random number is not used.





[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux