🇰🇷 한글 설명
Linux 커널의 xfrm 구성 요소에서 lookup과 resize 작업이 병렬로 실행될 때 경계 외 읽기(out-of-bounds read)가 발생하는 취약점입니다. 해시 테이블의 크기가 변경되는 과정에서 해시 마스크 값이 새로운 배열 크기보다 크게 관찰될 수 있어 메모리 접근 오류를 유발할 수 있습니다.
💡 쉬운 설명
컴퓨터가 데이터를 찾기 위해 사용하는 목록의 크기가 갑자기 변할 때, 잘못된 위치를 읽으려고 시도하여 오류가 발생하는 문제입니다. 이로 인해 시스템이 불안정해지거나 예상치 못한 동작을 할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
xfrm: state: fix out-of-bounds read during lookup
lookup and resize can run in parallel.
The xfrm_state_hash_generation seqlock ensures a retry, but the hash
functions can observe a hmask value that is too large for the new hlist
array.
rehash does:
rcu_assign_pointer(net->xfrm.state_bydst, ndst) [..]
net->xfrm.state_hmask = nhashmask;
While state lookup does:
h = xfrm_dst_hash(net, daddr, saddr, tmpl->reqid, encap_family);
hlist_for_each_entry_rcu(x, net->xfrm.state_bydst + h, bydst) {
This is only safe in case the update to state_bydst is larger than
net->xfrm.xfrm_state_hmask (or if the lookup function gets
serialized via state spinlock again).
Fix this by prefetching state_hmask and the associated pointers.
The xfrm_state_hash_generation seqlock retry will ensure that the pointer
and the hmask will be consistent.
The existing helpers, like xfrm_dst_hash(), are now unsafe for RCU side,
add lockdep assertions to document that they are only safe for insert
side.
xfrm_state_lookup_byaddr() uses the spinlock rather than RCU.
AFAICS this is an oversight from back when state lookup was converted to
RCU, this lock should be replaced with RCU in a future patch.
📍 영향받는 시스템
Linux Kernel (xfrm 구성 요소가 포함된 버전)
⚔️ 공격 벡터
병렬로 실행되는 xfrm 상태 조회 및 재해싱 과정을 이용한 메모리 경계 외 읽기 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하십시오.
🔧 검증 코드
출력된 커널 버전을 확인하여 해당 취약점이 해결된 최신 패치 버전인지 확인하십시오.