Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\lib\kaslr.c Create Date:2022-07-28 07:25:51
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:kaslr_get_random_long

Proto:unsigned long kaslr_get_random_long(const char *purpose)

Type:unsigned long

Parameter:

TypeParameterName
const char *purpose
52  mix_const = 0x5d6008cbf3848dd3UL
56  random = get_boot_seed()
57  bool use_i8254 = true
59  debug_putstr(purpose)
60  debug_putstr(" KASLR using")
62  If has_cpuflag(RDRAND instruction ) Then
63  debug_putstr(" RDRAND")
65  random ^= raw
66  use_i8254 = false
70  If has_cpuflag(Time Stamp Counter ) Then
71  debug_putstr(" RDTSC")
72  raw = dtsc() - returns the current TSC without ordering constraints* rdtsc() returns the result of RDTSC as a 64-bit integer
74  random ^= raw
75  use_i8254 = false
78  If use_i8254 Then
79  debug_putstr(" i8254")
80  random ^= i8254()
84  asm(_ASM_MUL "%3":"=a"(random), "=d"(raw):"a"(random), "rm"(mix_const))
87  random += raw
89  debug_putstr("...\n")
91  Return random