🇰🇷 한글 설명
Linux 커널의 eventpoll 구성 요소에서 재귀 호출 깊이가 제한되지 않는 취약점이 발견되었습니다. epoll 인스턴스 간의 그래프 구조가 EP_MAX_NESTS+1 링크보다 깊어지는 것을 방지하지 못해 시스템 자원 고갈을 초래할 수 있습니다.
💡 쉬운 설명
컴퓨터가 복잡한 연결 고리를 처리할 때 끝없이 반복되는 계산에 빠져 시스템이 멈출 수 있는 문제입니다. 이를 방지하기 위해 연결 고리의 최대 길이를 제한하는 보안 패치가 적용되었습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
eventpoll: Fix semi-unbounded recursion
Ensure that epoll instances can never form a graph deeper than
EP_MAX_NESTS+1 links.
Currently, ep_loop_check_proc() ensures that the graph is loop-free and
does some recursion depth checks, but those recursion depth checks don't
limit the depth of the resulting tree for two reasons:
- They don't look upwards in the tree.
- If there are multiple downwards paths of different lengths, only one of
the paths is actually considered for the depth check since commit
28d82dc1c4ed ("epoll: limit paths").
Essentially, the current recursion depth check in ep_loop_check_proc() just
serves to prevent it from recursing too deeply while checking for loops.
A more thorough check is done in reverse_path_check() after the new graph
edge has already been created; this checks, among other things, that no
paths going upwards from any non-epoll file with a length of more than 5
edges exist. However, this check does not apply to non-epoll files.
As a result, it is possible to recurse to a depth of at least roughly 500,
tested on v6.15. (I am unsure if deeper recursion is possible; and this may
have changed with commit 8c44dac8add7 ("eventpoll: Fix priority inversion
problem").)
To fix it:
1. In ep_loop_check_proc(), note the subtree depth of each visited node,
and use subtree depths for the total depth calculation even when a subtree
has already been visited.
2. Add ep_get_upwards_depth_proc() for similarly determining the maximum
depth of an upwards walk.
3. In ep_loop_check(), use these values to limit the total path length
between epoll nodes to EP_MAX_NESTS edges.
📍 영향받는 시스템
Linux Kernel (epoll 관련 모듈이 포함된 버전)
⚔️ 공격 벡터
특수하게 조작된 epoll 인스턴스 간의 연결 구조를 생성하여 커널의 재귀 호출을 유도함
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 epoll 재귀 깊이 제한을 적용함
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 최신 패치 버전인지 확인합니다.