🇰🇷 한글 설명
Linux 커널의 mscc: ocelot 드라이버에서 ocelot_ifh_set_basic() 함수가 SRC_PORT 필드에 잘못된 값을 설정하는 취약점이 발견되었습니다. 포트 마스크가 아닌 단일 포트 인덱스가 들어가야 할 자리에 비트 마스크 값이 입력되어 데이터 패킹 과정에서 오류가 발생하고 시스템 경고가 발생합니다.
💡 쉬운 설명
네트워크 장치를 제어하는 소프트웨어에서 데이터 주소를 잘못 계산하여 시스템에 오류를 일으키는 문제입니다. 이로 인해 네트워크 전송이 중단되거나 시스템 경고 메시지가 나타날 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
net: mscc: ocelot: fix incorrect IFH SRC_PORT field in ocelot_ifh_set_basic()
Packets injected by the CPU should have a SRC_PORT field equal to the
CPU port module index in the Analyzer block (ocelot->num_phys_ports).
The blamed commit copied the ocelot_ifh_set_basic() call incorrectly
from ocelot_xmit_common() in net/dsa/tag_ocelot.c. Instead of calling
with "x", it calls with BIT_ULL(x), but the field is not a port mask,
but rather a single port index.
[ side note: this is the technical debt of code duplication :( ]
The error used to be silent and doesn't appear to have other
user-visible manifestations, but with new changes in the packing
library, it now fails loudly as follows:
------------[ cut here ]------------
Cannot store 0x40 inside bits 46-43 - will truncate
sja1105 spi2.0: xmit timed out
WARNING: CPU: 1 PID: 102 at lib/packing.c:98 __pack+0x90/0x198
sja1105 spi2.0: timed out polling for tstamp
CPU: 1 UID: 0 PID: 102 Comm: felix_xmit
Tainted: G W N 6.13.0-rc1-00372-gf706b85d972d-dirty #2605
Call trace:
__pack+0x90/0x198 (P)
__pack+0x90/0x198 (L)
packing+0x78/0x98
ocelot_ifh_set_basic+0x260/0x368
ocelot_port_inject_frame+0xa8/0x250
felix_port_deferred_xmit+0x14c/0x258
kthread_worker_fn+0x134/0x350
kthread+0x114/0x138
The code path pertains to the ocelot switchdev driver and to the felix
secondary DSA tag protocol, ocelot-8021q. Here seen with ocelot-8021q.
The messenger (packing) is not really to blame, so fix the original
commit instead.
📍 영향받는 시스템
Linux kernel (mscc: ocelot switchdev driver 및 felix secondary DSA tag protocol 사용 환경)
⚔️ 공격 벡터
직접적인 외부 공격보다는 잘못된 데이터 처리로 인한 시스템 서비스 거부(DoS) 또는 커널 경고 발생 가능성
🛡️ 대응 방법
Linux 커널을 최신 패치가 적용된 버전으로 업데이트하여 ocelot_ifh_set_basic() 함수의 수정 사항을 반영해야 합니다.
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인합니다.