Commit 9516580
fix: handle TF_STATUS_CODE, prevent mutex deadlock, fix binder token writing
Bug 3: In BR_REPLY handling, check the TF_STATUS_CODE flag (0x08).
When set, the 4-byte reply data is a kernel status_t error code,
not a regular parcel. Added tfStatusCode constant to protocol.go.
Bug 4: Transact() held d.mu for the entire transaction (send + wait
for reply). The read loop also needs d.mu to acknowledge
BR_INCREFS/BR_ACQUIRE callbacks. If the server sends callbacks
before replying, this causes deadlock. Fixed by extracting
lockedIoctl() and scoping the mutex to individual ioctl calls.
Bug 2: IBinder fields in generated parcelable MarshalParcel would
panic on nil Token (calling .Handle() on nil). Added nil guards
that write null binder objects. Also fixed codegen to generate
these guards for all IBinder/interface parcelable fields.
Bug 1: AttributionSourceState uses @utf8InCpp String fields but
codegen wrote UTF-16 (WriteString16). Fixed by merging field-level
annotations into TypeSpecifier before marshal lookup, so @utf8InCpp
is visible to marshalForType. Manually patched attributionsourcestate.go
to use WriteString/ReadString (will be regenerated correctly now).1 parent bed0657 commit 9516580
4 files changed
Lines changed: 131 additions & 62 deletions
File tree
- android/content
- kernelbinder
- tools/pkg/codegen
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | 189 | | |
193 | 190 | | |
194 | 191 | | |
| |||
232 | 229 | | |
233 | 230 | | |
234 | 231 | | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
254 | 239 | | |
255 | 240 | | |
256 | 241 | | |
257 | | - | |
| 242 | + | |
258 | 243 | | |
259 | 244 | | |
260 | 245 | | |
| |||
269 | 254 | | |
270 | 255 | | |
271 | 256 | | |
272 | | - | |
| 257 | + | |
273 | 258 | | |
274 | 259 | | |
275 | 260 | | |
276 | 261 | | |
277 | 262 | | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
| 263 | + | |
| 264 | + | |
293 | 265 | | |
294 | 266 | | |
295 | 267 | | |
| |||
343 | 315 | | |
344 | 316 | | |
345 | 317 | | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
346 | 336 | | |
347 | 337 | | |
348 | 338 | | |
| 339 | + | |
349 | 340 | | |
350 | 341 | | |
351 | 342 | | |
352 | 343 | | |
353 | 344 | | |
354 | 345 | | |
| 346 | + | |
355 | 347 | | |
356 | 348 | | |
357 | 349 | | |
| |||
573 | 565 | | |
574 | 566 | | |
575 | 567 | | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
576 | 597 | | |
577 | 598 | | |
578 | 599 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
36 | 40 | | |
37 | 41 | | |
38 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
76 | 92 | | |
77 | 93 | | |
78 | 94 | | |
| |||
137 | 153 | | |
138 | 154 | | |
139 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
140 | 159 | | |
141 | | - | |
142 | | - | |
| 160 | + | |
| 161 | + | |
143 | 162 | | |
144 | 163 | | |
145 | 164 | | |
146 | | - | |
147 | | - | |
| 165 | + | |
| 166 | + | |
148 | 167 | | |
149 | 168 | | |
150 | 169 | | |
151 | | - | |
| 170 | + | |
152 | 171 | | |
153 | 172 | | |
154 | 173 | | |
155 | 174 | | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
161 | 194 | | |
162 | 195 | | |
163 | 196 | | |
164 | | - | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
165 | 200 | | |
166 | 201 | | |
167 | 202 | | |
| |||
227 | 262 | | |
228 | 263 | | |
229 | 264 | | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
230 | 268 | | |
231 | | - | |
232 | | - | |
| 269 | + | |
| 270 | + | |
233 | 271 | | |
234 | 272 | | |
235 | 273 | | |
236 | 274 | | |
237 | | - | |
238 | | - | |
| 275 | + | |
| 276 | + | |
239 | 277 | | |
240 | 278 | | |
241 | 279 | | |
242 | | - | |
| 280 | + | |
243 | 281 | | |
244 | 282 | | |
245 | 283 | | |
| |||
0 commit comments