CVE-2021-47488 in Linux
요약
\~에 의해 VulDB • 2026. 06. 01.
리눅스 커널에서 다음 취약점이 해결되었습니다:
cgroup: 누락된 cgroup_bpf_offline로 인한 메모리 누수 수정
CONFIG_CGROUP_BPF를 활성화한 상태에서 다음 명령어를 실행하면 kmemleak을 통해 메모리 누수를 관찰할 수 있습니다:
$mount -t cgroup -o none,name=foo cgroup cgroup/ $umount cgroup/
미사용 객체 0xc3585c40 (크기 64): comm "mount", pid 425, jiffies 4294959825 (수명 31.990초) 16진수 덤프 (첫 32바이트): 01 00 00 80 84 8c 28 c0 00 00 00 00 00 00 00 00 ......(......... 00 00 00 00 00 00 00 00 6c 43 a0 c3 00 00 00 00 ........lC...... 백트레이스: [] cgroup_bpf_inherit+0x44/0x24c
[] cgroup_setup_root+0x174/0x37c
[] cgroup1_get_tree+0x2c0/0x4a0
[] vfs_get_tree+0x24/0x108
[] path_mount+0x384/0x988
[] do_mount+0x64/0x9c
[] sys_mount+0xfc/0x1f4
[] ret_fast_syscall+0x0/0x48
[] 0xbeb4daa8
이 문제는 커밋 2b0d3d3e4fcf("percpu_ref: fast path에서 percpu_ref의 메모리 사용량 축소") 이후, 마운트 시 cgroup_setup_root에 의해 호출되는 cgroup_bpf_inherit 함수 내에서 root_cgrp->bpf.refcnt.data가 percpu_ref_init 함수에 의해 할당되었지만, umount 시 root_cgrp와 함께 해제되지 않기 때문에 발생합니다. percpu_ref_kill을 호출하는 cgroup_bpf_offline를 cgroup_kill_sb에 추가하면 umount 경로에서 root_cgrp->bpf.refcnt.data를 해제할 수 있습니다.
이 패치는 또한 커밋 4bfc0bb2c60e("bpf: cgroup_bpf의 수명을 cgroup 자체에서 분리")도 수정합니다. cgroup_setup_root에서 cgroup_bpf_inherit에 의해 할당된 리소스를 해제하는 정리를 수행하기 위해 cgroup_bpf_offline가 필요합니다.
또한 cgroup_bpf_offline 내부에서는 cgroup_bpf_offline에 의해 호출되는 cgroup_bpf_release의 시작 부분에 cgroup_get()이 있고, 끝에 cgroup_put가 있습니다. 따라서 cgroup_bpf_offline는 cgroup의 참조 카운트(refcount) 균형을 유지할 수 있습니다.
Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.