mirror of
https://git.proxmox.com/git/mirror_iproute2
synced 2025-08-17 06:26:33 +00:00
lib: fix checking of returned file handle size for cgroup
Before this patch check is happened only in case when we try to find
cgroup at cgroup2 mount point.
v2:
- add Fixes line before Signed-off-by (David Ahern)
Fixes: d5e6ee0dac
("ss: introduce cgroup2 cache and helper functions")
Signed-off-by: Dmitry Yakunin <zeil@yandex-team.ru>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
This commit is contained in:
parent
9e5d246877
commit
8f1cd119b3
2
lib/fs.c
2
lib/fs.c
@ -148,11 +148,11 @@ __u64 get_cgroup2_id(const char *path)
|
|||||||
strerror(errno));
|
strerror(errno));
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (fhp->handle_bytes != sizeof(__u64)) {
|
if (fhp->handle_bytes != sizeof(__u64)) {
|
||||||
fprintf(stderr, "Invalid size of cgroup2 ID\n");
|
fprintf(stderr, "Invalid size of cgroup2 ID\n");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
memcpy(cg_id.bytes, fhp->f_handle, sizeof(__u64));
|
memcpy(cg_id.bytes, fhp->f_handle, sizeof(__u64));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user