3 - open some files in the child too after forking.
4 - this requires a child-local fd mapping table.
5 Maybe we can then reduce the size of the shared shm->file_fds
6 - When requesting an fd, occasionally generate a new one.
7 - Could we do the nftw walks in parallel ?
8 That would speed up startup a lot. Though would need to pass list back up to main thread somehow.
9 - support for multiple victim file parameters
10 - When picking a random path, instead of treating the pool of paths as one thing,
11 treat it as multiple (/dev, /sys, /proc). And then do a 1-in-3 chance
12 of getting one of those. Right now, because there are 5-6 digits worth of /proc & /sys,
13 they dominate over the /dev entries.
14 - more fd 'types' (fanotify_init)
15 - Add a parameter to specify only certain fd types. --fds=sockets,files
17 * Change regeneration code.
18 - Instead of every n syscalls, make it happen after 15 minutes (but with a minimum of n syscalls)
19 - setsockopt on network sockets periodically
20 Disabled right now, because it causes some socket types to hang.
22 * Networking improvements.
23 - Rewrite socket generation.
24 Organise into (sorted) per-protocol buckets of linked-lists..
25 - Search buckets for dupes before adding.
26 - for syscalls that take a fd and a sockaddr, look up the triplet and match.
27 - Flesh out sockaddr/socket gen for all remaining protocols.
29 * Flesh out the child ops some more
30 - move away from 'syscall counts' towards 'iteration count'
31 - Add more things that a real program would do.
33 - open->mmap->access mem->close
35 - pick random elevator alg for all queues
36 - fork-and-dirty mappings
37 - Ability to mark some ops as 'NEEDS_ROOT'.
38 - Move the drop privs code from main to just before we start a new child.
41 - needs filename globbing for some ioctls
42 - Sanitise routines for more ioctls
44 - Maybe just make the ioctl's be NEED_ROOT child ops
46 * Improve the ->post routine to walk a list of objects that we allocated during a
47 syscalls ->sanitise in a ->post method.
48 - On return from the syscall, we don't call the destructor immediately.
49 We pick a small random number, and do N other syscalls before we do the destruction.
50 This requires us to create a list of work to be done later, along with a pointer
51 to any allocated data.
52 - some ancillary data needs to be destroyed immediately after the syscall
53 (it's pointless keeping around mangled pathnames for eg).
54 For this, we just destroy it in ->post
55 - Right now ->sanitise routines have to pick either a map, or malloc itself and
56 do the right thing to free it in ->post. By tagging what the allocation type was in
57 generic-sanitise, we can do multiple types.
59 * Some debugging enhancements.
60 - dump_child_state(childno), to debug a specific child. (Dump all a childs shm arrays)
61 - Make -D use a separate debug log file
64 - If we have logging disabled, we don't have a clue really what happened if we taint, and exit.
65 Store a ringbuffer of the last few syscalls, and dump it before we exit.
66 - Compare timestamp that taint was noticed at, ignore all later.
67 - Do taint watching in the child loop too.
69 * Pretty-print improvements.
70 - decode fd number -> filename in output
71 - decode addresses when printing them out to print 'page_rand+4' instead of a hex address.
72 - ->decode_argN functions to print decoded flags etc.
75 * Watchdog improvements
76 - in main loop, check watchdog is still alive
79 * filename related issues.
81 Similar to the socketcache. Create on startup, then on loading, invalidate entries
82 that aren't present (/proc/pid etc).
83 This should improve reproducability in some cases. Right now, when a syscall
84 says "open the 5231st filename in the list", it differs across runs because we're
85 rebuilding the list, and the system state means stuff moves around.
86 - Add a way to add a filter to filelist.
87 ie, something like --filter-files=*[0-9]* to ignore all files with numbers in them.
88 - Dump filelist to a logfile. (Perhaps this ties in with the idea above to cache the filelist?)
89 - blacklist filenames for victim path & /proc/self/exe
90 - make sure we don't call unlink() or rmdir() on them
91 - also need to watch /proc/$$/exe, look up using shm->pids.
92 - file list struct extensions
95 * --dry-run mode. (need to work around segv's when we do things like mmap->post and register null maps)
97 * maps.c improvements:
98 - Sometimes generate overlapping addresses/lengths when we have ARG_ADDRESS/ARG_ADDRESS2 pairs
99 - make sure ARG_ADDRESS only uses addresses from this list, and audit all other mmap/malloc uses
100 in sanitise routines.
101 - munge lengths when handing them out.
102 - more access patterns
104 (we do this already, but don't track it properly)
106 - mprotect parts of a map
107 will need to somehow track what pages are RO/RW etc
108 - keep track of holes when munmap'd
110 (store original len, and current len)
113 x86-64: Build both a 64bit and a 32bit executable.
114 *: Move arch specific syscalls into syscalls/arch/
115 *: Move addresses in get_interesting_value() to a function in per-arch headers.
117 * Perform some checks on return from syscall
118 - check padding between struct members is zeroed.
120 * munge_process() on child startup
121 - replace fork() with random clone()
122 - run children in different namespaces, personalities.
125 * Output errno distribution on exit
127 * allow for multiple -G's (after there is more than 'vm')
129 * audit which syscalls never succeed, and write sanitise routines for them
131 * if a read() blocks and we get a kill from the watchdog, blacklist (close?) that fd/filename.
134 - specify an ip of a victim machine
135 - exclude file list for (certain sysfs files for eg)
136 - parameter to bias the randomness passed to length parameters.
137 Right now it's hardwired to return 16 bit 70% of the time.
138 (and 32bit in the 64bit path)
139 - parameter for the dir/file randomness bias
141 * Some of the syscalls marked AVOID are done so for good reason.
142 - Revisit fuzzing ptrace.
143 - It's disabled currently because of situations like..
144 child a traces child b
146 child b never proceeds, and doesn't get untraced.
148 * Further syscall annotation improvements
149 - Finish annotating syscall return types
151 * structured logging.
152 - To begin with, in parallel with existing text based logging.
153 - Basic premise is that we store records of each syscall in a manner that would
154 allow easier replay of logs.
155 - For eg, if a param is an fd, we store the type (socket/file/etc..)
156 as well as a pathname/socket triplet/whatever to create it.
157 - Eventually, kill off the text based logging, and replace it with
158 ./trinity --parselog=mylog.bin
159 - Done correctly, this should allow automated bisecting of replays.
160 - Different replay strategies:
161 - replay log in reverse order
162 - brute force replay using 1 call at a time from beginning of log + last syscall.
163 (possibly unnecessary if the above strategies are good enough)
164 - Once bisected, have a tool that can parse the binary log, and generate C.
165 - Would need a separate binary logfile for each child.
166 Because locking on a shared file would slow things down, and effectively single
167 thread things, unless the children pass things to a separate logger thread, which
168 has its own problems like potentially losing the last N syscalls if we crash)
169 - To begin with, just allow replay/bisect using one child process.
170 Synchronising threads across different runs may be complicated.
173 - syscall.c:syscall32() hide the assembly in a macro in arch-*.h and only do it
174 #ifdef HAVE_SYSCALL_32
176 * watch dmesg buffer for interesting kernel messages and halt if necessary. Lockdep for eg.
178 Sometimes we might want to read trinity state when we trigger a bad event.
180 * Blocked child improvements.
181 - if we find a blocking fd, check if it's a socket, and shutdown() it.
182 (tricky: we need to do the shutdown in the main process, and then tell other children)
184 * Backwards compatability improvements.
185 Move some of the ifdef's into header files.
187 * make -p take an arg for seconds