🇰🇷 한글 설명
리눅스 커널의 audit 시스템에서 audit_queue의 길이를 읽는 과정 중 데이터 경합(Data Race) 취약점이 발견되었습니다. 여러 읽기 프로세스가 락(Lock) 없이 길이를 확인하는 동안 쓰기 프로세스가 값을 변경하여 데이터 불일치가 발생할 수 있습니다.
💡 쉬운 설명
시스템의 기록을 담당하는 부분에서 여러 작업이 동시에 정보를 읽고 쓰는 과정 중 충돌이 발생할 수 있는 문제입니다. 이로 인해 시스템 기록이 누락되거나 예상치 못한 동작이 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
audit: Fix data races of skb_queue_len() readers on audit_queue
Multiple readers access audit_queue.qlen via skb_queue_len() without
holding the queue lock or using READ_ONCE(), while kauditd writes to
this field via the skb_dequeue() → __skb_unlink() path with WRITE_ONCE()
protected by a spinlock. This constitutes data races.
All affected skb_queue_len(&audit_queue) call sites:
- kauditd_thread() wait_event_freezable() condition
- audit_receive_msg() AUDIT_GET handler (s.backlog assignment)
- audit_receive() backlog check
- audit_log_start() backlog check and pr_warn()
KCSAN reports the following conflicting access pattern (one example):
==================================================================
BUG: KCSAN: data-race in audit_log_start / skb_dequeue
write (marked) to 0xffffffff8512ee20 of 4 bytes by task 661 on cpu 57:
skb_dequeue+0x70/0xf0
kauditd_send_queue+0x71/0x220
kauditd_thread+0x1cb/0x430
kthread+0x1c2/0x210
ret_from_fork+0x162/0x1a0
ret_from_fork_asm+0x1a/0x30
read to 0xffffffff8512ee20 of 4 bytes by task 36586 on cpu 1:
audit_log_start+0x2a0/0x6b0
audit_core_dumps+0x64/0xa0
do_coredump+0x14b/0x1260
get_signal+0xeb2/0xf70
arch_do_signal_or_restart+0x41/0x170
exit_to_user_mode_loop+0xa2/0x1c0
do_syscall_64+0x1a3/0x1c0
entry_SYSCALL_64_after_hwframe+0x76/0xe0
value changed: 0x00000001 -> 0x00000000
==================================================================
Resolve the race by switching to lockless helper skb_queue_len_lockless(),
which internally uses READ_ONCE() and properly pairs with the WRITE_ONCE()
write accesses already present on the writer side.
[PM: line length tweak]
📍 영향받는 시스템
Linux Kernel (audit subsystem 관련 버전)
⚔️ 공격 벡터
로컬 시스템에서 특정 시스템 호출을 유도하여 데이터 경합을 일으키는 방식
🛡️ 대응 방법
커널 패치를 통해 skb_queue_len() 대신 READ_ONCE()가 적용된 skb_queue_len_lockless()를 사용하도록 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전인지 배포판 보안 공지를 통해 확인