В ядре Linux устранена следующая уязвимость:
ceph: привязанная длина значения xattr в __build_xattrs()
__build_xattrs() декодирует предоставленный MDS большой двоичный объект xattr по одному атрибуту.
время. Для каждого атрибута он считывает 32-битное имя и проходит мимо
байты имени, считывает 32-битное значение, записывает указатель значения и
проходит мимо байтов значения. Два поля длины считываются с помощью
ceph_decode_32_safe(), но сами байты значений перемещаются вперед.
с голым «p += len» и без ceph_decode_need() проверьте, что байты «len»
оставаться в блобе.
Для каждого атрибута, кроме последнего, следующая итерация
ceph_decode_32_safe() для следующей длины имени неявно проверяет
что предыдущее значение не выходило за пределы большого двоичного объекта. Финал
атрибут не имеет преемника, поэтому длина его декодированного значения никогда не проверяется
против границ BLOB-объекта. Вредоносный или скомпрометированный сервер метаданных может
установить длину значения последнего атрибута больше, чем фактические байты
присутствует в BLOB-объекте.
Большой двоичный объект представляет собой выделенное выделение kvmalloc(), размер которого соответствует длине провода.
(ceph_buffer_new() в ceph_fill_inode()). __set_xattr() записывает
увеличенная длина в xattr->val_len дословно, а более поздняя версия getxattr(2) запускается
memcpy(value, xattr->val, xattr->val_len) в предоставленный пользователем буфер,
копирование байтов после конца выделения обратно в пространство пользователя. Воздействие: вредоносный сервер метаданных раскрывает соседние байты кучи ядра.
локальному пользователю через getxattr(2) в файле CephFS. Добавьте недостающее
ceph_decode_need(), поэтому длина значения за пределами границ в конечном
Атрибут не декодируется и возвращает -EIO вместо сохранения.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: ceph: bound xattr value length in __build_xattrs() __build_xattrs() decodes the MDS-supplied xattr blob one attribute at a time. For each attribute it reads a 32-bit name length, advances past the name bytes, reads a 32-bit value length, records the value pointer, and advances past the value bytes. The two length fields are read with ceph_decode_32_safe(), but the value bytes themselves are advanced over with a bare "p += len" and no ceph_decode_need() check that "len" bytes remain in the blob. For every attribute except the last, the next iteration's ceph_decode_32_safe() on the following name length implicitly verifies that the previous value did not run past the blob end. The final attribute has no successor, so its decoded value length is never checked against the blob bounds. A malicious or compromised metadata server can set the last attribute's value length larger than the bytes actually present in the blob. The blob is a dedicated kvmalloc() allocation sized to the wire length (ceph_buffer_new() in ceph_fill_inode()). __set_xattr() records the oversized length in xattr->val_len verbatim, and a later getxattr(2) runs memcpy(value, xattr->val, xattr->val_len) into a user-supplied buffer, copying bytes past the end of the allocation back to user space. Impact: a malicious metadata server discloses adjacent kernel heap bytes to a local user via getxattr(2) on a CephFS file. Add the missing ceph_decode_need() so an out-of-bounds value length on the final attribute fails the decode and returns -EIO instead of being stored.
Характеристики атаки
Последствия
Строка CVSS v3.1