mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
core/bpf-firewall: add missing oom check
Fixes CID#1464627.
This commit is contained in:
@@ -657,7 +657,9 @@ static int attach_custom_bpf_progs(Unit *u, const char *path, int attach_type, S
|
||||
assert(u);
|
||||
|
||||
set_clear(*set_installed);
|
||||
set_ensure_allocated(set_installed, &bpf_program_hash_ops);
|
||||
r = set_ensure_allocated(set_installed, &bpf_program_hash_ops);
|
||||
if (r < 0)
|
||||
return log_oom();
|
||||
|
||||
SET_FOREACH_MOVE(prog, *set_installed, *set) {
|
||||
r = bpf_program_cgroup_attach(prog, attach_type, path, BPF_F_ALLOW_MULTI);
|
||||
|
||||
Reference in New Issue
Block a user