🇰🇷 한글 설명
Linux 커널의 OpenRISC 아키텍처에서 jump_label SMP 동기화 문제가 발견되었습니다. 원격 코어의 명령어 캐시(icache)를 적절히 무효화하지 않아 정적 키(static key) 업데이트 후에도 이전 상태의 코드가 유지될 수 있는 취약점입니다.
💡 쉬운 설명
컴퓨터의 여러 뇌(코어)가 서로 다른 정보를 가지고 있어, 프로그램의 명령어를 바꿨을 때 모든 뇌가 즉시 새로운 명령어를 알지 못하는 문제입니다. 이로 인해 시스템이 예상치 못한 동작을 하거나 보안 설정이 제대로 적용되지 않을 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
openrisc: Fix jump_label smp syncing
The original commit 8c30b0018f9d ("openrisc: Add jump label support")
copies from arm64 and does not properly consider how icache invalidation
on remote cores works in OpenRISC. On OpenRISC remote icaches need to
be invalidated otherwise static key's may remain state after updating.
Fix SMP cache syncing by:
1. Properly invalidate remote core icaches on SMP systems by using
icache_all_inv. The old code uses kick_all_cpus_sync() which runs a
no-op IPI function call on remote CPU's which does execute a lot of
code and flushes many cache lines in the process, but does not flush
all and it's not correct on OpenRISC.
2. For architectures that do not have WRITETHROUGH caches be sure
to flush the dcache after patching.
To test this I first reproduced the issue using a custom test module
[0]. The test confirmed that some icache lines maintained stale
static_key code sequences after calling static_branch_enable(). After
this patch there are no longer jump_label coherency issues.
[0] https://github.com/stffrdhrn/or1k-utils/tree/master/tests/smp_static_key_test
📍 영향받는 시스템
OpenRISC 아키텍처를 사용하는 Linux 커널 시스템
⚔️ 공격 벡터
로컬 권한을 가진 공격자가 커널의 정적 키(static key)를 조작하여 실행 흐름을 변경할 수 있음
🛡️ 대응 방법
OpenRISC의 jump_label SMP 동기화 패치가 적용된 최신 Linux 커널로 업데이트
🔧 검증 코드
출력 결과에 OpenRISC 커널 버전이 표시되면 해당 아키텍처를 사용 중인 것이며, 패치 적용 여부는 커널 로그나 커밋 내역을 통해 확인해야 합니다.
uname -a | grep -i 'openrisc'