Commit ac7b8bc
Roy Lin
fix(box): avoid CString panic on a NUL workdir without a rootfs
configure_child_process built a CString from the working directory
unconditionally and .expect()ed it, but build_command only rejects an
embedded NUL in the workdir when a rootfs is set. A rootfs-less exec with
a NUL byte in working_dir could therefore panic the exec connection
thread. The workdir CString is now built only when a rootfs is present
(its sole use is chdir after chroot), where the NUL was already rejected.
Closes the last of the 16 findings from this session's adversarial review.
Verified: build + clippy clean; ReadonlyPaths / seccomp-default / RunAsUser
critest specs still pass (chroot+rootfs exec path unaffected).1 parent 48d5816 commit ac7b8bc
1 file changed
Lines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
851 | 851 | | |
852 | 852 | | |
853 | 853 | | |
854 | | - | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
855 | 861 | | |
856 | 862 | | |
857 | 863 | | |
| |||
870 | 876 | | |
871 | 877 | | |
872 | 878 | | |
873 | | - | |
874 | | - | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
875 | 883 | | |
876 | 884 | | |
877 | 885 | | |
| |||
0 commit comments