🇰🇷 한글 설명
Linux 커널의 XFS 파일시스템 xattr 코드에서 디스크 I/O 에러로 인한 ENODATA 에러가 속성 미발견과 구분되지 않아, 잘못된 에러 처리 또는 null 포인터 역참조(oops)를 야기하는 취약점입니다. 낮은 수준의 I/O 함수에서 디스크 에러를 적절히 처리하지 않음으로 인해 발생합니다.
💡 쉬운 설명
Linux 시스템의 파일 속성 관리 기능에서 디스크 오류가 제대로 구분되지 않아 시스템이 오류를 잘못 이해할 수 있습니다. 이로 인해 프로그램이 충돌하거나 잘못된 오류 메시지를 사용자에게 표시될 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
xfs: do not propagate ENODATA disk errors into xattr code
ENODATA (aka ENOATTR) has a very specific meaning in the xfs xattr code;
namely, that the requested attribute name could not be found.
However, a medium error from disk may also return ENODATA. At best,
this medium error may escape to userspace as "attribute not found"
when in fact it's an IO (disk) error.
At worst, we may oops in xfs_attr_leaf_get() when we do:
error = xfs_attr_leaf_hasname(args, &bp);
if (error == -ENOATTR) {
xfs_trans_brelse(args->trans, bp);
return error;
}
because an ENODATA/ENOATTR error from disk leaves us with a null bp,
and the xfs_trans_brelse will then null-deref it.
As discussed on the list, we really need to modify the lower level
IO functions to trap all disk errors and ensure that we don't let
unique errors like this leak up into higher xfs functions - many
like this should be remapped to EIO.
However, this patch directly addresses a reported bug in the xattr
code, and should be safe to backport to stable kernels. A larger-scope
patch to handle more unique errors at lower levels can follow later.
(Note, prior to 07120f1abdff we did not oops, but we did return the
wrong error code to userspace.)
📍 영향받는 시스템
XFS 파일시스템을 사용하는 Linux 커널 (특정 버전의 xattr 코드 영향)
⚔️ 공격 벡터
로컬 공격자가 특정 xattr 작업(파일 속성 읽기/쓰기)을 통해 디스크 I/O 에러를 유발하여 시스템 충돌 또는 권한 상승
🛡️ 대응 방법
Linux 커널을 최신 패치 버전으로 업그레이드하고, 하위 수준 I/O 함수의 에러 처리 개선 패치 적용
🔧 검증 코드
출력된 커널 버전이 취약점이 해결된 버전 이상인지 확인하고, 시스템이 XFS 파일시스템을 지원하는지 확인합니다.
uname -r && grep -q xfs /proc/filesystems && echo 'XFS available' || echo 'XFS not available'