Commit 227c340
firmware: arm_ffa: Bound PARTITION_INFO_GET_REGS copies
The register-based PARTITION_INFO_GET path trusted the firmware-provided
indices when copying partition descriptors into the caller buffer.
Reject inconsistent counts or index progressions so the copy loop cannot
write past the allocated array.
Fixes: ba85c64 ("firmware: arm_ffa: Add support for FFA_PARTITION_INFO_GET_REGS")
Link: https://patch.msgid.link/20260428-ffa_fixes-v2-6-8595ae450034@kernel.org
(fixed cur_idx when exactly one descriptor in the first fragment)
Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
(cherry picked from commit 3974ea1)
Signed-off-by: Jamie Nguyen <jamien@nvidia.com>1 parent 42cad5f commit 227c340
1 file changed
Lines changed: 23 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
321 | 327 | | |
322 | 328 | | |
323 | 329 | | |
324 | 330 | | |
325 | 331 | | |
326 | 332 | | |
327 | 333 | | |
328 | | - | |
| 334 | + | |
329 | 335 | | |
330 | 336 | | |
331 | 337 | | |
332 | 338 | | |
333 | 339 | | |
334 | | - | |
335 | | - | |
336 | | - | |
| 340 | + | |
337 | 341 | | |
338 | 342 | | |
339 | 343 | | |
| |||
349 | 353 | | |
350 | 354 | | |
351 | 355 | | |
| 356 | + | |
| 357 | + | |
352 | 358 | | |
353 | 359 | | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
354 | 371 | | |
355 | 372 | | |
356 | 373 | | |
357 | 374 | | |
358 | 375 | | |
359 | 376 | | |
360 | | - | |
| 377 | + | |
361 | 378 | | |
362 | 379 | | |
363 | 380 | | |
| |||
375 | 392 | | |
376 | 393 | | |
377 | 394 | | |
378 | | - | |
| 395 | + | |
379 | 396 | | |
380 | 397 | | |
381 | 398 | | |
| |||
0 commit comments