В ядре Linux устранена следующая уязвимость: NFSD: Don't complete a cld upcall демон не прочитал cld_pipe_downcall() соответствует ответу на его upcall только на xid. Запись, которая прибывает до того, как демон прочитал, что вызов завершает __cld_pipe_upcall (), в то время как его структура rpc_pipe_msg все еще стоит в очереди на трубе. Официант возвращается, его кадр стека уходит, и труба сохраняет list_head, который указывает на него.
Следующий rpc_queue_upcall() идет по этому указателю: BUG: KASAN: vmalloc-out-of-bounds в __list_add_valid_or_report Read размера 8 у addr ffffc90007027950 по заданию syz.0.96/13066 __list_add_valid_or_report+0x6a/0x130 rpc_queue_upcall cld_pipe_upcall nfsd4_cld_grace_start nfsd4_cld_tracking_init The трубка является режимом 0600 в rpc_pipefs, поэтому триггером является сломанный или враждебный nfsdcld, а не непривилегированная задача. cld_pipe_destroy_msg() работает по каждому пути, по которому труба выпускает сообщение, поэтому он может поддерживать этот флаг под cn_lock. nfsdcld отправляет свои -EINPROGRESS downcalls только после чтения вызова, поэтому новая проверка не нарушает поток записей GraceStart.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: NFSD: Don't complete a cld upcall the daemon has not read cld_pipe_downcall() matches a reply to its upcall on the xid alone. A write that arrives before the daemon has read that upcall completes __cld_pipe_upcall() while its struct rpc_pipe_msg is still queued on the pipe. The waiter returns, its stack frame goes away, and the pipe keeps a list_head that points into it. The next rpc_queue_upcall() walks that pointer: BUG: KASAN: vmalloc-out-of-bounds in __list_add_valid_or_report Read of size 8 at addr ffffc90007027950 by task syz.0.96/13066 __list_add_valid_or_report+0x6a/0x130 rpc_queue_upcall cld_pipe_upcall nfsd4_cld_grace_start nfsd4_cld_tracking_init The pipe is mode 0600 in rpc_pipefs, so the trigger is a broken or hostile nfsdcld rather than an unprivileged task. Record whether the daemon has consumed the whole message and complete only when it has. cld_pipe_destroy_msg() runs on every path by which the pipe releases a message, so it can maintain that flag under cn_lock. nfsdcld sends its -EINPROGRESS downcalls only after reading the upcall, so the new check does not break the GraceStart record stream.