diff options
author | Pavel Tikhomirov <ptikhomirov@virtuozzo.com> | 2022-10-20 18:25:11 +0300 |
---|---|---|
committer | Andrei Vagin <avagin@gmail.com> | 2022-10-25 17:30:44 +0300 |
commit | 18c6426eaeebc5fe7d0f9ca0acb592a3ec828b0c (patch) | |
tree | 2e6c0d3a2382ae9ca8152468184db00d31a8aedc | |
parent | 8cf8fe884c3ed8d73cfc9ae30722d1b2e4db51cd (diff) |
cgroup: add a comment to restore_cgroup_prop about path argument requirements
In Virtuozzo we've faced out-of-bound access when calling this function
on short path string, which corrupted other memory and lead to
segmentation fault. So it may be useful to have this comment in code to
avoid such a missuse of this function in future.
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
-rw-r--r-- | criu/cgroup.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/criu/cgroup.c b/criu/cgroup.c index d886ce9f2..6f6117c21 100644 --- a/criu/cgroup.c +++ b/criu/cgroup.c @@ -1303,6 +1303,10 @@ static int restore_perms(int fd, const char *path, CgroupPerms *perms) return 0; } +/* + * Note: The path string can be modified in this function, + * the length of path string should be at least PATH_MAX. + */ static int restore_cgroup_prop(const CgroupPropEntry *cg_prop_entry_p, char *path, int off, bool split_lines, bool skip_fails) { |