🇰🇷 한글 설명
Linux 커널의 netfilter nf_tables 구성 요소에서 비트 이동(lshift, rshift) 연산 시 목적지(dst)와 소스(src) 메모리 주소가 겹칠 경우 데이터가 오염되는 취약점이 발견되었습니다. 이로 인해 연산 과정에서 캐리(carry) 값이 잘못 계산되어 의도치 않은 결과가 발생할 수 있습니다. 이를 해결하기 위해 임시 변수를 사용하여 원본 값을 보관하고, 제어 평면에서 부분적인 메모리 중첩을 거부하도록 수정되었습니다.
💡 쉬운 설명
데이터를 왼쪽이나 오른쪽으로 밀어서 계산하는 과정에서, 입력값과 결과값이 저장되는 위치가 같으면 계산이 꼬이는 문제가 있었습니다. 이로 인해 컴퓨터가 잘못된 계산 결과를 내놓을 수 있는 보안 결함입니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
netfilter: nf_tables: fix dst corruption in same register operation
For lshift and rshift, the shift operations are performed in a loop over
32-bit words. The loop calculates the shifted value and write it to dst,
and then immediately reads from src to calculate the carry for the next
iteration. Because src and dst could point to the same memory location,
the carry is incorrectly calculated using the newly modified dst value
instead of the original src value.
Adding a temporary local variable to cache the original value before
writing to dst and using it for the carry calculation solves the
problem. In addition, partial overlap is rejected from control plane for
all kind of operations including byteorder. This was tested with the
following bytecode:
table test_table ip flags 0 use 1 handle 1
ip test_table test_chain use 3 type filter hook input prio 0 policy accept packets 0 bytes 0 flags 1
ip test_table test_chain 2
[ immediate reg 1 0x44332211 0x88776655 ]
[ bitwise reg 1 = ( reg 1 << 0x08000000 ) ]
[ cmp eq reg 1 0x66443322 0x00887766 ]
[ counter pkts 0 bytes 0 ]
ip test_table test_chain 4 3
[ immediate reg 1 0x44332211 0x88776655 ]
[ bitwise reg 1 = ( reg 1 << 0x08000000 ) ]
[ cmp eq reg 1 0x55443322 0x00887766 ]
[ counter pkts 21794 bytes 1917798 ]
📍 영향받는 시스템
Linux kernel (nf_tables 모듈을 사용하는 시스템)
⚔️ 공격 벡터
조작된 nf_tables 바이트코드를 사용하여 메모리 중첩을 유도하는 로컬 공격
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하십시오.
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인하십시오.