mirror of
https://github.com/QuixiAI/nvdriver.git
synced 2026-12-06 14:38:47 +00:00
- Updated tools/post_reboot.sh to check kernel oops taint bit and stuck driver tasks instead of <86400s uptime - Level 7 hardware regression passed on 0000:b3:00.0 (module 37e6fa430835eee2b426019db3ad70eeb7a9e9070c09c84bd9b973cf56cbe529, 107 inventory words, 0 static mismatches, CUDA baseline verified before and after) - Updated .gitignore to exclude build archives (*.a, *.rlib), __pycache__, and raw trace dumps
30 lines
2.6 KiB
Python
30 lines
2.6 KiB
Python
#!/home/geodd/.local/opt/rea-python/bin/python
|
|
"""Execute actual shipped Linux registry leaves, without substituting statuses."""
|
|
from pathlib import Path
|
|
import hashlib,json,warnings
|
|
warnings.filterwarnings('ignore',category=UserWarning,module='unicorn')
|
|
from elftools.elf.elffile import ELFFile
|
|
from unicorn import Uc,UC_ARCH_X86,UC_MODE_64,UC_HOOK_MEM_READ,UC_HOOK_MEM_WRITE
|
|
from unicorn.x86_const import *
|
|
R=Path(__file__).resolve().parents[1];P=Path('/home/geodd/nvidia-driver/analysis-580.178.04/extracted/kernel/nvidia/nv-kernel.o_binary');SHA='5269a23ffba19a17fe16f076463e7ad4151254659441d1711bee6c6221ff6f4b';assert hashlib.sha256(P.read_bytes()).hexdigest()==SHA
|
|
TEXT=0x10000000;DATA=0x30000000;STACK=0x40000000;STOP=0x60000000
|
|
with P.open('rb') as f:
|
|
e=ELFFile(f);text=e.get_section_by_name('.text').data();syms={s.name:s for s in e.get_section_by_name('.symtab').iter_symbols()}
|
|
uc=Uc(UC_ARCH_X86,UC_MODE_64);uc.mem_map(TEXT,(len(text)+4095)&~4095);uc.mem_write(TEXT,text);uc.mem_map(DATA,4096);uc.mem_map(STACK,4096);uc.mem_map(STOP,4096)
|
|
accesses=[]
|
|
def access(uc,kind,address,size,value,user):
|
|
if DATA<=address<DATA+4096:accesses.append([kind,address,size,value])
|
|
uc.hook_add(UC_HOOK_MEM_READ|UC_HOOK_MEM_WRITE,access)
|
|
specs=[[0]*6,[DATA]*6,[0xffffffffffffffff]*6]
|
|
for index in range(6):
|
|
for value in [0,DATA+32,0xffffffffffffffff]:s=[DATA]*6;s[index]=value;specs.append(s)
|
|
rows=[]
|
|
for name in ['_nv049790rm','_nv049791rm','_nv049860rm']:
|
|
for values in specs:
|
|
uc.mem_write(DATA,bytes([0xa5])*4096);accesses.clear()
|
|
for reg,value in zip([UC_X86_REG_RDI,UC_X86_REG_RSI,UC_X86_REG_RDX,UC_X86_REG_RCX,UC_X86_REG_R8,UC_X86_REG_R9],values):uc.reg_write(reg,value)
|
|
uc.reg_write(UC_X86_REG_RSP,STACK+4088);uc.mem_write(STACK+4088,STOP.to_bytes(8,'little'));uc.reg_write(UC_X86_REG_RAX,0xdeadbeefdeadbeef);uc.emu_start(TEXT+syms[name]['st_value'],STOP,count=20);assert uc.reg_read(UC_X86_REG_RIP)==STOP
|
|
status=uc.reg_read(UC_X86_REG_RAX);assert status==0x56 and not accesses and bytes(uc.mem_read(DATA,4096))==bytes([0xa5])*4096
|
|
rows.append(dict(function=name,arguments=values,status=status,data_accesses=list(accesses)))
|
|
(R/'reports/gpu-pf-rom-linux-leaves-oracle.json').write_text(json.dumps(dict(artifact_sha256=SHA,cases=len(rows),rows=rows,interceptions=[],limits=['Actual ELF instructions execute without any status/memory/function leaf replacement','No native/physicalhardware calls','Data page remains untouched; both memoryread/write hooks prove no accesses to supplied validdata pointers']),indent=2)+'\n');print(len(rows),'actual Linux NV56/no-data-access registry leaf cases')
|