mirror of
https://github.com/QuixiAI/nvdriver.git
synced 2026-12-06 06:28:39 +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
198 lines
6.0 KiB
C
198 lines
6.0 KiB
C
/* Literal inferred original021074/021109/021101 reset algorithm.
|
|
* 580.178.04 RM SHA2565269a23ffba19a17fe16f076463e7ad4151254659441d1711bee6c6221ff6f4b.
|
|
* Harness: normalized local RBP frame, explicit register-proven RDI arguments,
|
|
* synthetic owned pools/nodes/objects; callbacks record identity and optionally
|
|
* replace current pool. No real callback body, machine code, or hardware runs. */
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
typedef uint32_t uint,undefined4;typedef uint64_t ulong,undefined8;
|
|
typedef uint8_t byte,undefined1;typedef void code(long);
|
|
static long lRam00000000000008a0;
|
|
static void _nv020158rm(){abort();}
|
|
/* Inferred Ghidra 12.2 pseudocode; not original source.
|
|
* input_sha256: 5269a23ffba19a17fe16f076463e7ad4151254659441d1711bee6c6221ff6f4b
|
|
* entry: 063480f0 name: _nv021109rm
|
|
* per_function_timeout_seconds: 60
|
|
*/
|
|
|
|
|
|
void _nv021109rm(int *param_1)
|
|
|
|
{
|
|
int *piVar1;
|
|
|
|
if (param_1 == (int *)0x0) {
|
|
_nv020158rm(0);
|
|
}
|
|
piVar1 = param_1 + 0x208;
|
|
do {
|
|
if (*param_1 != 0) {
|
|
*(undefined1 *)(param_1 + 3) = 1;
|
|
}
|
|
param_1 = param_1 + 4;
|
|
} while (piVar1 != param_1);
|
|
return;
|
|
}
|
|
|
|
|
|
/* Inferred Ghidra 12.2 pseudocode; not original source.
|
|
* input_sha256: 5269a23ffba19a17fe16f076463e7ad4151254659441d1711bee6c6221ff6f4b
|
|
* entry: 06346970 name: _nv021101rm
|
|
* per_function_timeout_seconds: 60
|
|
*/
|
|
|
|
|
|
/* WARNING: Function: __x86_indirect_thunk_rax replaced with injection: x86_indirect_thunk_rax */
|
|
|
|
void _nv021101rm(long param_1,undefined4 param_2)
|
|
|
|
{
|
|
long lVar1;
|
|
byte bVar2;
|
|
code *pcVar3;
|
|
uint uVar4;
|
|
ulong uVar5;
|
|
_Alignas(8) byte frame[32]={0};
|
|
long unaff_RBP=(long)(frame+16);
|
|
long lVar6;
|
|
int iVar7;
|
|
ulong uVar8;
|
|
|
|
*(undefined4 *)(unaff_RBP + -4) = param_2;
|
|
if (param_1 == 0) {
|
|
_nv020158rm(0);
|
|
lVar6 = lRam00000000000008a0;
|
|
}
|
|
else {
|
|
lVar6 = *(long *)(param_1 + 0x8a0);
|
|
}
|
|
if (lVar6 == 0) {
|
|
_nv020158rm(0);
|
|
lVar6 = *(long *)(param_1 + 0x8a0);
|
|
}
|
|
bVar2 = *(byte *)(lVar6 + 0x2a490);
|
|
if ((byte)*(uint *)(unaff_RBP + -4) < bVar2) {
|
|
uVar4 = bVar2 - 1 & 0xff;
|
|
uVar5 = (ulong)uVar4;
|
|
iVar7 = uVar4 - 1;
|
|
*(uint *)(unaff_RBP + -8) = iVar7 - ((uint)bVar2 + ~*(uint *)(unaff_RBP + -4) & 0xff);
|
|
do {
|
|
uVar8 = 0;
|
|
do {
|
|
lVar1 = *(long *)(lVar6 + 8 + (uVar8 + 0xb6a + uVar5 * 0xa6e) * 8);
|
|
if (lVar1 != 0) {
|
|
lVar6 = *(long *)(lVar1 + 8);
|
|
if (lVar6 == 0) {
|
|
_nv020158rm();
|
|
lVar6 = *(long *)(lVar1 + 8);
|
|
if (lVar6 != 0) goto LAB_063469e0;
|
|
_nv020158rm();
|
|
pcVar3 = *(code **)(*(long *)(lVar1 + 8) + 8);
|
|
}
|
|
else {
|
|
LAB_063469e0:
|
|
pcVar3 = *(code **)(lVar6 + 8);
|
|
}
|
|
if (pcVar3 == (code *)0x0) {
|
|
_nv020158rm(0);
|
|
pcVar3 = *(code **)(*(long *)(lVar1 + 8) + 8);
|
|
}
|
|
(*pcVar3)(lVar6);
|
|
*(byte *)(lVar1 + 0x28) = *(byte *)(lVar1 + 0x28) & 0xfe;
|
|
lVar6 = *(long *)(param_1 + 0x8a0);
|
|
}
|
|
uVar4 = (int)uVar8 + 1;
|
|
uVar8 = (ulong)uVar4;
|
|
} while (uVar4 != 0x25);
|
|
uVar5 = (ulong)iVar7;
|
|
if (*(int *)(unaff_RBP + -8) == iVar7) goto LAB_06346a72;
|
|
iVar7 = iVar7 + -1;
|
|
} while( true );
|
|
}
|
|
LAB_06346a8b:
|
|
if (bVar2 == 0) {
|
|
*(undefined1 *)(lVar6 + 0x2a490) = 1;
|
|
lVar6 = *(long *)(param_1 + 0x8a0);
|
|
}
|
|
*(undefined8 *)(lVar6 + 0x820) = 0;
|
|
*(undefined8 *)(*(long *)(param_1 + 0x8a0) + 0x828) = 0;
|
|
return;
|
|
LAB_06346a72:
|
|
*(undefined1 *)(lVar6 + 0x2a490) = *(undefined1 *)(unaff_RBP + -4);
|
|
lVar6 = *(long *)(param_1 + 0x8a0);
|
|
bVar2 = *(byte *)(lVar6 + 0x2a490);
|
|
goto LAB_06346a8b;
|
|
}
|
|
|
|
|
|
/* Inferred Ghidra 12.2 pseudocode; not original source.
|
|
* input_sha256: 5269a23ffba19a17fe16f076463e7ad4151254659441d1711bee6c6221ff6f4b
|
|
* entry: 06346b00 name: _nv021074rm
|
|
* per_function_timeout_seconds: 60
|
|
*/
|
|
|
|
|
|
void _nv021074rm(long param_1,long param_2)
|
|
|
|
{
|
|
if (param_1 == 0) {
|
|
_nv020158rm();
|
|
}
|
|
if (param_2 == 0) {
|
|
_nv020158rm(0);
|
|
}
|
|
if (*(long *)(param_2 + 0x8a0) == 0) {
|
|
return;
|
|
}
|
|
_nv021109rm(*(int **)(param_2 + 0x8a0));
|
|
_nv021101rm(param_2,0);
|
|
return;
|
|
}
|
|
|
|
|
|
|
|
static _Alignas(8) byte pools[2][0x2a498],nodes[592][0x30],objects[592][0x10],owner[0x8a8];
|
|
static uint64_t hash=14695981039346656037ULL;
|
|
static uint calls,replacement;
|
|
static void mix(uint v){for(uint i=0;i<4;i++){hash^=(v>>(8*i))&255;hash*=1099511628211ULL;}}
|
|
static void callback(long object){
|
|
mix(*(uint*)object);
|
|
if(calls==0 && replacement)*(long*)(owner+0x8a0)=(long)pools[1];
|
|
calls++;
|
|
}
|
|
int main(void){uint cases=0;
|
|
for(uint replace=0;replace<2;replace++)for(uint depth=0;depth<9;depth++)for(uint seed=0;seed<32;seed++){
|
|
memset(pools,0,sizeof(pools));memset(nodes,0,sizeof(nodes));memset(objects,0,sizeof(objects));memset(owner,0,sizeof(owner));
|
|
calls=0;replacement=replace;*(long*)(owner+0x8a0)=(long)pools[0];
|
|
for(uint p=0;p<2;p++){
|
|
pools[p][0x2a490]=p?(depth+3)%9:depth;
|
|
*(uint64_t*)(pools[p]+0x820)=0x1122334400000000ULL|(seed*2+p);
|
|
*(uint64_t*)(pools[p]+0x828)=0xaabbccdd00000000ULL|(seed*2+p);
|
|
for(uint i=0;i<130;i++){
|
|
*(uint*)(pools[p]+i*16)=i%4==(seed&3)?0:0x10203040+i;
|
|
*(uint*)(pools[p]+i*16+4)=0x23456789+i;
|
|
*(uint*)(pools[p]+i*16+8)=0x87654321^i;
|
|
*(uint*)(pools[p]+i*16+12)=0x89abcdef^(seed<<8)^i;
|
|
}
|
|
for(uint level=0;level<8;level++)for(uint slot=0;slot<37;slot++){
|
|
uint i=level*37+slot,idx=p*296+i;
|
|
*(uint*)objects[idx]=idx+1;*(long*)(objects[idx]+8)=(long)callback;
|
|
*(long*)(nodes[idx]+8)=(long)objects[idx];nodes[idx][0x28]=0xa5^(byte)(idx*3+seed);
|
|
if(seed==0 || (i*13+seed*7+p)%5<2)*(long*)(pools[p]+0x5b58+level*0x5370+slot*8)=(long)nodes[idx];
|
|
}
|
|
}
|
|
_nv021074rm(1,(long)owner);
|
|
mix(calls);mix(*(long*)(owner+0x8a0)==(long)pools[0]?1:2);
|
|
for(uint p=0;p<2;p++){
|
|
mix(pools[p][0x2a490]);
|
|
for(uint i=0;i<130;i++)for(uint j=0;j<4;j++)mix(*(uint*)(pools[p]+i*16+j*4));
|
|
for(uint o=0x820;o<=0x828;o+=8){uint64_t v=*(uint64_t*)(pools[p]+o);mix(v);mix(v>>32);}
|
|
}
|
|
for(uint i=0;i<592;i++)mix(nodes[i][0x28]);cases++;
|
|
}
|
|
printf("%u %016lx\n",cases,(unsigned long)hash);return 0;
|
|
}
|