🇰🇷 한글 설명
Linux 커널의 Landlock 보안 모듈에서 SIGIO 비동기 신호 전달 경로를 통해 LANDLOCK_SCOPE_SIGNAL 제한을 우회할 수 있는 취약점이 발견되었습니다. 샌드박스 내의 프로세스가 프로세스 그룹 설정을 악용하여 보안 모니터나 감독 프로세스 등 외부 프로세스에 신호를 보내거나 종료시킬 수 있습니다.
💡 쉬운 설명
보안 감옥(샌드박스)에 갇힌 프로그램이 감옥의 규칙을 어기고 감옥을 관리하는 관리자 프로그램에게 공격 신호를 보낼 수 있는 결함입니다. 비동기 신호 전달 방식을 이용해 보안 경계를 무력화할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
landlock: Fix LANDLOCK_SCOPE_SIGNAL bypass on the SIGIO path
LANDLOCK_SCOPE_SIGNAL must prevent a sandboxed process from signaling
processes outside its Landlock domain. It can be bypassed through the
asynchronous SIGIO delivery path.
A sandboxed process that owns any file or socket can arm it with
fcntl(fd, F_SETOWN, -pgid), fcntl(fd, F_SETSIG, SIGKILL) and O_ASYNC, so
that an I/O event makes the kernel deliver the chosen signal to the
whole process group. As the head of its process group's task list (the
default position right after fork()) that group can also hold the
non-sandboxed process that launched it, e.g. a supervisor or a security
monitor. The sandbox can thus kill or signal the processes
LANDLOCK_SCOPE_SIGNAL is meant to protect from it.
The scope is enforced in hook_file_send_sigiotask() against the Landlock
domain recorded at F_SETOWN time, not the live domain of the sender.
control_current_fowner() decides whether to record that domain and skips
recording it when the fowner target is in the caller's thread group,
which is safe only for a single-task target (PIDTYPE_PID, PIDTYPE_TGID).
For a process group (PIDTYPE_PGID) pid_task() returns only one member;
recording is skipped whenever that member shares the caller's thread
group, and hook_file_send_sigiotask() then lets the signal fan out to
the whole group unchecked.
Record the domain for every non single-process target so the scope is
enforced against each group member at delivery time.
That recording is necessary but not sufficient on its own: the kernel
signals a process group through its members' thread-group leaders, and
the leader of the registrant's own process can carry a different
Landlock domain than the sibling thread that armed the owner.
domain_is_scoped() would then deny that leader, even though commit
18eb75f3af40 ("landlock: Always allow signals between threads of the
same process") requires same-process delivery to be allowed.
hook_task_kill() avoids this by evaluating same_thread_group() live, per
recipient; the SIGIO path instead delegates the whole decision to a
single registration-time check, which a process-group fan-out cannot
honor.
So also record the registrant's thread group next to its domain and
exempt it at delivery: hook_file_send_sigiotask() allows the signal
whenever the recipient belongs to the registrant's own process,
restoring the same-process guarantee while keeping out-of-domain group
members blocked. The direct kill() path (hook_task_kill) already
evaluates the live domain and is unaffected.
[mic: Check pid_type earlier and improve comment, fix commit message,
fix comment formatting]
📍 영향받는 시스템
Landlock 보안 모듈을 사용하는 Linux 커널 버전
⚔️ 공격 벡터
샌드박스 내 프로세스가 fcntl을 사용하여 프로세스 그룹 전체에 신호를 전달하도록 설정한 후 I/O 이벤트를 발생시켜 외부 프로세스에 신호 전달
🛡️ 대응 방법
Landlock 도메인 기록 로직을 수정하여 프로세스 그룹 멤버에 대한 보안 검사를 강화한 최신 Linux 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 패치된 최신 보안 업데이트 버전인지 확인