criu: validate non-regular descriptor files - #5402
Conversation
|
So, we have the same issue when reading say |
58e9b3e to
227b349
Compare
We recently received a report about a similar issue with the In the CRIU project we also clarified that we assume all image files in the checkpoint to be authentic, confidential, and to have not been tampered with by an untrusted actor (i.e., we consider such issues as bugs): https://github.com/checkpoint-restore/criu/blob/criu-dev/Documentation/under-the-hood/security/image-security.md
My understanding is that, in comparison to |
227b349 to
e745887
Compare
When restore opens `descriptors.json` from the checkpoint image, a FIFO at this path may block the read indefinitely, so repeated restore attempts can exhaust caller threads in container runtimes. To fix this, we should open this file through the pre-opened image directory with `O_PATH`, verify the inode is a regular file, and reopen that handle for reading. This patch also rejects symlinks and other special files, and limits the read to 1 MiB to prevent unbounded allocations. Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
e745887 to
48a3200
Compare
When restore opens
descriptors.jsonfrom the checkpoint image, a FIFO at this path may block the read indefinitely, so repeated restore attempts can exhaust caller threads in container runtimes. To fix this, we should open this file through the pre-opened image directory withO_PATH, verify the inode is a regular file, and reopen that handle for reading. This patch also rejects symlinks and other special files, and limits the read to 1 MiB to prevent unbounded allocations.