The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 807 - File: showthread.php PHP 7.3.12 (Linux)
File Line Function
/showthread.php 807 errorHandler->error





Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Possible bug in rtc_entropy.c
2019-03-10, 18:21
Post: #1
Possible bug in rtc_entropy.c
Hello,

I have been working with iPXE for a special project and ran into issues with Hyper-V Gen-1 VMs. I read through the forum and saw the history behind this and noted that the code to detect a broken RTC was added to mainline code some time ago. I instrumented the code and found that on newer versions of Hyper-V that test passes and the RTC code attempts to instantiate DRBG and fails when it calls get_noise. Tracing through I found that the process runs along fine until rtc_sample where it just freezes. Looking at the Assembly code in rtc_sample I noticed something odd. The current mainline code has two jz instructions that reference the label :1b, but that label does not exist in the code fragment. I'm bit sure why the assembler doesn't complain about it, but I suppose it leaves it for the linker to deal with and the linker ignores the issue because the code is embedded. In any event looking at the code I also noticed there are two identical labels :1 present. Overall it looks like some cutting and pasting may have resulted in assembly code that has flaws. I changed the second label to :2 leaving the first as :1 and then targeted the first jz at :1 an the second at :2 and the code started to function and the VMs could boot.

Perhaps this could be reviewed and updated if my assumptions are correct ?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Possible bug in rtc_entropy.c - bugdude - 2019-03-10 18:21



User(s) browsing this thread: 1 Guest(s)