🇰🇷 한글 설명
Linux 커널의 SELinux 및 SMACK 구현에서 inode_setsecctx 훅의 권한 검사를 우회하는 취약점이 발견되었습니다. 이로 인해 NFS 클라이언트의 루트 사용자가 root squashing이 활성화된 NFS 파일 시스템의 보안 레이블을 임의로 변경할 수 있습니다.
💡 쉬운 설명
NFS 서버에서 권한을 제한해 두었음에도 불구하고, 클라이언트의 관리자가 파일의 보안 설정을 마음대로 바꿀 수 있는 보안 구멍이 발견되었습니다. 이는 서버가 설정한 보안 규칙을 무력화할 수 있는 위험한 문제입니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
selinux,smack: don't bypass permissions check in inode_setsecctx hook
Marek Gresko reports that the root user on an NFS client is able to
change the security labels on files on an NFS filesystem that is
exported with root squashing enabled.
The end of the kerneldoc comment for __vfs_setxattr_noperm() states:
* This function requires the caller to lock the inode's i_mutex before it
* is executed. It also assumes that the caller will make the appropriate
* permission checks.
nfsd_setattr() does do permissions checking via fh_verify() and
nfsd_permission(), but those don't do all the same permissions checks
that are done by security_inode_setxattr() and its related LSM hooks do.
Since nfsd_setattr() is the only consumer of security_inode_setsecctx(),
simplest solution appears to be to replace the call to
__vfs_setxattr_noperm() with a call to __vfs_setxattr_locked(). This
fixes the above issue and has the added benefit of causing nfsd to
recall conflicting delegations on a file when a client tries to change
its security label.
📍 영향받는 시스템
Linux Kernel (NFS 클라이언트 및 SELinux/SMACK 사용 시스템)
⚔️ 공격 벡터
NFS 클라이언트의 root 사용자가 권한 검사를 우회하여 NFS 파일의 보안 컨텍스트(security label)를 수정
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 __vfs_setxattr_noperm() 호출을 __vfs_setxattr_locked()로 교체
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 해결된 패치 버전인지 배포판 보안 공지를 통해 대조