Commit 64fc110
committed
composefs-ctl: Add require_signature mount option to varlink Mount/OciMount
Out-of-tree container-lifecycle clients (e.g. composefs-run) want to
request a mount fd and know the kernel actually verified a fs-verity
signature was enrolled on the image, without re-implementing that
check themselves against the repository on the side. Right now the
varlink `Mount`/`OciMount` methods have no way to express that
requirement: a caller can only check signature enrollment out-of-band
and race the mount, or trust the caller of the mount to have done so.
Give `MountParams` an optional `require_signature` field. When set,
`run_mount`/`run_oci_mount` call `has_verity_signature()` on the
freshly-opened image fd before mounting, and refuse with a new
`SignatureRequired` error (added per-interface, so `RepositoryError`
and `OciError` each get their own variant) if the image has fs-verity
enabled but no signature was enrolled. This only checks that *some*
signature exists, matching the kernel's own `.fs-verity` keyring
enforcement at read time; it does not perform certificate-trust
validation, which remains the job of the separate Seal/Sign/Verify
methods.
The field defaults to `None`/unset so existing callers and the wire
format are unaffected.
Adds a real varlink-wire-protocol integration test (a typed OciProxy
client talking to a spawned `cfsctl oci varlink` server over its Unix
socket) covering all three cases: a signed, kernel-enrolled image mounts
successfully with the flag set, an unsigned image is refused with
`SignatureRequired`, and the same unsigned image mounts fine when the
flag is left unset.1 parent fb79e92 commit 64fc110
3 files changed
Lines changed: 298 additions & 4 deletions
File tree
- crates
- composefs-ctl/src
- composefs-integration-tests/src/tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
132 | 138 | | |
133 | 139 | | |
134 | 140 | | |
| |||
460 | 466 | | |
461 | 467 | | |
462 | 468 | | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
463 | 479 | | |
464 | 480 | | |
465 | 481 | | |
| |||
504 | 520 | | |
505 | 521 | | |
506 | 522 | | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
507 | 540 | | |
508 | 541 | | |
509 | 542 | | |
510 | 543 | | |
511 | 544 | | |
512 | 545 | | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
513 | 562 | | |
514 | 563 | | |
515 | 564 | | |
| |||
555 | 604 | | |
556 | 605 | | |
557 | 606 | | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
558 | 623 | | |
559 | 624 | | |
560 | 625 | | |
| |||
1058 | 1123 | | |
1059 | 1124 | | |
1060 | 1125 | | |
1061 | | - | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
1062 | 1129 | | |
1063 | 1130 | | |
1064 | 1131 | | |
| |||
1228 | 1295 | | |
1229 | 1296 | | |
1230 | 1297 | | |
1231 | | - | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
1232 | 1301 | | |
1233 | 1302 | | |
1234 | 1303 | | |
| |||
1457 | 1526 | | |
1458 | 1527 | | |
1459 | 1528 | | |
1460 | | - | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
1461 | 1532 | | |
1462 | 1533 | | |
1463 | 1534 | | |
| |||
2180 | 2251 | | |
2181 | 2252 | | |
2182 | 2253 | | |
| 2254 | + | |
| 2255 | + | |
| 2256 | + | |
| 2257 | + | |
| 2258 | + | |
| 2259 | + | |
2183 | 2260 | | |
2184 | 2261 | | |
2185 | 2262 | | |
| |||
2199 | 2276 | | |
2200 | 2277 | | |
2201 | 2278 | | |
| 2279 | + | |
| 2280 | + | |
| 2281 | + | |
2202 | 2282 | | |
2203 | 2283 | | |
2204 | 2284 | | |
| |||
2223 | 2303 | | |
2224 | 2304 | | |
2225 | 2305 | | |
| 2306 | + | |
| 2307 | + | |
2226 | 2308 | | |
2227 | 2309 | | |
2228 | 2310 | | |
| |||
2345 | 2427 | | |
2346 | 2428 | | |
2347 | 2429 | | |
| 2430 | + | |
| 2431 | + | |
| 2432 | + | |
| 2433 | + | |
| 2434 | + | |
| 2435 | + | |
| 2436 | + | |
| 2437 | + | |
| 2438 | + | |
| 2439 | + | |
| 2440 | + | |
2348 | 2441 | | |
2349 | 2442 | | |
2350 | 2443 | | |
| |||
Lines changed: 170 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1529 | 1529 | | |
1530 | 1530 | | |
1531 | 1531 | | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + | |
| 1667 | + | |
| 1668 | + | |
| 1669 | + | |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
| 1688 | + | |
| 1689 | + | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
| 1696 | + | |
| 1697 | + | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
1532 | 1702 | | |
1533 | 1703 | | |
1534 | 1704 | | |
| |||
0 commit comments