| 143 | #endif |
| 144 | |
| 145 | static bool check_with_maps(struct ptr_valid_batch *batch, |
| 146 | const char *p, size_t size, bool is_write) |
| 147 | { |
| 148 | unsigned int i; |
| 149 | |
| 150 | for (i = 0; i < batch->num_maps; i++) { |
| 151 | if (p >= batch->maps[i].start && p < batch->maps[i].end) { |
| 152 | /* Overlap into other maps? Recurse with remainder. */ |
| 153 | if (p + size > batch->maps[i].end) { |
| 154 | size_t len = p + size - batch->maps[i].end; |
| 155 | if (!check_with_maps(batch, batch->maps[i].end, |
| 156 | len, is_write)) |
| 157 | return false; |
| 158 | } |
| 159 | return !is_write || batch->maps[i].is_write; |
| 160 | } |
| 161 | } |
| 162 | return false; |
| 163 | } |
| 164 | |
| 165 | static void finish_child(struct ptr_valid_batch *batch) |
| 166 | { |