🇰🇷 한글 설명
Linux 커널의 batman-adv 모듈에서 발생한 취약점으로, 요청 상태 확인과 요청 수(num_requests) 업데이트가 원자적으로 이루어지지 않아 발생하는 TOCTOU(Time-of-Check to Time-of-Use) 문제입니다. 여러 프로세스가 동시에 실행될 때 요청 수가 중복으로 감소하거나 상태가 꼬이는 현상이 발생할 수 있습니다.
💡 쉬운 설명
데이터를 처리하는 과정에서 순서가 꼬여 숫자가 잘못 계산되는 오류가 있습니다. 이로 인해 시스템이 요청을 제대로 관리하지 못하고 오작동할 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
batman-adv: bla: avoid double decrement of bla.num_requests
The bla.num_requests is increased when no request_sent was in progress. And
it is decremented in various places (announcement was received, backbone is
purged, periodic work). But the check if the request_sent is actually set
to a specific state and the atomic_dec/_inc are not safe because they are
not atomic (TOCTOU) and multiple such code portions can run concurrently.
At the same time, it is necessary to modify request_sent (state) and
bla.num_requests atomically. Otherwise batadv_bla_send_request() might set
request_sent to 1 and is interrupted. batadv_handle_announce() can then
set request_sent back to 0 and decrement num_requests before
batadv_bla_send_request() incremented it.
The two operations must therefore be locked. And since state (request_sent)
and wait_periods are only accessed inside this lock, they can be converted
to simpler datatypes. And to avoid that the bla.num_requests is touched by
a parallel running context with a valid backbone_gw reference after
batadv_bla_purge_backbone_gw() ran, a third state "stopped" is required to
correctly signal that a backbone_gw is in the state of being cleaned up.
📍 영향받는 시스템
Linux kernel (batman-adv 모듈을 사용하는 버전)
⚔️ 공격 벡터
동시성 제어 미흡을 이용한 레이스 컨디션(Race Condition) 공격
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하십시오.
🔧 검증 코드
출력된 커널 버전을 확인하여 해당 취약점이 해결된 패치 버전인지 확인하십시오.