Commit cf89a8a
fix: potential underflow in AML bytecode creation
acpi_tables::aml::AddressSpace<T> type is describing an address space
with a minimum address `min: T` and a maximum address `max: T`.
Currently, we do not perform any checks on these values when creating
the AddressSpace objects. This means that the starting address `min` can
be bigger than the last address `max`, which can cause underflows when
calculating the length of this address space, i.e. `max - min + 1`.
Add a check in the constructor methods of AddressSpace objects and
return an error when `min > max`.
Signed-off-by: Babis Chalios <[email protected]>1 parent c9009f1 commit cf89a8a
1 file changed
+42
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
420 | 422 | | |
421 | 423 | | |
422 | 424 | | |
423 | | - | |
424 | | - | |
425 | | - | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
426 | 439 | | |
427 | 440 | | |
428 | 441 | | |
429 | 442 | | |
430 | | - | |
| 443 | + | |
431 | 444 | | |
432 | 445 | | |
433 | | - | |
434 | | - | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
435 | 451 | | |
436 | 452 | | |
437 | 453 | | |
438 | 454 | | |
439 | | - | |
| 455 | + | |
440 | 456 | | |
441 | 457 | | |
442 | | - | |
443 | | - | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
444 | 463 | | |
445 | 464 | | |
446 | 465 | | |
447 | 466 | | |
448 | | - | |
| 467 | + | |
449 | 468 | | |
450 | 469 | | |
451 | 470 | | |
| |||
1340 | 1359 | | |
1341 | 1360 | | |
1342 | 1361 | | |
1343 | | - | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
1344 | 1365 | | |
1345 | 1366 | | |
1346 | 1367 | | |
| |||
1360 | 1381 | | |
1361 | 1382 | | |
1362 | 1383 | | |
1363 | | - | |
1364 | | - | |
| 1384 | + | |
| 1385 | + | |
1365 | 1386 | | |
1366 | 1387 | | |
1367 | 1388 | | |
| |||
1388 | 1409 | | |
1389 | 1410 | | |
1390 | 1411 | | |
1391 | | - | |
| 1412 | + | |
| 1413 | + | |
1392 | 1414 | | |
1393 | 1415 | | |
1394 | 1416 | | |
1395 | 1417 | | |
1396 | 1418 | | |
1397 | | - | |
| 1419 | + | |
| 1420 | + | |
1398 | 1421 | | |
1399 | 1422 | | |
1400 | 1423 | | |
| |||
1420 | 1443 | | |
1421 | 1444 | | |
1422 | 1445 | | |
1423 | | - | |
| 1446 | + | |
| 1447 | + | |
1424 | 1448 | | |
1425 | 1449 | | |
1426 | 1450 | | |
| |||
1988 | 2012 | | |
1989 | 2013 | | |
1990 | 2014 | | |
1991 | | - | |
| 2015 | + | |
| 2016 | + | |
1992 | 2017 | | |
1993 | 2018 | | |
1994 | 2019 | | |
| |||
0 commit comments