testamentaria commited on
Commit
26d759a
·
verified ·
1 Parent(s): 01a1126

Upload 2 files

Browse files
divzero_run_output.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ H5HF__dtable_lookup: off / start_block_size = 100 / 0 ->
poc_fractalheap_divzero.c ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Isolated reproduction of bug #2: division by zero in H5HF__dtable_lookup (H5HFdtable.c:149)
2
+ * if start_block_size == 0 (attacker-controlled, read raw from the file). */
3
+ #include <stdio.h>
4
+
5
+ int main(void) {
6
+ unsigned malicious_start_block_size = 0; /* read raw from a malicious fractal-heap header */
7
+ unsigned off = 100; /* any offset within what would be the first row */
8
+ printf("H5HF__dtable_lookup: off / start_block_size = %u / %u -> ", off, malicious_start_block_size);
9
+ fflush(stdout);
10
+ unsigned col = off / malicious_start_block_size; /* H5HFdtable.c:149, SIGFPE on x86 for integer division by zero */
11
+ printf("%u (unreachable if division by zero traps, as it does on x86)\n", col);
12
+ return 0;
13
+ }