checkpoint: resolve symlink for external bind mount(fix ci broken)

runc resolves symlink before doing bind mount. So
we should save original path while formatting CriuReq for
dump and restore.

"checkpoint: resolve symlink for external bind mount" is merged as
da22625f6986f0ef196eaa1f8bb6adce098f0fb7(PR 2902) previously. And reverted
in commit 70fdc0573dced3464e9c31d674559f77c1de3973(PR 3043) duo to behavior changes
caused by commit 0ca91f44f1664da834bc61115a849b56d22f595f(Fixes: CVE-2021-30465)

Signed-off-by: Liu Hua <weldonliu@tencent.com>
This commit is contained in:
Liu Hua
2021-06-28 20:06:59 +08:00
parent 8e6871a3b1
commit 74ae9e0fc9
2 changed files with 18 additions and 1 deletions
+12 -1
View File
@@ -126,7 +126,18 @@ function simple_cr() {
done
}
@test "checkpoint and restore " {
@test "checkpoint and restore" {
simple_cr
}
@test "checkpoint and restore (bind mount, destination is symlink)" {
mkdir -p rootfs/real/conf
ln -s /real/conf rootfs/conf
update_config ' .mounts += [{
source: ".",
destination: "/conf",
options: ["bind"]
}]'
simple_cr
}