🇰🇷 한글 설명
Linux 커널의 Mellanox mlx5 드라이버에서 플로우 규칙이 트리 구조에 올바르게 연결되지 않는 취약점입니다. 같은 플로우 핸들 생성 중 규칙이 여러 번 참조될 때 refcount가 2가 되면서 트리에 링크되지 않은 상태가 되어 NULL 부모를 가지게 되고, 플로우 그룹 삭제 시 커널 패닉을 유발합니다.
💡 쉬운 설명
리눅스의 네트워크 드라이버 내부에서 규칙 관리 시스템이 잘못되어 시스템 충돌을 일으킬 수 있습니다. 로컬 접근권한이 있는 공격자가 특정 네트워크 작업을 통해 의도적으로 유발할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
net/mlx5: Properly link new fs rules into the tree
Previously, add_rule_fg would only add newly created rules from the
handle into the tree when they had a refcount of 1. On the other hand,
create_flow_handle tries hard to find and reference already existing
identical rules instead of creating new ones.
These two behaviors can result in a situation where create_flow_handle
1) creates a new rule and references it, then
2) in a subsequent step during the same handle creation references it
again,
resulting in a rule with a refcount of 2 that is not linked into the
tree, will have a NULL parent and root and will result in a crash when
the flow group is deleted because del_sw_hw_rule, invoked on rule
deletion, assumes node->parent is != NULL.
This happened in the wild, due to another bug related to incorrect
handling of duplicate pkt_reformat ids, which lead to the code in
create_flow_handle incorrectly referencing a just-added rule in the same
flow handle, resulting in the problem described above. Full details are
at [1].
This patch changes add_rule_fg to add new rules without parents into
the tree, properly initializing them and avoiding the crash. This makes
it more consistent with how rules are added to an FTE in
create_flow_handle.
📍 영향받는 시스템
Mellanox mlx5 드라이버를 탑재한 Linux 커널 (모든 영향받는 버전, 배포판별로 상이)
⚔️ 공격 벡터
로컬 사용자 권한으로 플로우 핸들 생성 시 규칙 중복 참조를 통한 DoS 공격 (원격 불가)
🛡️ 대응 방법
Linux 커널 업데이트 또는 배포판 보안 패치 적용
🔧 검증 코드
'mlx5 loaded'가 표시되면 해당 드라이버가 활성화된 상태이므로 커널 버전을 확인하여 패치 적용 여부를 검증해야 합니다.
grep mlx5 /proc/modules && echo 'mlx5 loaded' || echo 'mlx5 not loaded'